From 3027cead01d8aacce03dc360cedaa4cc44a062fc Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 18 Nov 2020 14:08:17 -0500 Subject: hosted: Improve buffer underrun handling in the ALSA driver * Bump internal mix buffer size by 4x, to 1K frames (matching ALSA period) * Handle an underrun that occurs when filling the audio buffer * Log underruns and make them available in the debug info Change-Id: I28d56dd35d88851fa167ad92368a5882937a758f --- firmware/export/pcm_mixer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'firmware/export') diff --git a/firmware/export/pcm_mixer.h b/firmware/export/pcm_mixer.h index 3d255a7345..39a814de6f 100644 --- a/firmware/export/pcm_mixer.h +++ b/firmware/export/pcm_mixer.h @@ -40,6 +40,10 @@ /* iBasso Devices: Match Rockbox PCM buffer size to ALSA PCM buffer size to minimize memory transfers. */ #define MIX_FRAME_SAMPLES 2048 +#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) +/* Hosted targets need larger buffers for decent performance due to + OS locking/scheduling overhead */ +#define MIX_FRAME_SAMPLES 1024 #else /* Assume HW DMA engine is available or sufficient latency exists in the PCM pathway */ -- cgit v1.2.3