From cc5ad0de4afb4c283e3c6b373b5fd891f9c19381 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 11 Jul 2019 17:07:15 +0300 Subject: [PATCH] gst/pwaudiosink: set the default latency time (buffer size) to be 21.3ms This is to solve underrun issues that seem to appear with the default 10ms latency that GstBaseAudioSink has. Hopefully in the future we will have a better mechanism to pick the appropriate latency instead of hardcoding it here. Upstream-Status: Denied See https://gitlab.freedesktop.org/pipewire/pipewire/merge_requests/140 --- src/gst/gstpwaudiosink.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gst/gstpwaudiosink.c b/src/gst/gstpwaudiosink.c index 6cb71385..069996c3 100644 --- a/src/gst/gstpwaudiosink.c +++ b/src/gst/gstpwaudiosink.c @@ -57,6 +57,13 @@ static void gst_pw_audio_sink_init (GstPwAudioSink * self) { self->props.fd = -1; + + /* Bump the default buffer size up to 21.3 ms, which is the default on most + * sound cards, in hope to match the alsa buffer size on the pipewire server. + * This may not always happen, but it still sounds better than the 10ms + * default latency. This is temporary until we have a better mechanism to + * select the appropriate latency */ + GST_AUDIO_BASE_SINK (self)->latency_time = 21333; } static void -- 2.24.0