[Bug 761815] playbin: changing playbin flags stalls playback

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Feb 11 14:14:32 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=761815

Thiago Sousa Santos <thiagossantos at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thiagossantos at gmail.com

--- Comment #3 from Thiago Sousa Santos <thiagossantos at gmail.com> ---
Here is what happens when you quickly disable/enable audio:

disable:
1) The pads are set to block for reconfigure
2) they all block and reconfigure happens, disabling audio
3) the audio branch receives a not-linked return and that goes up to
multiqueue, making the audio queue thread sleep until other streams advance or
a reconfigure is received.

enable:
1) pads are set to block
2) multiqueue's video queue thread is about to push and decides to not wake-up
the sleeping queue threads because their time is still smaller than required
and pushes a buffer. This thread will block on playsink
3) multiqueue's audio queue is still waiting to be waken and nothing can wake
it up anymore.

In the end:
Playsink is holding the video thread that could wake up the audio thread
waiting for the audio thread to be blocked.
The audio thread is sleeping because of a not-linked return and needs the video
thread to be waken but playsink is blocking it.

Deadlock!

Thread 11 (Thread 0x7fffca188700 (LWP 20246)):
#0  0x00007ffff4db1689 in syscall () at
../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff5621b1a in g_cond_wait_until (cond=cond at entry=0x6309d8,
mutex=mutex at entry=0x6309d0, end_time=end_time at entry=103471395637) at
/build/glib2.0-2.46.2/./glib/gthread-posix.c:1444
#2  0x00007ffff55b1a19 in g_async_queue_pop_intern_unlocked
(queue=queue at entry=0x6309d0, wait=wait at entry=1,
end_time=end_time at entry=103471395637) at
/build/glib2.0-2.46.2/./glib/gasyncqueue.c:422
#3  0x00007ffff55b203b in g_async_queue_timeout_pop (queue=0x6309d0,
timeout=timeout at entry=15000000) at
/build/glib2.0-2.46.2/./glib/gasyncqueue.c:543
#4  0x00007ffff560441a in g_thread_pool_thread_proxy () at
/build/glib2.0-2.46.2/./glib/gthreadpool.c:167
#5  0x00007ffff560441a in g_thread_pool_thread_proxy (data=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gthreadpool.c:364
#6  0x00007ffff56039c5 in g_thread_proxy (data=0x7fffcc086140) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#7  0x00007ffff5078284 in start_thread (arg=0x7fffca188700) at
pthread_create.c:333
#8  0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 10 (Thread 0x7fffcb1b0700 (LWP 20245)):
#0  0x00007ffff4db1689 in syscall () at
../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff56219ff in g_cond_wait (cond=cond at entry=0x7fffcc0284a0,
mutex=mutex at entry=0x7fffcc028490) at
/build/glib2.0-2.46.2/./glib/gthread-posix.c:1397
#2  0x00007fffe6c6e4ce in gst_queue_loop (pad=<optimized out>) at
gstqueue.c:1475
#3  0x00007ffff78ceaa1 in gst_task_func (task=0x7fffd401b170 [GstTask]) at
gsttask.c:331
#4  0x00007ffff560435e in g_thread_pool_thread_proxy (data=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gthreadpool.c:307
#5  0x00007ffff56039c5 in g_thread_proxy (data=0x7fffcc05fde0) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#6  0x00007ffff5078284 in start_thread (arg=0x7fffcb1b0700) at
pthread_create.c:333
#7  0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 8 (Thread 0x7fffd326d700 (LWP 20243)):
#0  0x00007ffff4db1689 in syscall () at
../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff56219ff in g_cond_wait (cond=cond at entry=0x7fffd4056640,
mutex=mutex at entry=0xb0d560) at
/build/glib2.0-2.46.2/./glib/gthread-posix.c:1397
#2  0x00007fffe6c6a7b5 in gst_multi_queue_loop (pad=<optimized out>) at
gstmultiqueue.c:1626
#3  0x00007ffff78ceaa1 in gst_task_func (task=0xe22cb0 [GstTask]) at
gsttask.c:331
#4  0x00007ffff560435e in g_thread_pool_thread_proxy (data=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gthreadpool.c:307
#5  0x00007ffff56039c5 in g_thread_proxy (data=0x7fffd4053a80) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#6  0x00007ffff5078284 in start_thread (arg=0x7fffd326d700) at
pthread_create.c:333
#7  0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 7 (Thread 0x7fffd3fff700 (LWP 20242)):
#0  0x00007ffff5080edd in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff5605038 in g_usleep (microseconds=microseconds at entry=50000) at
/build/glib2.0-2.46.2/./glib/gtimer.c:259
#2  0x00007fffe49b6a2a in gst_xv_image_sink_event_thread
(xvimagesink=0x7fffd402ba20 [GstXvImageSink]) at xvimagesink.c:586
#3  0x00007ffff56039c5 in g_thread_proxy (data=0x7fffd40139e0) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#4  0x00007ffff5078284 in start_thread (arg=0x7fffd3fff700) at
pthread_create.c:333
#5  0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7fffe53c1700 (LWP 20241)):
#0  0x00007ffff4db1689 in syscall () at
../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff56219ff in g_cond_wait (cond=cond at entry=0x7fffcc024688,
mutex=mutex at entry=0x7fffcc024618) at
/build/glib2.0-2.46.2/./glib/gthread-posix.c:1397
#2  0x00007ffff789924e in do_probe_callbacks (pad=pad at entry=0x7fffcc024600
[GstProxyPad], info=info at entry=0x7fffe53bfdf0,
defaultval=defaultval at entry=GST_FLOW_OK) at gstpad.c:3617
#3  0x00007ffff789c64a in gst_pad_push_data (pad=pad at entry=0x7fffcc024600
[GstProxyPad], type=type at entry=4112, data=data at entry=0x7fffd8004b00) at
gstpad.c:4389
#4  0x00007ffff78a4ce3 in gst_pad_push (pad=pad at entry=0x7fffcc024600
[GstProxyPad], buffer=buffer at entry=0x7fffd8004b00) at gstpad.c:4526
#5  0x00007ffff788dc33 in gst_proxy_pad_chain_default (pad=0x7fffcc022540
[GstGhostPad], parent=<optimized out>, buffer=0x7fffd8004b00) at
gstghostpad.c:126
#6  0x00007ffff789cb32 in gst_pad_push_data (data=0x7fffd8004b00, type=4112,
pad=0x7fffcc022540 [GstGhostPad]) at gstpad.c:4155
#7  0x00007ffff789cb32 in gst_pad_push_data (pad=pad at entry=0x7fffd40176f0
[GstPad], type=type at entry=4112, data=<optimized out>,
data at entry=0x7fffd8004b00) at gstpad.c:4407
#8  0x00007ffff78a4ce3 in gst_pad_push (pad=0x7fffd40176f0 [GstPad],
buffer=buffer at entry=0x7fffd8004b00) at gstpad.c:4526
#9  0x00007fffe6c627ff in gst_selector_pad_chain (pad=<optimized out>,
parent=<optimized out>, buf=0x7fffd8004b00) at gstinputselector.c:1109
#10 0x00007ffff789cb32 in gst_pad_push_data (data=0x7fffd8004b00, type=4112,
pad=0xae19a0 [GstSelectorPad]) at gstpad.c:4155
#11 0x00007ffff789cb32 in gst_pad_push_data (pad=pad at entry=0xa3bd90
[GstGhostPad], type=type at entry=4112, data=<optimized out>,
data at entry=0x7fffd8004b00) at gstpad.c:4407
#12 0x00007ffff78a4ce3 in gst_pad_push (pad=pad at entry=0xa3bd90 [GstGhostPad],
buffer=buffer at entry=0x7fffd8004b00) at gstpad.c:4526
#13 0x00007ffff788dc33 in gst_proxy_pad_chain_default (pad=0xe21d10
[GstProxyPad], parent=<optimized out>, buffer=0x7fffd8004b00) at
gstghostpad.c:126
#14 0x00007ffff789cb32 in gst_pad_push_data (data=0x7fffd8004b00, type=4112,
pad=0xe21d10 [GstProxyPad]) at gstpad.c:4155
#15 0x00007ffff789cb32 in gst_pad_push_data (pad=pad at entry=0xa3cb60
[GstDecodePad], type=type at entry=4112, data=<optimized out>,
data at entry=0x7fffd8004b00) at gstpad.c:4407
#16 0x00007ffff78a4ce3 in gst_pad_push (pad=pad at entry=0xa3cb60 [GstDecodePad],
buffer=buffer at entry=0x7fffd8004b00) at gstpad.c:4526
#17 0x00007ffff788dc33 in gst_proxy_pad_chain_default (pad=0xe20a90
[GstProxyPad], parent=<optimized out>, buffer=0x7fffd8004b00) at
gstghostpad.c:126
#18 0x00007ffff789cb32 in gst_pad_push_data (data=0x7fffd8004b00, type=4112,
pad=0xe20a90 [GstProxyPad]) at gstpad.c:4155
#19 0x00007ffff789cb32 in gst_pad_push_data (pad=pad at entry=0x7fffd4016730
[GstPad], type=type at entry=4112, data=<optimized out>,
data at entry=0x7fffd8004b00) at gstpad.c:4407
#20 0x00007ffff78a4ce3 in gst_pad_push (pad=0x7fffd4016730 [GstPad],
buffer=buffer at entry=0x7fffd8004b00) at gstpad.c:4526
#21 0x00007ffff7b8c727 in gst_video_decoder_clip_and_push_buf
(decoder=decoder at entry=0x7fffd404fe90 [GstVP8Dec],
buf=buf at entry=0x7fffd8004b00) at gstvideodecoder.c:3215
#22 0x00007ffff7b93acb in gst_video_decoder_finish_frame
(decoder=decoder at entry=0x7fffd404fe90 [GstVP8Dec], frame=0x0,
frame at entry=0x7fffd4012b40) at gstvideodecoder.c:3108
#23 0x00007fffe459df81 in gst_vpx_dec_handle_frame (decoder=<optimized out>,
frame=<optimized out>) at gstvpxdec.c:709
#24 0x00007ffff7b8b846 in gst_video_decoder_decode_frame
(decoder=decoder at entry=0x7fffd404fe90 [GstVP8Dec], frame=0x7fffd4012b40) at
gstvideodecoder.c:3417
#25 0x00007ffff7b8ed5d in gst_video_decoder_chain_forward
(decoder=decoder at entry=0x7fffd404fe90 [GstVP8Dec],
buf=buf at entry=0x7fffd40062e0, at_eos=at_eos at entry=0) at gstvideodecoder.c:2201
#26 0x00007ffff7b909c0 in gst_video_decoder_chain (pad=<optimized out>,
parent=<optimized out>, buf=0x7fffd40062e0) at gstvideodecoder.c:2503
#27 0x00007ffff789cb32 in gst_pad_push_data (data=0x7fffd40062e0, type=4112,
pad=0x7fffd40164f0 [GstPad]) at gstpad.c:4155
#28 0x00007ffff789cb32 in gst_pad_push_data (pad=pad at entry=0x7fffd4016070
[GstPad], type=type at entry=4112, data=<optimized out>,
data at entry=0x7fffd40062e0) at gstpad.c:4407
#29 0x00007ffff78a4ce3 in gst_pad_push (pad=0x7fffd4016070 [GstPad],
buffer=buffer at entry=0x7fffd40062e0) at gstpad.c:4526
#30 0x00007fffe6c6ae14 in gst_multi_queue_loop (allow_drop=<synthetic pointer>,
object=0x7fffd40062e0, sq=0x7fffd40191e0, mq=0xb0d3f0 [GstMultiQueue]) at
gstmultiqueue.c:1396
#31 0x00007fffe6c6ae14 in gst_multi_queue_loop (pad=<optimized out>) at
gstmultiqueue.c:1679
#32 0x00007ffff78ceaa1 in gst_task_func (task=0xe22b90 [GstTask]) at
gsttask.c:331
#33 0x00007ffff560435e in g_thread_pool_thread_proxy (data=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gthreadpool.c:307
#34 0x00007ffff56039c5 in g_thread_proxy (data=0x7fffd4013c50) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#35 0x00007ffff5078284 in start_thread (arg=0x7fffe53c1700) at
pthread_create.c:333
#36 0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7fffe5bc2700 (LWP 20240)):
#0  0x00007ffff4db1689 in syscall () at
../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff56219ff in g_cond_wait (cond=cond at entry=0xe17370,
mutex=mutex at entry=0xe17348) at
/build/glib2.0-2.46.2/./glib/gthread-posix.c:1397
#2  0x00007ffff4aae7c2 in gst_data_queue_push (queue=0xe173a0 [GstDataQueue],
item=item at entry=0x7fffd4004800) at gstdataqueue.c:520
#3  0x00007fffe6c696d5 in gst_multi_queue_chain (pad=<optimized out>,
parent=<optimized out>, buffer=0x7fffd40092c0) at gstmultiqueue.c:1871
#4  0x00007ffff789cb32 in gst_pad_push_data (data=0x7fffd40092c0, type=4112,
pad=0xb69d80 [GstPad]) at gstpad.c:4155
#5  0x00007ffff789cb32 in gst_pad_push_data (pad=pad at entry=0xb69b40 [GstPad],
type=type at entry=4112, data=<optimized out>, data at entry=0x7fffd40092c0) at
gstpad.c:4407
#6  0x00007ffff78a4ce3 in gst_pad_push (pad=0xb69b40 [GstPad],
buffer=buffer at entry=0x7fffd40092c0) at gstpad.c:4526
#7  0x00007fffe5ff21e5 in gst_matroska_demux_parse_blockgroup_or_simpleblock
(demux=demux at entry=0x9faf70 [GstMatroskaDemux], ebml=ebml at entry=0x7fffe5bc1a50,
cluster_time=<optimized out>, is_simpleblock=is_simpleblock at entry=1,
cluster_offset=<optimized out>) at matroska-demux.c:3813
#8  0x00007fffe5ff93f5 in gst_matroska_demux_parse_id
(demux=demux at entry=0x9faf70 [GstMatroskaDemux], id=163, length=2328,
needed=<optimized out>) at matroska-demux.c:4465
#9  0x00007fffe5ffdd36 in gst_matroska_demux_loop (pad=<optimized out>) at
matroska-demux.c:4641
#10 0x00007ffff78ceaa1 in gst_task_func (task=0xe225f0 [GstTask]) at
gsttask.c:331
#11 0x00007ffff560435e in g_thread_pool_thread_proxy (data=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gthreadpool.c:307
#12 0x00007ffff56039c5 in g_thread_proxy (data=0x7fffdc0f1540) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#13 0x00007ffff5078284 in start_thread (arg=0x7fffe5bc2700) at
pthread_create.c:333
#14 0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7fffe6c41700 (LWP 20239)):
#0  0x00007ffff4db1689 in syscall () at
../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff56219ff in g_cond_wait (cond=cond at entry=0xe220b0,
mutex=mutex at entry=0xe22068) at
/build/glib2.0-2.46.2/./glib/gthread-posix.c:1397
#2  0x00007ffff78cec2d in gst_task_func (task=0xe22050 [GstTask]) at
gsttask.c:316
#3  0x00007ffff560435e in g_thread_pool_thread_proxy (data=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gthreadpool.c:307
#4  0x00007ffff56039c5 in g_thread_proxy (data=0xd53630) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#5  0x00007ffff5078284 in start_thread (arg=0x7fffe6c41700) at
pthread_create.c:333
#6  0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fffed59d700 (LWP 20238)):
#0  0x00007ffff4daca9d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff55dd1cc in g_main_context_iterate (priority=2147483647, n_fds=2,
fds=0x7fffe00010c0, timeout=<optimized out>, context=0x8830c0) at
/build/glib2.0-2.46.2/./glib/gmain.c:4135
#2  0x00007ffff55dd1cc in g_main_context_iterate (context=0x8830c0,
block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gmain.c:3835
#3  0x00007ffff55dd552 in g_main_loop_run (loop=0x883050) at
/build/glib2.0-2.46.2/./glib/gmain.c:4034
#4  0x00007ffff5bd5396 in gdbus_shared_thread_func (user_data=0x883090) at
/build/glib2.0-2.46.2/./gio/gdbusprivate.c:246
#5  0x00007ffff56039c5 in g_thread_proxy (data=0x85c140) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#6  0x00007ffff5078284 in start_thread (arg=0x7fffed59d700) at
pthread_create.c:333
#7  0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fffedd9e700 (LWP 20237)):
#0  0x00007ffff4daca9d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff55dd1cc in g_main_context_iterate (priority=2147483647, n_fds=1,
fds=0x7fffe80008e0, timeout=<optimized out>, context=0x878d00) at
/build/glib2.0-2.46.2/./glib/gmain.c:4135
#2  0x00007ffff55dd1cc in g_main_context_iterate
(context=context at entry=0x878d00, block=block at entry=1,
dispatch=dispatch at entry=1, self=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gmain.c:3835
#3  0x00007ffff55dd2dc in g_main_context_iteration (context=0x878d00,
may_block=may_block at entry=1) at /build/glib2.0-2.46.2/./glib/gmain.c:3901
#4  0x00007ffff55dd319 in glib_worker_main (data=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gmain.c:5672
#5  0x00007ffff56039c5 in g_thread_proxy (data=0x85c0f0) at
/build/glib2.0-2.46.2/./glib/gthread.c:778
#6  0x00007ffff5078284 in start_thread (arg=0x7fffedd9e700) at
pthread_create.c:333
#7  0x00007ffff4db597d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7f19a00 (LWP 20219)):
#0  0x00007ffff4daca9d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff55dd1cc in g_main_context_iterate (priority=2147483647, n_fds=4,
fds=0xda9310, timeout=<optimized out>, context=0x8392f0) at
/build/glib2.0-2.46.2/./glib/gmain.c:4135
#2  0x00007ffff55dd1cc in g_main_context_iterate (context=0x8392f0,
block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at
/build/glib2.0-2.46.2/./glib/gmain.c:3835
#3  0x00007ffff55dd552 in g_main_loop_run (loop=0xd5ef50) at
/build/glib2.0-2.46.2/./glib/gmain.c:4034
#4  0x00007ffff7112e35 in gtk_main () at
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#5  0x0000000000408065 in main (argc=3, argv=0x7fffffffb7a8) at
playback-test.c:3509

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list