why does alsasink sync=false fix audio problems?
Charlie Laub
charleslaub at sbcglobal.net
Sat Mar 3 15:20:53 UTC 2018
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.
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180303/5ff80155/attachment.html>
More information about the gstreamer-devel
mailing list