pulseaudio: process audio data in smaller chunks
PATCH 1/1 pulseaudio: process audio data in smaller chunks
The rate of pulseaudio absorbing the audio stream is used to control the the rate of the guests audio stream. When the emulated hardware uses small chunks (like intel-hda does) we need small chunks on the audio backend side too, otherwise that feedback loop doesn't work very well.
--- audio/paaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
audio/paaudio.c +2 -2
@@ -227,7 +227,7 @@ static void *qpa_thread_out (void *arg) } } - decr = to_mix =audio_MIN (pa->live, pa->g->conf.samples >>2 ); + decr = to_mix =audio_MIN (pa->live, pa->g->conf.samples >>5 ); rpos = pa->rpos;if (audio_pt_unlock (&pa->pt, __func__)) {
@@ -319,7 +319,7 @@ static void *qpa_thread_in (void *arg) } } - incr = to_grab =audio_MIN (pa->dead, pa->g->conf.samples >>2 ); + incr = to_grab =audio_MIN (pa->dead, pa->g->conf.samples >>5 ); wpos = pa->wpos;if (audio_pt_unlock (&pa->pt, __func__)) {
Signature · 1 line
2.9.3
Quoted 26 lines · Gerd Hoffmann
The rate of pulseaudio absorbing the audio stream is used to control the the rate of the guests audio stream. When the emulated hardware uses small chunks (like intel-hda does) we need small chunks on the audio backend side too, otherwise that feedback loop doesn't work very well.
Cc Max Ehrlich <[email protected]>Cc Martin Schrodt <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>--- audio/paaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)audio/paaudio.c +1
-1@@ -227,7 +227,7 @@ static void *qpa_thread_out (void *arg) } } - decr = to_mix =audio_MIN (pa->live, pa->g->conf.samples >>2 ); + decr = to_mix =audio_MIN (pa->live, pa->g->conf.samples >>5 ); rpos = pa->rpos;if (audio_pt_unlock (&pa->pt, __func__)) {
audio/paaudio.c static void *qpa_thread_in (void *arg) · line 322
Quoted 5 lines
audio/paaudio.c +1
-1@@ -319,7 +319,7 @@ static void *qpa_thread_in (void *arg) } } - incr = to_grab =audio_MIN (pa->dead, pa->g->conf.samples >>2 ); + incr = to_grab =audio_MIN (pa->dead, pa->g->conf.samples >>5 );
Same pattern/value: can we have a #define?
I looked at the PA intel-hda code and couldn't find the chunk size, anyway this change looks sane.
Quoted 4 lines
audio/paaudio.c +0
-0wpos = pa->wpos;if (audio_pt_unlock (&pa->pt, __func__)) {