playbin as a child element: deadlock when transitioning from PLAYING/PAUSED to NULL
Dustin Spicuzza
dustin at virtualroadside.com
Sat May 30 07:38:34 PDT 2015
On 05/30/2015 07:39 AM, Luis de Bethencourt wrote:
> On 30 May 2015 at 06:14, Dustin Spicuzza <dustin at virtualroadside.com
> <mailto:dustin at virtualroadside.com>> wrote:
>
> Hey,
>
> I'm using GStreamer 1.4.5 on Fedora 21 via gst-python.
>
> I'm embedding playbin elements inside of another pipeline, with
> the goal
> to use multiple playbins to play multiple files simultaneously and
> feed
> them to the same output via an adder -- that part actually works,
> and I
> can play two audio streams at once. So far so good.
>
> However, after I start the pipeline, I've found that I'm having
> problems
> stopping it, and it deadlocks.
>
> PLAYING -> NULL: I did find that if I set the playbin state to NULL
> before setting its parent's state to NULL, then it doesn't deadlock.
> However, this leads me to believe I'm missing something here, as I
> should only need to set the pipe to NULL and not the playbin too,
> right?
>
> PAUSED -> NULL: I don't know how to break this deadlock, I'm sure it's
> something simple I'm missing. It looks like the thread is blocked on a
> pad lock (gstpad.c:966 - gst_pad_activate_mode) on the GhostPad I
> created to connect the playbin to the adder. Using GDB, the owner
> of the
> lock is the PulseSink thread, who is waiting for something to
> happen at
> gst_base_sink_wait_preroll() -- gstbasesink.c:2151.
>
> I've posted a very short python implementation that demonstrates the
> problem with a single playbin at github:
> https://gist.github.com/virtuald/7592a16d6dee07404438
>
> Thanks for any assistance!
>
> Dustin
>
>
> Hello Dustin,
>
> I run your Python code and it works with current GStreamer from git. I
> can't reproduce your deadlock.
>
> Could you provide a debug log? [0]
>
> Also, in your case I think it would be better if you used filesrc and
> decodebin, instead of playbin.
>
> I am not very clear on what is the purpose of the Bin you create. What
> is it for?
>
> Thanks,
> Luis
>
> [0]
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html
Thanks for trying this out Luis. That's unfortunate that it works with
the latest git.
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?
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.
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.
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.
I've added a log to the original gist via:
GST_DEBUG_NO_COLOR=1 GST_DEBUG=4 GST_DEBUG_FILE=debug.log python test.py
https://gist.github.com/virtuald/7592a16d6dee07404438
Thanks so much!
Dustin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150530/26fc79ad/attachment-0001.html>
More information about the gstreamer-devel
mailing list