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 164069 - [clocking] Hang when playing audio file (.wav) with visualization
[clocking] Hang when playing audio file (.wav) with visualization
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.3.3
Other Linux
: Normal normal
: 0.8.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 162548 164160 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-01-14 12:08 UTC by Bastien Nocera
Modified: 2005-01-17 12:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
workaround (1.35 KB, patch)
2005-01-17 12:38 UTC, Ronald Bultje
none Details | Review

Description Bastien Nocera 2005-01-14 12:08:44 UTC
$ ./metadata-test /home/data/Documents/Movie\ Samples/brave_robinsong.wav

(metadata-test:18390): GLib-GObject-WARNING **: gsignal.c:1716: signal
`group-switch' is invalid for instance `0x982e540'

(metadata-test:18390): GLib-GObject-WARNING **: IA__g_object_set_valist: object
class `GstPlayBin' has no property named `suburi'

** (metadata-test:18390): CRITICAL **: file multichannel.c: line 168
(gst_audio_get_channel_positions): assertion `pos_val_arr != NULL' failed

** (metadata-test:18390): CRITICAL **: internal negotiation error

** (metadata-test:18390): WARNING **: could not link audio/x-raw-int,
endianness=(int)1234, width=(int)16, depth=(int)16, signed=(boolean)true,
rate=(int)11025, channels=(int)1

File at:
http://files.hadess.net/redhat/tmp/brave_robinsong.wav
Comment 1 Ronald Bultje 2005-01-17 12:14:14 UTC
Which version of gst-plugins is this? If it's CVS, what version? I can play it
with osssink, alsasink and dmix, and I don't get errors. I have fixed one of the
above warnings a few weeks ago.

In totem, it actually does hang, but only with visualization enabled:

Thread 5 (Thread 33622960 (LWP 988))

  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 pthread_cond_wait
    from /lib/tls/libpthread.so.0
  • #2 gst_queue_chain
    at gstqueue.c line 704
  • #3 gst_pad_call_chain_function
    at gstpad.c line 4476
  • #4 gst_pad_push
    at gstpad.c line 3287
  • #5 gst_visual_chain
    at visual.c line 334
  • #6 gst_pad_call_chain_function
    at gstpad.c line 4476
  • #7 gst_pad_push
    at gstpad.c line 3287
  • #8 gst_audio_convert_chain
    at gstaudioconvert.c line 267
  • #9 gst_pad_call_chain_function
    at gstpad.c line 4476
  • #10 gst_pad_push
    at gstpad.c line 3287
  • #11 gst_tee_chain
    at gsttee.c line 358
  • #12 gst_pad_call_chain_function
  • #13 gst_pad_push
    at gstpad.c line 3287
  • #14 get_group_schedule_function
    at gstoptimalscheduler.c line 1305
  • #15 schedule_group
    at gstoptimalscheduler.c line 1154
  • #16 gst_opt_scheduler_schedule_run_queue
    at gstoptimalscheduler.c line 1205
  • #17 gst_opt_scheduler_get_wrapper
    at gstoptimalscheduler.c line 1451
  • #18 gst_pad_pull
    at gstpad.c line 3342
  • #19 gst_alsa_sink_loop
    at gstalsasink.c line 382
  • #20 loop_group_schedule_function
    at gstoptimalscheduler.c line 1332
  • #21 schedule_group
    at gstoptimalscheduler.c line 1154
  • #22 gst_opt_scheduler_schedule_run_queue
    at gstoptimalscheduler.c line 1205
  • #23 schedule_chain
    at gstoptimalscheduler.c line 1258
  • #24 gst_opt_scheduler_iterate
    at gstoptimalscheduler.c line 2629
  • #25 gst_scheduler_iterate
    at gstscheduler.c line 738
  • #26 gst_bin_iterate_func
    at gstbin.c line 1220
  • #27 gst_marshal_BOOLEAN__VOID
    at gstmarshal.c line 509
  • #28 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #29 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #30 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #31 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #32 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #33 gst_bin_iterate
    at gstbin.c line 1280
  • #34 gst_thread_main_loop
    at gstthread.c line 671
  • #35 g_static_private_free
    from /usr/lib/libglib-2.0.so.0
  • #36 start_thread
    from /lib/tls/libpthread.so.0
  • #37 clone
    from /lib/tls/libc.so.6

Thread 3 (Thread 45476784 (LWP 986))

  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 pthread_cond_wait
    from /lib/tls/libpthread.so.0
  • #2 gst_queue_chain
    at gstqueue.c line 704
  • #3 gst_pad_call_chain_function
    at gstpad.c line 4476
  • #4 gst_pad_push
    at gstpad.c line 3287
  • #5 gst_stream_selector_chain
    at gststreamselector.c line 279
  • #6 gst_pad_call_chain_function
    at gstpad.c line 4476
  • #7 gst_pad_push
    at gstpad.c line 3287
  • #8 gst_wavparse_loop
    at gstwavparse.c line 753
  • #9 loop_group_schedule_function
    at gstoptimalscheduler.c line 1332
  • #10 schedule_group
    at gstoptimalscheduler.c line 1154
  • #11 gst_opt_scheduler_schedule_run_queue
    at gstoptimalscheduler.c line 1205
  • #12 schedule_chain
    at gstoptimalscheduler.c line 1258
  • #13 gst_opt_scheduler_iterate
  • #14 gst_scheduler_iterate
    at gstscheduler.c line 738
  • #15 gst_bin_iterate_func
    at gstbin.c line 1220
  • #16 gst_marshal_BOOLEAN__VOID
    at gstmarshal.c line 509
  • #17 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #18 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #19 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #22 gst_bin_iterate
    at gstbin.c line 1280
  • #23 gst_thread_main_loop
    at gstthread.c line 671
  • #24 g_static_private_free
    from /usr/lib/libglib-2.0.so.0
  • #25 start_thread
    from /lib/tls/libpthread.so.0
  • #26 clone
    from /lib/tls/libc.so.6

Thread 4 is the video, thread 5 is the visualization thread (plus audio) and
thread 3 is the decoder. Seems like a deadlock, probably wrong timestamps.

LOG   (0x9a79a50 - 307211:47:39.543223000)     xvimagesink( 1024)
xvimagesink.c(1405):gst_xvimagesink_chain:<xvimagesink0> clock wait:
0:00:00.100000000
DEBUG (0x9a79a50 - 307211:47:39.543674000)            alsa( 1024)
gstalsaclock.c(193):gst_alsa_clock_wait:<alsasinkclock> real_target
307211:47:39.335004000 target 307211:47:39.335004000 now 307211:47:39.235004000
LOG   (0x9fa18d8 - 307211:47:39.583367000)            alsa( 1024)
gstalsasink.c(384):gst_alsa_sink_loop:<alsasink0> pulled data 0x98d66a0 from pad 0
DEBUG (0x9fa18d8 - 307211:47:39.583645000)            alsa( 1024)
gstalsasink.c(163):gst_alsa_sink_flush_one_pad:<alsasink0> flushing pad 0
DEBUG (0x9fa18d8 - 307211:47:39.583751000)            alsa( 1024)
gstalsasink.c(167):gst_alsa_sink_flush_one_pad:<alsasink0> unreffing gst data
0x98d66a0
LOG   (0x9fa18d8 - 307211:47:39.827302000)            alsa( 1024)
gstalsasink.c(384):gst_alsa_sink_loop:<alsasink0> pulled data 0x98d66a0 from pad 0
DEBUG (0x9fa18d8 - 307211:47:39.919839000)            alsa( 1024)
gstalsasink.c(163):gst_alsa_sink_flush_one_pad:<alsasink0> flushing pad 0
DEBUG (0x9fa18d8 - 307211:47:39.920196000)            alsa( 1024)
gstalsasink.c(167):gst_alsa_sink_flush_one_pad:<alsasink0> unreffing gst data
0x98d66a0
LOG   (0x9fa18d8 - 307211:47:40.037103000)            alsa( 1024)
gstalsasink.c(384):gst_alsa_sink_loop:<alsasink0> pulled data 0x98d66a0 from pad 0
DEBUG (0x9fa18d8 - 307211:47:40.037706000)            alsa( 1024)
gstalsasink.c(163):gst_alsa_sink_flush_one_pad:<alsasink0> flushing pad 0
DEBUG (0x9fa18d8 - 307211:47:40.038033000)            alsa( 1024)
gstalsasink.c(167):gst_alsa_sink_flush_one_pad:<alsasink0> unreffing gst data
0x98d66a0
LOG   (0x9fa18d8 - 307211:47:40.167486000)            alsa( 1024)
gstalsasink.c(384):gst_alsa_sink_loop:<alsasink0> pulled data 0x98d66a0 from pad 0
DEBUG (0x9fa18d8 - 307211:47:40.250631000)            alsa( 1024)
gstalsasink.c(163):gst_alsa_sink_flush_one_pad:<alsasink0> flushing pad 0
DEBUG (0x9fa18d8 - 307211:47:40.251013000)            alsa( 1024)
gstalsasink.c(167):gst_alsa_sink_flush_one_pad:<alsasink0> unreffing gst data
0x98d66a0

This is inside alsa's context. This basically means that alsa's gst_pad_pull
triggered a push in tee on the other pad, which waits on an update in alsa.
Making audio a thread doesn't solve it, since the deadlock is still there, but
on a queue boundary (I actually tested that...).

It gets stuck in the wait loop in gstalsaclock.c:gst_alsa_clock_wait, with:
LOG   (0x9546a50 - 307212:09:40.752929000)            alsa( 3471)
gstalsaclock.c(200):gst_alsa_clock_wait: 1105963772770298000 <
1105963772870298000, 0 < 1105963772770298000

The weird thing is that the audio clock is actually already at 0.9s, while we're
still waiting for 0.1s. I don't know why that happens. I think alsaclock should
have a max. wait time of maybe 1.5 * diff, because this is a deadlock. Besides
that, we (I) should figure out why the clock is not updated properly...

GStreamer bug, so re-assigning
Comment 2 Ronald Bultje 2005-01-17 12:22:06 UTC
alsasink:get_time() gives this on the hang:
Delay: 12288, played: 12288

which implies that alsa isn't actually running yet... Probably an alsasink bug
after all?
Comment 3 Ronald Bultje 2005-01-17 12:38:25 UTC
Created attachment 36129 [details] [review]
workaround

Adds a maximum of 1.5 times the request/current diff as waiting time. This
fixes the issue in this bug for me. The fact that alsa doesn't run yet is
probably alsa buffering, and therefore not a GStreamer bug. The proper
workaround would actually be to implement this behaviour.
Comment 4 Ronald Bultje 2005-01-17 12:45:13 UTC
Applied, but using the GST_TIMEVAL_TO_TIME() macro instead.
Comment 5 Ronald Bultje 2005-01-17 12:45:46 UTC
*** Bug 164160 has been marked as a duplicate of this bug. ***
Comment 6 Ronald Bultje 2005-01-17 12:46:01 UTC
*** Bug 162548 has been marked as a duplicate of this bug. ***