After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796552 - playbin: deadlock when getting current visualization while playsink is configuring the video chain
playbin: deadlock when getting current visualization while playsink is config...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-06-10 12:44 UTC by Philippe Normand
Modified: 2018-11-03 12:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philippe Normand 2018-06-10 12:44:17 UTC
In my application I would like to enable audio visualization at startup when playing an audio file. So far, I haven't found a better way than handling this in my media-info-updated signal handler. If the info has no video track I check if a visualization was previously set and if it's not the case, set it.

So the visualization is correctly set and playsink starts to create a video chain (thread 20) but the player emits another media-info-updated signal (tags update) and then the main thread deadlocks because playsink is already locked in thread 20.

Am I doing this wrong in my application?

(gdb) t a  a bt

Thread 1 (Thread 0x7f6c98f02d00 (LWP 6289))

  • #0 __lll_lock_wait
    at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 135
  • #1 __GI___pthread_mutex_lock
    at ../nptl/pthread_mutex_lock.c line 113
  • #2 gst_play_sink_get_vis_plugin
    at ../subprojects/gst-plugins-base/gst/playback/gstplaysink.c line 1152
  • #3 gst_play_bin_get_property
    at ../subprojects/gst-plugins-base/gst/playback/gstplaybin2.c line 2671
  • #4 g_object_get_valist
  • #5 g_object_get
  • #6 gst_player_get_current_visualization
    at ../subprojects/gst-plugins-bad/gst-libs/gst/player/gstplayer.c line 4056
  • #7 _ZN16gstreamer_player4auto6player6Player25get_current_visualization17h0693de3353c83230E
  • #8 _ZN5glide16VideoPlayerInner5setup28_\$u7b$$u7b$closure$u7d$$u7d$17h3f3a4147a63220c0E
  • #9 _ZN16gstreamer_player4auto6player29media_info_updated_trampoline17h9e8d1134475ae028E
  • #10 g_closure_invoke
  • #11 0x00007f6c96be4d3e in
  • #12 g_signal_emit_valist
  • #13 g_signal_emit
  • #14 g_main_context_signal_dispatcher_dispatch_gsourcefunc
    at ../subprojects/gst-plugins-bad/gst-libs/gst/player/gstplayer-g-main-context-signal-dispatcher.c line 157
  • #15 g_main_context_dispatch
  • #16 0x00007f6c968f84c0 in
  • #17 g_main_context_iteration
  • #18 g_application_run
  • #19 _ZN60_$LT$O$u20$as$u20$gio..application..ApplicationExtManual$GT$3run17h59b0402f694c4e25E
  • #20 _ZN5glide4main17h310866596ef6834cE
  • #21 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h59461921a35653bdE
  • #22 _ZN3std2rt19lang_start_internal28_$u7b$$u7b$closure$u7d$$u7d$17hb3d070a2bac9f126E
    at libstd/rt.rs line 59
  • #23 _ZN3std9panicking3try7do_call17hfce3050be9508e94E
    at libstd/panicking.rs line 306
  • #24 __rust_maybe_catch_panic
    at libpanic_unwind/lib.rs line 102
  • #25 _ZN3std9panicking3try17h181b418ccf9daec0E
    at libstd/panicking.rs line 285
  • #26 _ZN3std5panic12catch_unwind17h2e22b8787335a1baE
    at libstd/panic.rs line 361
  • #27 _ZN3std2rt19lang_start_internal17h4193b9a4ab9d505aE
    at libstd/rt.rs line 58
  • #28 main

Comment 1 Sebastian Dröge (slomo) 2018-06-10 13:05:36 UTC
Classic deadlock between gtkglsink wanting to run something on the main loop and waiting for the result from the streaming thread (going through playsink's gst_play_sink_do_reconfigure() which has the playsink lock!), and the main loop thread wanting to take the playsink lock.

Needs some lock refactoring in playsink, or gtkglsink not waiting synchronously for the execution in the main loop (which probably is not possible, didn't check the code).
Comment 2 GStreamer system administrator 2018-11-03 12:07:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/459.