<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1512148125723_254400"><span id="yui_3_16_0_ym19_1_1512148125723_254405">I have run into similar issues. Seems like clocks provided by sound sinks are broken in some situations.</span></div><div id="yui_3_16_0_ym19_1_1512148125723_256377" dir="ltr"><span id="yui_3_16_0_ym19_1_1512148125723_254405">See <a href="https://bugzilla.gnome.org/show_bug.cgi?id=788362" class="enhancr2_b08ec275-c227-3216-2b06-cac403b8056f" id="yui_3_16_0_ym19_1_1512148125723_256382">Bug 788362 – directsoundsrc: provided clock is not monotonic after pause and resume</a><br></span></div><div><br></div><div id="enhancr2_b08ec275-c227-3216-2b06-cac403b8056f" class="yahoo-link-enhancr-card yahoo-link-enhancr-not-allow-cover ymail-preserve-class ymail-preserve-style" style="max-width:400px;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;" data-url="https://bugzilla.gnome.org/show_bug.cgi?id=788362" data-type="yenhancr" data-category="article" data-embed-url="" data-size="medium" dir="ltr" contenteditable="false"> <a href="https://bugzilla.gnome.org/show_bug.cgi?id=788362" style="text-decoration:none !important; color: #000 !important" class="yahoo-enhancr-cardlink" target="_blank" rel="noreferrer"> <table class="card-wrapper" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td width="400"> <table class="card-info" style="background:#fff;max-width:400px;border:1px solid #e0e4e9;border-bottom:3px solid #000000;" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td style="vertical-align:top;padding:16px 0 16px 12px;">  </td> <td style="vertical-align:middle;padding:16px 12px;width:99%;"> <h2 class="card-title" style="margin:0 0 4px 0;font-size:16px;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;word-break:break-word;">Bug 788362 – directsoundsrc: provided clock is not monotonic after pause and resume</h2>  <div class="card-description" style="font-size:11px;line-height:15px;color:#999;word-break:break-word;"></div> </td> <td class="card-share-container"></td> </tr> </tbody></table> </td> </tr> </tbody></table> </a></div><div id="yui_3_16_0_ym19_1_1512148125723_256414"><br></div><div id="yui_3_16_0_ym19_1_1512148125723_254441"><span id="yui_3_16_0_ym19_1_1512148125723_254405"><br></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1512148125723_256415"><span id="yui_3_16_0_ym19_1_1512148125723_254405">Try to add provide-clock=false to your alsasink. The pipeline will then use a system clock which behaves better in my case.</span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: lucida console, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Le Lundi 4 décembre 2017 10h32, toub <etienne.laurent@pa.cotte.fr> a écrit :<br></font></div>  <br><br> <div class="y_msg_container"><div dir="ltr">I develop in C an application relying on soundmixer plugin. My aim is to<br></div><div dir="ltr">trigger sounds on events. As reactivity is critical, I wish to keep<br></div><div dir="ltr">gstreamer pipeline alive, and dynamically plug new sounds on the audiomixer<br></div><div dir="ltr">element (after applying an offset on the new sink of the mixer).<br></div><div dir="ltr">It works pretty well, except that each time if plug a new sound in, the<br></div><div dir="ltr">first 200msec (more or less) of the sound get truncated.<br></div><div dir="ltr">I've been looking into the code, everything looks fine as far as I can see<br></div><div dir="ltr">(no mistake on sound plugin, neither on running time/offset applied).<br></div><div dir="ltr">So I made a try on a simple pipeline with gst-launch, with an offset applied<br></div><div dir="ltr">on the mixer sink: <br></div><div dir="ltr"><br></div><div dir="ltr">gst-launch-1.0 filesrc location=/etc/pa/doublclick_aigu_grave.wav ! wavparse<br></div><div dir="ltr">! audiomixer sink_0::offset=1000000000 ! alsasink<br></div><div dir="ltr"><br></div><div dir="ltr">It turned out that this pipeline truncate the beginning of the sound as<br></div><div dir="ltr">well. When I activated the logs with --gst-debug=alsa:5, I got a bunch of<br></div><div dir="ltr">logs before sound started :<br></div><div dir="ltr"><br></div><div dir="ltr">alsa gstalsasink.c:1054:gst_alsasink_write:<alsasink0> written 441 frames<br></div><div dir="ltr">out of 441<br></div><div dir="ltr"><br></div><div dir="ltr">What is going on here ? Why is the sound truncated ?<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/</a><br></div><div dir="ltr">_______________________________________________<br></div><div dir="ltr">gstreamer-devel mailing list<br></div><div dir="ltr"><a ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br></div><div dir="ltr"><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br></div><br><br></div>  </div> </div>  </div></div></body></html>