Page 1 of 1

Random high load with rtp streaming

Posted: 17 Feb 2016 12:41
by jhr
I've noticed, that my simple stream without transcoding sometimes works as expected and sometimes gets caught in some kind of busy loop eating all the CPU cycles available. The command line is:

Code: Select all

vlc http://192.168.255.33:8081 --sout "#rtp{dst=239.193.0.1,port=8000,mux=ts,ttl=1}" -vvvvv
Normal expected behaviour gives following performance (top):

Code: Select all

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1473 root 20 0 44548 19740 12600 S 6.9 1.9 0:01.19 vlc
However every now and then I get this kind of figures:

Code: Select all

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1500 root 20 0 50704 25272 12812 S 149.9 2.5 0:21.31 vlc
Any ideas where to start? No error messages, however after the high load situation ctrl-d won't terminate the program. It'll kill the stream but load is still high. I'll have to keep hitting ctrl-c for a while. The frequency is 4 times out of 5 starts I get the high load. VLC version is 2.2.1 (Debian 8 ) and I don't have exact version where it was broken. I tested 1.0.5 in my old server and it didn't have any issues. :)

Quick update, it's 4th thread created that hangs (in case this helps):

Code: Select all

UID PID PPID LWP C root 2740 1 2740 0 root 2740 1 2741 0 root 2740 1 2760 0 root 2740 1 2763 99 root 2740 1 2765 0
The test source stream is just simple H.264 720p streamed from VLC (will eventually be IPTV source) with command:

Code: Select all

vlc Mark\ Ronson\ -\ Uptown\ Funk\ ft.\ Bruno\ Mars720p.mp4 --sout '#standard{access=http,mux=ts}' --http-host 192.168.255.33 --http-port 8081

Re: Random high load with rtp streaming

Posted: 18 Feb 2016 00:46
by Rémi Denis-Courmont
Break in a debugger and see which thread is busy looping.

Re: Random high load with rtp streaming

Posted: 19 Feb 2016 12:19
by jhr
It's the playlist module, it constantly calls parse_tracklist_node() in modules/demux/playlist/xspf.c. No idea why, just 5 minutes ago I learned what xspf is. Here's the backtrace, hope this helps:

Code: Select all

(gdb) bt #0 0xb759b508 in _IO_vfprintf_internal (s=s@entry=0xb58f0da0, format=<optimized out>, format@entry=0xb71c897f "%s <vlc:item tid=\"%i\" />\n", ap=0xb58f0e90 "\213,", ap@entry=0xb58f0e8c "\270\037㳋,") at vfprintf.c:1642 #1 0xb76525a1 in __GI___vasprintf_chk (result_ptr=result_ptr@entry=0xb5e1a020, flags=flags@entry=1, format=format@entry=0xb71c897f "%s <vlc:item tid=\"%i\" />\n", args=args@entry=0xb58f0e8c "\270\037㳋,") at vasprintf_chk.c:66 #2 0xb76524c7 in __asprintf_chk (result_ptr=0xb5e1a020, flags=1, format=0xb71c897f "%s <vlc:item tid=\"%i\" />\n") at asprintf_chk.c:32 #3 0xb71c7ada in ?? () from /usr/lib/vlc/plugins/access/libfilesystem_plugin.so #4 0xb748d3c4 in AStreamRefillBlock () from /usr/lib/libvlccore.so.8 #5 0xb748e4b9 in AStreamReadBlock () from /usr/lib/libvlccore.so.8 #6 0xb748f2d3 in stream_Read () from /usr/lib/libvlccore.so.8 #7 0xb6a01945 in ?? () from /usr/lib/vlc/plugins/stream_filter/librecord_plugin.so #8 0xb748f2d3 in stream_Read () from /usr/lib/libvlccore.so.8 #9 0xb67a6f70 in ?? () from /usr/lib/vlc/plugins/misc/libxml_plugin.so #10 0xb6c92dd3 in xmlParserInputBufferGrow () from /usr/lib/i386-linux-gnu/libxml2.so.2 #11 0xb6d17414 in ?? () from /usr/lib/i386-linux-gnu/libxml2.so.2 #12 0xb6d185ba in ?? () from /usr/lib/i386-linux-gnu/libxml2.so.2 #13 0xb6d18c9e in xmlTextReaderExpand () from /usr/lib/i386-linux-gnu/libxml2.so.2 #14 0xb6d1ba5d in xmlTextReaderRead () from /usr/lib/i386-linux-gnu/libxml2.so.2 #15 0xb67a6e54 in ?? () from /usr/lib/vlc/plugins/misc/libxml_plugin.so #16 0xb680365b in parse_tracklist_node () from /usr/lib/vlc/plugins/demux/libplaylist_plugin.so #17 0xb6803390 in Demux () from /usr/lib/vlc/plugins/demux/libplaylist_plugin.so #18 0xb7486ccc in MainLoop () from /usr/lib/libvlccore.so.8 #19 0xb74878d4 in Run () from /usr/lib/libvlccore.so.8 #20 0xb770fefb in start_thread (arg=0xb58f1b40) at pthread_create.c:309 #21 0xb7641ede in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129