diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-11-18 14:08:17 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-11-18 14:38:12 -0500 |
commit | 3027cead01d8aacce03dc360cedaa4cc44a062fc (patch) | |
tree | f7ff9d4fa1b4ab201580cb3468e36f705b0a9a8d /firmware/target/hosted/pcm-alsa.h | |
parent | 473aa615de2528e469a421d01be007e022d0a5b5 (diff) | |
download | rockbox-3027cead01d8aacce03dc360cedaa4cc44a062fc.tar.gz rockbox-3027cead01d8aacce03dc360cedaa4cc44a062fc.zip |
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
Diffstat (limited to 'firmware/target/hosted/pcm-alsa.h')
-rw-r--r-- | firmware/target/hosted/pcm-alsa.h | 15 |
1 files changed, 8 insertions, 7 deletions
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 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * __________ __ ___. | 2 | * __________ __ ___. |
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * | 8 | * |
9 | * Copyright (C) 2016 Amaury Pouly | 9 | * Copyright (C) 2016 Amaury Pouly |
10 | * | 10 | * |
@@ -34,6 +34,7 @@ void pcm_alsa_set_playback_device(const char *device); | |||
34 | void pcm_alsa_set_capture_device(const char *device); | 34 | void pcm_alsa_set_capture_device(const char *device); |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | int pcm_alsa_get_rate(void); | 37 | unsigned int pcm_alsa_get_rate(void); |
38 | unsigned int pcm_alsa_get_xruns(void); | ||
38 | 39 | ||
39 | #endif /* __PCM_ALSA_RB_H__ */ | 40 | #endif /* __PCM_ALSA_RB_H__ */ |