Reg pulsesink deadlock in gst_pulsesink_get_time

Akshay Garg aksg86 at gmail.com
Wed Sep 3 09:56:39 PDT 2014


In *gst_audio_base_sink_skew_slaving* inside
*gst-plugins-base/gst-libs/gst/audio/gstaudiobasesink.c
*we call *gst_audio_clock_get_time *on *sink->provided_clock* without
acquiring the *GST_OBJECT_LOCK(sink).* Can we do the same in this case?

Something like:

+diff --git a/gst-libs/gst/audio/gstaudiobasesink.c
b/gst-libs/gst/audio/gstaudiobasesink.c
+index 26f7134..76ddff1 100644
+--- a/gst-libs/gst/audio/gstaudiobasesink.c
++++ b/gst-libs/gst/audio/gstaudiobasesink.c
+@@ -1471,7 +1471,14 @@ gst_audio_base_sink_sync_latency (GstBaseSink *
bsink, GstMiniObject * obj)
+    * our internal clock should exactly have been the latency (== the
running
+    * time of the external clock) */
+   etime = GST_ELEMENT_CAST (sink)->base_time + time;
++
++  // Release the sink object lock before trying to get the time on
PulseSink. The
++  // get_time call needs to acquire the pulse audio main loop lock. This
can cause
++  // a deadlock with the PA thread which in turn has acquired its main
loop lock
++  // and now needs to acquire Object lock on the sink.
*++  GST_OBJECT_UNLOCK (sink);*
*+   itime = gst_audio_clock_get_time (sink->provided_clock);*
*++  GST_OBJECT_LOCK (sink);*
+   itime = gst_audio_clock_adjust (sink->provided_clock, itime);
+
+   if (status == GST_CLOCK_EARLY) {

Thanks
Akshay


On 2 September 2014 19:00, Nicolas Dufresne <nicolas.dufresne at collabora.com>
wrote:

>
> Le 2014-09-02 19:56, Akshay Garg a écrit :
>
>
>  Was wondering if there was a bug filed/fix merged for the following
> issue:
>
>
> http://gstreamer-devel.966125.n4.nabble.com/pulsesink-deadlock-in-gst-pulsesink-get-time-td4660682.html#a4662193
>
>  I'm currently using gst-plugins-good-1.2.0 and still see it.
>
>
> I've seen this in the past after few pulseaudio crash. I recommend to
> update pulseaudio.
>
> Nicolas
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140903/fbce8293/attachment.html>


More information about the gstreamer-devel mailing list