[Qemu-devel] [PATCH 25/51] paaudio: fix playback glitches
Hi, a better way to fix the playback glitches is to use a bigger playback buffer on pulseaudio server side. I suggest you replace your patch with a patch like this one: diff --git a/audio/paaudio.c b/audio/paaudio.c index fea6071..8bd5b91 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -554,7 +554,7 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings *as, * qemu audio tick runs at 100 Hz (by default), so processing * data chunks worth 10 ms of sound should be a good fit. */ -ba.tlength = pa_usec_to_bytes (10 * 1000, ); +ba.tlength = pa_usec_to_bytes (50 * 1000, ); ba.minreq = pa_usec_to_bytes (5 * 1000, ); ba.maxlength = -1; ba.prebuf = -1; I tested your patch and while it really improves audio playback, I still notice audio drop-outs. With my suggestion I experience no playback glitches. Regards, Volker
[Qemu-devel] [PATCH 25/51] paaudio: fix playback glitches
Pulseaudio normally assumes that when the server wants it, the client can generate the audio samples and send it right away. Unfortunately this is not the case with QEMU -- it's up to the emulated system when does it generate the samples. Buffering the samples and sending them from a background thread is just a workaround, that doesn't work too well. Instead enable pa's compatibility support and let pa worry about the details. Signed-off-by: Kővágó, Zoltán--- audio/paaudio.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index 4206dd0..2d10afd 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -510,10 +510,8 @@ static pa_stream *qpa_simple_new ( flags = PA_STREAM_INTERPOLATE_TIMING -#ifdef PA_STREAM_ADJUST_LATENCY -|PA_STREAM_ADJUST_LATENCY -#endif -|PA_STREAM_AUTO_TIMING_UPDATE; +|PA_STREAM_AUTO_TIMING_UPDATE +|PA_STREAM_EARLY_REQUESTS; if (dev) { /* don't move the stream if the user specified a sink/source */ -- 2.7.0