[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/30] paaudio: limit minreq to 75% of audio timer_rate
From: |
Gerd Hoffmann |
Subject: |
[PULL 18/30] paaudio: limit minreq to 75% of audio timer_rate |
Date: |
Fri, 15 Jan 2021 14:21:34 +0100 |
From: Volker RĂ¼melin <vr_qemu@t-online.de>
Currently with the playback buffer attribute minreq = -1 and flag
PA_STREAM_EARLY_REQUESTS PulseAudio uses minreq = tlength / 4.
To improve audio playback with larger PulseAudio server side
buffers, limit minreq to a maximum of 75% of audio timer_rate.
That way there is a good chance qemu receives a stream buffer
size update before it tries to write data to the playback stream.
Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de>
Message-id: 9315afe5-5958-c0b4-ea1e-14769511a9d5@t-online.de
Message-Id: <20210110100239.27588-18-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
audio/paaudio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/audio/paaudio.c b/audio/paaudio.c
index ff3dd01c96dd..318686829428 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -517,7 +517,8 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings
*as,
ss.rate = as->freq;
ba.tlength = pa_usec_to_bytes(ppdo->latency, &ss);
- ba.minreq = -1;
+ ba.minreq = pa_usec_to_bytes(MIN(ppdo->latency >> 2,
+ (g->dev->timer_period >> 2) * 3), &ss);
ba.maxlength = -1;
ba.prebuf = -1;
--
2.29.2
- [PULL 00/30] Audio 20210115 patches, Gerd Hoffmann, 2021/01/15
- [PULL 02/30] audio: fix bit-rotted code, Gerd Hoffmann, 2021/01/15
- [PULL 01/30] sdlaudio: remove leftover SDL1.2 code, Gerd Hoffmann, 2021/01/15
- [PULL 10/30] audio: break generic buffer dependency on mixing-engine, Gerd Hoffmann, 2021/01/15
- [PULL 20/30] dsoundaudio: replace GetForegroundWindow(), Gerd Hoffmann, 2021/01/15
- [PULL 11/30] sdlaudio: enable (in|out).mixing-engine=off, Gerd Hoffmann, 2021/01/15
- [PULL 08/30] audio: split pcm_ops function get_buffer_in, Gerd Hoffmann, 2021/01/15
- [PULL 18/30] paaudio: limit minreq to 75% of audio timer_rate,
Gerd Hoffmann <=
- [PULL 03/30] sdlaudio: add -audiodev sdl,out.buffer-count option, Gerd Hoffmann, 2021/01/15
- [PULL 22/30] dsoundaudio: enable f32 audio sample format, Gerd Hoffmann, 2021/01/15
- [PULL 05/30] sdlaudio: always clear the sample buffer, Gerd Hoffmann, 2021/01/15
- [PULL 04/30] sdlaudio: don't start playback in init routine, Gerd Hoffmann, 2021/01/15
- [PULL 12/30] audio: remove remaining unused plive code, Gerd Hoffmann, 2021/01/15
- [PULL 15/30] paaudio: wait until the playback stream is ready, Gerd Hoffmann, 2021/01/15
- [PULL 21/30] dsoundaudio: rename dsound_open(), Gerd Hoffmann, 2021/01/15
- [PULL 09/30] sdlaudio: add recording functions, Gerd Hoffmann, 2021/01/15
- [PULL 07/30] sdlaudio: replace legacy functions with modern ones, Gerd Hoffmann, 2021/01/15
- [PULL 27/30] audio: Fix lines over 90 characters, Gerd Hoffmann, 2021/01/15