gst_element_set_state blocked

许永健(研六 福州) xuyongjian at ruijie.com.cn
Fri Jun 6 06:14:30 PDT 2014


Hi
>> I was using autaudiosink and appsrc as my sink and src. A usb earphone
>> was used as output device. The problem was: when I detected the
>> plugging out of the usb earphone, I called gst_element_set_state(pipe,
>> GST_STATE_NULL). Then the function blocked and did not return.

>That sounds like a bug somewhere. Could be in GStreamer, or in the
>drivers.
>
>Maybe connect to the process with gdb to see where the different threads
>are stuck.

With gdb,I found these two interesting stacks:
(gdb) t 1
[Switching to thread 1 (Thread 3524.0xde8)]
#0  0x7c92e4f4 in ntdll!KiFastSystemCallRet () from C:\WINDOWS\system32\ntdll.dll
(gdb) bt
#0  0x7c92e4f4 in ntdll!KiFastSystemCallRet () from C:\WINDOWS\system32\ntdll.dll
#1  0x7c92df3c in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\system32\ntdll.dll
#2  0x7c93b22b in ntdll!RtlpWaitForCriticalSection () from C:\WINDOWS\system32\ntdll.dll
#3  0x7c921046 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\system32\ntdll.dll
#4  0x0000eec8 in ?? ()
#5  0x686317ab in g_thread_xp_AcquireSRWLockExclusive (mutex=0xa2b3e50) at gthread-win32.c:635
#6  0x686318b0 in g_mutex_lock (mutex=0xa2b3e50) at gthread-win32.c:140
#7  0x67541baa in gst_directsound_sink_reset (asink=0xa2b3c08) at gstdirectsoundsink.c:673
#8  0x64bad0dc in _fu572___gst_debug_min () at gstaudiosink.c:534
#9  0x64b84900 in _fu25___gst_debug_min () at gstaudioringbuffer.c:998
#10 0x64b878d7 in _fu87___gst_debug_min () at gstaudioringbuffer.c:1041
#11 0x64ba7a7c in gst_audio_base_sink_change_state (element=0xa2b3c08, transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstaudiobasesink.c:2232
#12 0x6146af97 in gst_element_change_state (element=element at entry=0xa2b3c08, transition=transition at entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstelement.c:2599
#13 0x6146b5e0 in gst_element_set_state_func (element=0xa2b3c08, state=GST_STATE_PAUSED) at gstelement.c:2555
#14 0x6144decb in gst_bin_element_set_state (next=GST_STATE_PAUSED, current=GST_STATE_PLAYING, start_time=8934011725, base_time=32862639246, element=0xa2b3c08, bin=0x6026bf0) at gstbin.c:2323
#15 gst_bin_change_state_func (element=<optimized out>, transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstbin.c:2660
#16 0x63f8254b in _fu10___gst_debug_min () at gstautodetect.c:416
#17 0x6146af97 in gst_element_change_state (element=element at entry=0x6026bf0, transition=transition at entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstelement.c:2599
#18 0x6146b5e0 in gst_element_set_state_func (element=0x6026bf0, state=GST_STATE_PAUSED) at gstelement.c:2555
#19 0x6144decb in gst_bin_element_set_state (next=GST_STATE_PAUSED, current=GST_STATE_PLAYING, start_time=8934011725, base_time=32862639246, element=0x6026bf0, bin=0x1bb9458) at gstbin.c:2323
#20 gst_bin_change_state_func (element=<optimized out>, transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstbin.c:2660
#21 0x6148b564 in gst_pipeline_change_state (element=0x1bb9458, transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstpipeline.c:469
#22 0x6146af97 in gst_element_change_state (element=element at entry=0x1bb9458, transition=transition at entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstelement.c:2599
#23 0x6146b5e0 in gst_element_set_state_func (element=0x1bb9458, state=GST_STATE_NULL) at gstelement.c:2555

