pipewire: update to master as of Nov 19th 2019
[AGL/meta-agl-devel.git] / meta-pipewire / recipes-multimedia / pipewire / pipewire / 0006-gst-pwaudiosink-set-the-default-latency-time-buffer-.patch
1 From cc5ad0de4afb4c283e3c6b373b5fd891f9c19381 Mon Sep 17 00:00:00 2001
2 From: George Kiagiadakis <george.kiagiadakis@collabora.com>
3 Date: Thu, 11 Jul 2019 17:07:15 +0300
4 Subject: [PATCH] gst/pwaudiosink: set the default latency time (buffer size)
5  to be 21.3ms
6
7 This is to solve underrun issues that seem to appear with the default
8 10ms latency that GstBaseAudioSink has.
9 Hopefully in the future we will have a better mechanism to pick
10 the appropriate latency instead of hardcoding it here.
11
12 Upstream-Status: Denied
13 See https://gitlab.freedesktop.org/pipewire/pipewire/merge_requests/140
14 ---
15  src/gst/gstpwaudiosink.c | 7 +++++++
16  1 file changed, 7 insertions(+)
17
18 diff --git a/src/gst/gstpwaudiosink.c b/src/gst/gstpwaudiosink.c
19 index 6cb71385..069996c3 100644
20 --- a/src/gst/gstpwaudiosink.c
21 +++ b/src/gst/gstpwaudiosink.c
22 @@ -57,6 +57,13 @@ static void
23  gst_pw_audio_sink_init (GstPwAudioSink * self)
24  {
25    self->props.fd = -1;
26 +
27 +  /* Bump the default buffer size up to 21.3 ms, which is the default on most
28 +   * sound cards, in hope to match the alsa buffer size on the pipewire server.
29 +   * This may not always happen, but it still sounds better than the 10ms
30 +   * default latency. This is temporary until we have a better mechanism to
31 +   * select the appropriate latency */
32 +  GST_AUDIO_BASE_SINK (self)->latency_time = 21333;
33  }
34  
35  static void
36 -- 
37 2.24.0
38