Skip to content

Commit

Permalink
gst/pwaudiosink: set the default latency time (buffer size) to be 21.3ms
Browse files Browse the repository at this point in the history
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: Submitted [PipeWire#140]
  • Loading branch information
gkiagia committed Aug 1, 2019
1 parent de0491c commit 10cdd1f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gst/gstpwaudiosink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 10cdd1f

Please sign in to comment.