aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schrodt <martin@schrodt.org>2019-06-15 17:38:52 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-07-03 08:50:56 +0200
commit58c15e523af3e70149248e8a2a9dab0fefb4ce91 (patch)
tree8d6b1486cff3474369a566a0216ac7d1d020d38d
parent474f3938d79ab36b9231c9ad3b5a9314c2aeacde (diff)
fix microphone lag with PA
Several people have reported to have bag microphone lag with the PA backend. While I cannot reproduce the problem here, it seems that their PA somehow decides to buffer the microphone input for way too long, causing this delay. This patch sets an upper limit to the amount of data PA should hold. This fixes the problem reliably on their side, while having no adverse effects on mine. Signed-off-by: Martin Schrodt <martin@schrodt.org> Message-id: 20190615153852.99040-1-martin@schrodt.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--audio/paaudio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/paaudio.c b/audio/paaudio.c
index fa9dd9efd4..5fc886bb33 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -618,7 +618,7 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
ss.rate = as->freq;
ba.fragsize = pa_usec_to_bytes(ppdo->latency, &ss);
- ba.maxlength = -1;
+ ba.maxlength = pa_usec_to_bytes(ppdo->latency * 2, &ss);
ba.minreq = -1;
ba.prebuf = -1;