<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.attribute-value
{mso-style-name:attribute-value;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>I am doing some testing with gst-launch (Gstreamer v1.10.4). It’s a simple pipeline that does the following: <o:p></o:p></p><p class=MsoNormal>Another application sends audio to the ALSA loopback device<o:p></o:p></p><p class=MsoNormal>Gstreamer uses the output of the loopback as input<o:p></o:p></p><p class=MsoNormal>The pipeline sends the audio an ALSA sink, a DAC, so I can monitor the audio<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The pipeline is:<o:p></o:p></p><p class=MsoNormal>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’<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This works perfectly, but:<o:p></o:p></p><p class=MsoNormal>When I replace “hw” with “dsnoop” in the alsasrc the audio is either stuttering, or stops after a fraction of a second. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>No errors are produced (that I can see with -vm). <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Later I found this thread:<o:p></o:p></p><p class=MsoNormal><a href="https://e2e.ti.com/support/embedded/linux/f/354/p/569574/2087898">https://e2e.ti.com/support/embedded/linux/f/354/p/569574/2087898</a><o:p></o:p></p><p class=MsoNormal>Near the bottom there is a post dated <span class=attribute-value><a href="https://e2e.ti.com/support/embedded/linux/f/354/p/569574/2087957#2087957">Jan 24, 2017 12:22 PM</a>. The user could only get his similar short alsasrc</span><span class=attribute-value><span style='font-family:Wingdings'>à</span>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.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Why does adding sync=false fix the problem? <o:p></o:p></p><p class=MsoNormal>In general, when should I set sync=false on an alsasink?<o:p></o:p></p></div></body></html>