why does alsasink sync=false fix audio problems?

Nicolas Dufresne nicolas at ndufresne.ca
Sat Mar 3 19:27:31 UTC 2018


Le 3 mars 2018 10:27, "Charlie Laub" <charleslaub at sbcglobal.net> a écrit :

I am doing some testing with gst-launch (Gstreamer v1.10.4). It’s a simple
pipeline that does the following:

Another application sends audio to the ALSA loopback device

Gstreamer uses the output of the loopback as input

The pipeline sends the audio an ALSA sink, a DAC, so I can monitor the audio



The pipeline is:

gst-launch-1.0 -vm alsasrc device=’hw:CARD=Loopback,DEV=1’ ! queue !
audioconvert ! audio/x-raw,channels=2,format=S16LE,rate=48000 ! alsasink
device=’hw:CARD=PCH,DEV=0’



This works perfectly, but:

When I replace “hw” with “dsnoop” in the alsasrc the audio is either
stuttering, or stops after a fraction of a second.


Just like most alsa plugin, dsnoop does not broadcast the extra latency it
is adding. As a side effect, all samples are submitted late and are
dropped. Disabling the sync turns GST into a dummy audio filler. There is
various settings you can play with that will improve this situation, have a
look at latency and buffer-time on alsasrc/sink.



No errors are produced (that I can see with -vm).



For those who are not familiar with it, dsnoop is an ALSA output device
that permits multiple “listeners” to connect to it. I use dsnoop so I can
connect multiple gstreamer pipelines to an audio stream generated by
another application that sends its output to the ALSA loopback.



I find this very strange because I have been using (for more than a year) a
complicated pipeline that takes the EXACT same audio via dsnoop as the
input to the pipeline, but then streams it via RTP/UDP. I never encountered
a problem with that application, it’s only with the simple pipeline I show
above that I am experiencing this problem.



Later I found this thread:

https://e2e.ti.com/support/embedded/linux/f/354/p/569574/2087898

Near the bottom there is a post dated Jan 24, 2017 12:22 PM
<https://e2e.ti.com/support/embedded/linux/f/354/p/569574/2087957#2087957>.
The user could only get his similar short alsasrcàalsasink pipeline working
if sync=false was set on the sink. I tried this and it worked! The pipeline
with dsnoop now plays without error and audio is perfect.



Why does adding sync=false fix the problem?

In general, when should I set sync=false on an alsasink?

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180303/4f25f628/attachment.html>


More information about the gstreamer-devel mailing list