Page 1 of 1

libvlc_media_player_* hangs

Posted: 24 Aug 2009 10:31
by uj2
Hello! I have the following situation. I play multicast UDP stream with libvlc. Then suddenly playback stops, and when I try to access any of the functions libvlc_media_player_*, they all hang altogether with my GUI. It only occurs on two specific streams, both are HD-quality. The thing is I cannot debug VLC. I've tried to build "debug devel" flavour, tried "--disable-optimizations" (or like, when `vlc-config --cflags` outputs -O0). Effects is the same -- gdb just skips over vlc calls... Using tests and trials methods, I was able to determine, that hang occurs in release_input_thread, and inside it on vlc_thread_join just after the input_Stop call. It seems, somewhere in VLC a deadlock occurs. When the stream hangs still, the VLC log has the following messages:

Code: Select all

10:48:11.156: [VLCLOG] [DBG] input.main: control type=17 10:48:11.156: [VLCLOG] [WRN] audio output.main: received buffer in the future 10:48:11.156: [VLCLOG] [DBG] decoder.main: thread times: real 0m59.984375s, kernel 0m0.671875s, user 0m1.171875s 10:48:11.156: [VLCLOG] [DBG] decoder.main: removing module "a52" 10:48:11.156: [VLCLOG] [DBG] decoder.main: killing decoder fourcc `a52 ', 2 PES in FIFO 10:48:11.171: [VLCLOG] [DBG] audio output.main: removing module "a52tofloat32" 10:48:11.171: [VLCLOG] [DBG] audio filter.main: removing module "scaletempo" 10:48:11.171: [VLCLOG] [DBG] audio output.main: removing module "bandlimited_resampler" 10:48:11.171: [VLCLOG] [DBG] audio output.aout_directx: closing audio device 10:48:11.265: [VLCLOG] [DBG] generic.aout_directx: DirectSoundThread exiting 10:48:11.265: [VLCLOG] [DBG] generic.main: thread ended 10:48:11.265: [VLCLOG] [DBG] generic.main: thread times: real 1m0.000000s, kernel 0m0.015625s, user 0m0.015625s 10:48:11.265: [VLCLOG] [DBG] audio output.main: removing module "aout_directx" 10:48:11.265: [VLCLOG] [DBG] audio output.main: removing module "converter_float" 10:48:11.265: [VLCLOG] [DBG] audio output.main: removing module "float32_mixer" 10:48:11.265: [VLCLOG] [DBG] input.main: releasing aout 10:48:11.265: [VLCLOG] [DBG] input.main: control type=17 10:48:11.265: [VLCLOG] [DBG] decoder.main: looking for decoder module: 29 candidates 10:48:11.265: [VLCLOG] [DBG] decoder.main: using decoder module "mpeg_audio" 10:48:11.265: [VLCLOG] [DBG] decoder.main: TIMER module_need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms) 10:48:11.265: [VLCLOG] [DBG] decoder.main: thread (decoder) created at priority 2 (../../../../../vlc-1.0.1/src/input/decoder.c:315) 10:48:11.265: [VLCLOG] [DBG] input.main: control type=17 10:48:11.281: [VLCLOG] [DBG] decoder.main: looking for decoder module: 29 candidates 10:48:11.281: [VLCLOG] [DBG] decoder.main: using decoder module "a52" 10:48:11.281: [VLCLOG] [DBG] decoder.main: TIMER module_need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms) 10:48:11.281: [VLCLOG] [DBG] decoder.main: thread (decoder) created at priority 2 (../../../../../vlc-1.0.1/src/input/decoder.c:315) 10:48:11.281: [VLCLOG] [DBG] decoder.main: thread started 10:48:11.281: [VLCLOG] [DBG] decoder.main: thread started
And just after that, the libvlc_media_player_set_media call hangs, and the following messages occur:

Code: Select all

10:49:35.484: [VLCLOG] [DBG] access.main: waitpipe: object killed 11:08:23.375: [VLCLOG] [DBG] video output.main: skipped big render time 38251000 > 200997
And that's it. I hope somebody will help me with this, for this is really bad. The bad thing I can't get my hands on vlc internals with GDB, I think I miss some option to GCC, that is vital for GDB to debug DLLs...

My system is MinGW-3.4.5, WindowsXP, GDB 6.8.

Re: libvlc_media_player_* hangs

Posted: 24 Aug 2009 13:10
by uj2
One detail: there's periodic calls to libvlc_audio_set_track (every ~1min.) in my working (GUI) thread. Removing this calls seemed to remove hangs. So I consider what happens is this: stream playback "hangs", call to libvlc_audio_set_track occurs, effectively blocking input thread (or making it loop forever without cancellation points), then every call to libvlc_media_player_stop or libvlc_media_player_release hangs on vlc_thread_join(input_thread). Don't know how to identify exact problem and fix it, though. Sorry for sloppy language :)