<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 05/30/2015 07:39 AM, Luis de
      Bethencourt wrote:<br>
    </div>
    <blockquote
cite="mid:CAPA4HGVVY2pium+NpUe9-ogM=G1RL7z652ebF3isWcttSmu3GA@mail.gmail.com"
      type="cite">
      <div dir="ltr">On 30 May 2015 at 06:14, Dustin Spicuzza <span
          dir="ltr"><<a moz-do-not-send="true"
            href="mailto:dustin@virtualroadside.com" target="_blank">dustin@virtualroadside.com</a>></span>
        wrote:<br>
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">Hey,<br>
              <br>
              I'm using GStreamer 1.4.5 on Fedora 21 via gst-python.<br>
              <br>
              I'm embedding playbin elements inside of another pipeline,
              with the goal<br>
              to use multiple playbins to play multiple files
              simultaneously and feed<br>
              them to the same output via an adder -- that part actually
              works, and I<br>
              can play two audio streams at once. So far so good.<br>
              <br>
              However, after I start the pipeline, I've found that I'm
              having problems<br>
              stopping it, and it deadlocks.<br>
              <br>
              PLAYING -> NULL: I did find that if I set the playbin
              state to NULL<br>
              before setting its parent's state to NULL, then it doesn't
              deadlock.<br>
              However, this leads me to believe I'm missing something
              here, as I<br>
              should only need to set the pipe to NULL and not the
              playbin too, right?<br>
              <br>
              PAUSED -> NULL: I don't know how to break this
              deadlock, I'm sure it's<br>
              something simple I'm missing. It looks like the thread is
              blocked on a<br>
              pad lock (gstpad.c:966 - gst_pad_activate_mode) on the
              GhostPad I<br>
              created to connect the playbin to the adder. Using GDB,
              the owner of the<br>
              lock is the PulseSink thread, who is waiting for something
              to happen at<br>
              gst_base_sink_wait_preroll() -- gstbasesink.c:2151.<br>
              <br>
              I've posted a very short python implementation that
              demonstrates the<br>
              problem with a single playbin at github:<br>
              <a moz-do-not-send="true"
                href="https://gist.github.com/virtuald/7592a16d6dee07404438"
                target="_blank">https://gist.github.com/virtuald/7592a16d6dee07404438</a><br>
              <br>
              Thanks for any assistance!<br>
              <br>
              Dustin<br>
            </blockquote>
            <div><br>
            </div>
            <div>Hello Dustin,<br>
              <br>
            </div>
            <div>I run your Python code and it works with current
              GStreamer from git. I can't reproduce your deadlock.<br>
              <br>
            </div>
            <div>Could you provide a debug log? [0]<br>
              <br>
            </div>
            <div>Also, in your case I think it would be better if you
              used filesrc and decodebin, instead of playbin.<br>
              <br>
            </div>
            <div>I am not very clear on what is the purpose of the Bin
              you create. What is it for?<br>
              <br>
            </div>
            <div>Thanks,<br>
            </div>
            <div>Luis<br>
              <br>
              [0] <a moz-do-not-send="true"
href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html</a></div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Thanks for trying this out Luis. That's unfortunate that it works
    with the latest git. <br>
    <br>
    playbin has 5000+ lines of time-tested code that binds
    filesrc/decodebin together, among other things. Why would I try to
    duplicate that effort by creating my own filesrc/decodebin/etc?<br>
    <br>
    The 'pipe' pipeline element is created so that every element can
    have a common parent. Gstreamer doesn't seem to like it if I try to
    connect elements that don't have common parents.<br>
    <br>
    The 'out1' bin element is created so that I can set the 'audio-sink'
    property of the playbin, which connects playbin to the adder via the
    proxy GhostPad. It was the easiest way I could see to get output
    from the playbin.<br>
    <br>
    The goal is to have multiple playbin elements taking care of
    decoding/etc, and hook them all up to the adder and output to a
    single stream -- and dynamically add/remove the playbins and vary
    their volumes independently.<br>
    <br>
    I've added a log to the original gist via:<br>
    <br>
    GST_DEBUG_NO_COLOR=1 GST_DEBUG=4 GST_DEBUG_FILE=debug.log python
    test.py<br>
    <br>
    <a moz-do-not-send="true"
      href="https://gist.github.com/virtuald/7592a16d6dee07404438"
      target="_blank">https://gist.github.com/virtuald/7592a16d6dee07404438</a><br>
    <br>
    Thanks so much!<br>
    <br>
    Dustin<br>
  </body>
</html>