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/target/hosted/pcm-alsa.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'firmware/target/hosted/pcm-alsa.h') diff --git a/firmware/target/hosted/pcm-alsa.h b/firmware/target/hosted/pcm-alsa.h index 1392593c0c..4c0b0d0b9d 100644 --- a/firmware/target/hosted/pcm-alsa.h +++ b/firmware/target/hosted/pcm-alsa.h @@ -1,10 +1,10 @@ /*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ * * Copyright (C) 2016 Amaury Pouly * @@ -34,6 +34,7 @@ void pcm_alsa_set_playback_device(const char *device); void pcm_alsa_set_capture_device(const char *device); #endif -int pcm_alsa_get_rate(void); +unsigned int pcm_alsa_get_rate(void); +unsigned int pcm_alsa_get_xruns(void); #endif /* __PCM_ALSA_RB_H__ */ -- cgit v1.2.3