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 602887 - shout2send element won't change from PLAYING state to NULL
shout2send element won't change from PLAYING state to NULL
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.14
Other Linux
: Normal normal
: 0.10.18
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-25 03:11 UTC by Ian Turner
Modified: 2009-11-28 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case which demonstrates the problem. (2.01 KB, text/x-csrc)
2009-11-25 03:11 UTC, Ian Turner
Details

Description Ian Turner 2009-11-25 03:11:37 UTC
Created attachment 148428 [details]
Test case which demonstrates the problem.

... more precisely, the element will change to NULL, but only once the stream is complete. gst_element_set_state blocks until that point, waiting for a mutex.

Attached is a test case which demonstrates the behavior. Provide an ogg vorbis file at least 30 seconds long; the program should end after only 15 seconds, but instead does not end until the audio file is complete.

During this time, there are two threads (the pipeline thread and the control thread, I suppose.) The primary thread has a backtrace like this:

  • #0 __kernel_vsyscall
  • #1 __lll_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 _L_lock_89
    from /lib/tls/i686/cmov/libpthread.so.0
  • #3 pthread_mutex_lock
    from /lib/tls/i686/cmov/libpthread.so.0
  • #4 gst_base_sink_change_state
    at gstbasesink.c line 4106
  • #5 gst_element_change_state
    at gstelement.c line 2427
  • #6 gst_element_set_state_func
    at gstelement.c line 2377
  • #7 gst_element_set_state
    at gstelement.c line 2280
  • #8 gst_bin_change_state_func
    at gstbin.c line 2062
  • #9 gst_pipeline_change_state
    at gstpipeline.c line 465
  • #10 gst_element_change_state
    at gstelement.c line 2427
  • #11 gst_element_set_state_func
    at gstelement.c line 2377
  • #12 gst_element_set_state
    at gstelement.c line 2280
  • #13 gst_element_set_state_sync
    at testcase.c line 20
  • #0 __kernel_vsyscall
  • #1 select
    from /lib/tls/i686/cmov/libc.so.6
  • #2 _shout_timing_sleep
    from /usr/lib/libshout.so.3
  • #3 shout_sync
    from /usr/lib/libshout.so.3
  • #4 gst_shout2send_render
    at gstshout2.c line 605
  • #5 gst_base_sink_render_object
    at gstbasesink.c line 2359
  • #6 gst_base_sink_queue_object_unlocked
    at gstbasesink.c line 2566
  • #7 gst_base_sink_chain_unlocked
    at gstbasesink.c line 2923
  • #8 gst_base_sink_chain
    at gstbasesink.c line 2964
  • #9 gst_pad_chain_unchecked
    at gstpad.c line 3890
  • #10 gst_pad_push
    at gstpad.c line 4057
  • #11 gst_base_src_loop
    at gstbasesrc.c line 2275
  • #12 gst_task_func
    at gsttask.c line 192
  • #13 g_thread_pool_thread_proxy
    at /build/buildd/glib2.0-2.20.1/glib/gthreadpool.c line 265
  • #14 g_thread_create_proxy
    at /build/buildd/glib2.0-2.20.1/glib/gthread.c line 635
  • #15 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #16 clone
    from /lib/tls/i686/cmov/libc.so.6

Comment 1 Ian Turner 2009-11-25 03:12:43 UTC
The backtrace pretty printer ate my notes, which indicated that the second backtrace is an example of the playing thread. As the playing thread continues to run, it cannot be documented with a single backtrace.
Comment 2 Wim Taymans 2009-11-28 18:26:12 UTC
We relied on scheduling to acquire a lock instead of explicitly giving up control of the streaming thread. Following patch fixes it.

commit 4519bdc9833dc6d59135ef57873f45c273aee7b2
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Sat Nov 28 19:23:26 2009 +0100

    shout2: use gstpoll for timeouts
    
    Use our own GstPoll based timeout instead of the shout sleep so that we can
    interrupt when doing a state change and shutting down.
    
    Fixes #602887
Comment 3 Ian Turner 2009-11-28 20:38:35 UTC
Thanks Wim.