(gdb) t 12
[Switching to thread 12 (Thread 3524.0x9a4)]
#0  0x7c92e4f4 in ntdll!KiFastSystemCallRet () from C:\WINDOWS\system32\ntdll.dll
(gdb) bt
#0  0x7c92e4f4 in ntdll!KiFastSystemCallRet () from C:\WINDOWS\system32\ntdll.dll
#1  0x7c92df3c in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\system32\ntdll.dll
#2  0x7c93b22b in ntdll!RtlpWaitForCriticalSection () from C:\WINDOWS\system32\ntdll.dll
#3  0x7c921046 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\system32\ntdll.dll
#4  0x001e3ea0 in ?? ()
#5  0x686317ab in g_thread_xp_AcquireSRWLockExclusive (mutex=0x61e3b7c) at gthread-win32.c:635
#6  0x686318b0 in g_mutex_lock (mutex=mutex at entry=0x61e3b7c) at gthread-win32.c:140
#7  0x6863199b in g_thread_xp_SleepConditionVariableSRW (cond=0x61e3bb0, mutex=0x61e3b7c, timeout=4294967295, flags=0) at gthread-win32.c:856
#8  0x68631cc8 in g_cond_wait (cond=0x61e3bb0, entered_mutex=0x61e3b7c) at gthread-win32.c:302
#9  0x64b8666a in _fu70___gst_debug_min () at gstaudioringbuffer.c:1305
#10 0x64b868d1 in _fu72___gst_debug_min () at gstaudioringbuffer.c:1532
#11 0x64ba1b03 in _fu435___gst_debug_min () at gstaudiobasesink.c:1930
#12 0x6b5dfcae in _fu433___gst_debug_min () at gstbasesink.c:3424
#13 0x6b5e1a9b in _fu445___gst_debug_min () at gstbasesink.c:3532
#14 0x61480ca4 in gst_pad_chain_data_unchecked (data=0x602ca40, type=4112, pad=0x5fc82b8) at gstpad.c:3820
#15 gst_pad_push_data (pad=0x1bb8640, type=4112, data=<optimized out>) at gstpad.c:4053
#16 0x6147110e in gst_proxy_pad_chain_default (pad=0x60271a0, parent=0x6026bf0, buffer=0x602ca40) at gstghostpad.c:126
#17 0x61480ca4 in gst_pad_chain_data_unchecked (data=0x602ca40, type=4112, pad=0x60271a0) at gstpad.c:3820
#18 gst_pad_push_data (pad=0x6026d30, type=4112, data=<optimized out>) at gstpad.c:4053
#19 0x6b5f0dc2 in gst_base_transform_chain (pad=0x60266c8, parent=0x62407b0, buffer=0x602ca40) at gstbasetransform.c:2261
#20 0x61480ca4 in gst_pad_chain_data_unchecked (data=0x602ca40, type=4112, pad=0x60266c8) at gstpad.c:3820
#21 gst_pad_push_data (pad=0x60262f0, type=4112, data=<optimized out>) at gstpad.c:4053
#22 0x6b5f0dc2 in gst_base_transform_chain (pad=0x6026810, parent=0xaf2f830, buffer=0x602cae0) at gstbasetransform.c:2261
#23 0x61480ca4 in gst_pad_chain_data_unchecked (data=0x602cae0, type=4112, pad=0x6026810) at gstpad.c:3820
#24 gst_pad_push_data (pad=0x6026438, type=4112, data=<optimized out>) at gstpad.c:4053
#25 0x6e0a08e4 in gst_queue_push_one (queue=0x6011378) at gstqueue.c:1118
#26 _fu680___gst_buffer_type () at gstqueue.c:1247
#27 0x614af828 in gst_task_func (task=0x5fd0230) at gsttask.c:317
#28 0x68616bc7 in g_thread_pool_thread_proxy (data=0x1c0b370) at gthreadpool.c:309
#29 0x686162ad in g_thread_proxy (data=0x5ffb510) at gthread.c:798
#30 0x68631ecd in g_thread_win32_proxy (data=0x5ffb510) at gthread-win32.c:452
#31 0x77c0a3b0 in msvcrt!_endthreadex () from C:\WINDOWS\system32\msvcrt.dll
#32 0x7c80b713 in KERNEL32!GetModuleFileNameA () from C:\WINDOWS\system32\kernel32.dll
#33 0x00000000 in ?? ()
(gdb)

>What version of GStreamer is this with? I remember there being an issue
>with 0.10 when usb sound devices were disconnected, and I fixed some
>issues in 1.x.
I used 0.10 before. Following your advice, I upgraded gstreamer to 1.3.2. But the problem hadn’t been solved.
The gdb stack was captured with 1.3.2 version.

Thanks!
--
Yongjian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140606/c463e72c/attachment-0001.html>


More information about the gstreamer-devel mailing list