Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 07-10-10, 12:34 PM   #1
rnissl
Registered User
 
Join Date: Jun 2005
Posts: 36
Default VdpauDecoderRender() takes unusually long to complete

Hi,

I'm trying to track down some image dropping issues in xine using vdpau. So far it turns out that decoding takes sometimes unusually long. Typically it's much less then image duration (in this case 40 ms), but sometimes it takes ~250 ms or even more. Such large decoding delays cannot be catched up in time and are therefore causing dropped images.

Current driver version is 256.35. It seems to me that this issue was introduced somewhere after 195.3x. My hardware is GF8600GTS, but even other people with C hardware report that issue.

The below backtrace shows where the decoder is at about 35 ms after entering VdpauDecoderRender. Maybe this helps to locate the problem. Feel free to ask for further samples.

Code:
(gdb) bt
#0  0x00007f622a57f4b7 in ioctl () from /lib64/libc.so.6
#1  0x00007f62111ee647 in ?? () from /usr/lib64/libvdpau_nvidia.so
#2  0x00007f62111a32dd in ?? () from /usr/lib64/libvdpau_nvidia.so
#3  0x00007f621119f998 in ?? () from /usr/lib64/libvdpau_nvidia.so
#4  0x00007f62111c14e9 in ?? () from /usr/lib64/libvdpau_nvidia.so
#5  0x00007f621118db2c in ?? () from /usr/lib64/libvdpau_nvidia.so
#6  0x00007f6211180df6 in ?? () from /usr/lib64/libvdpau_nvidia.so
#7  0x00007f62219acc8b in guarded_vdp_decoder_render (decoder=45, target=15, picture_info=0x7f6209071c70, bitstream_buffer_count=1, bitstream_buffers=0x7f6209071fc0) at ../../../xine-lib-1.2/src/video_out/video_out_vdpau.c:239
#8  0x00007f6223d6696b in vdpau_decoder_render (this_gen=0x120cf50, vdp_buffer=0x7f6209071fc0, slice_count=1) at ../../../../xine-lib-1.2/src/video_dec/libvdpau/vdpau_h264.c:710
#9  0x00007f6223d6721b in vdpau_h264_decode_data (this_gen=0x120cf50, buf=0xc8a930) at ../../../../xine-lib-1.2/src/video_dec/libvdpau/vdpau_h264.c:905
#10 0x00007f622cd801f1 in video_decoder_loop (stream_gen=0xbb3290) at ../../../xine-lib-1.2/src/xine-engine/video_decoder.c:383
#11 0x00007f622a81765d in start_thread (arg=<value optimized out>) at pthread_create.c:297
#12 0x00007f622a586e1d in clone () from /lib64/libc.so.6
#13 0x0000000000000000 in ?? ()
(gdb)
Bye.
rnissl is offline   Reply With Quote
Old 07-10-10, 03:06 PM   #2
rnissl
Registered User
 
Join Date: Jun 2005
Posts: 36
Default Re: VdpauDecoderRender() takes unusually long to complete

Hi,

I now have a backtrace of a related issue, where displaying a frame takes extremely long (e. g. ~500 ms). Image duration in this case is 20 ms.

The below backtrace shows the thread which takes care of displaying the decoded images. The backtrace was taken 15 ms after entering VdpauQueueBlock(). The second backtrace is from the decoding thread and was taken at the same time (doing VdpauDecoderRender()).

Code:
(gdb) bt
#0  0x00007f7c9c7ee0b7 in sched_yield () from /lib64/libc.so.6
#1  0x00007f7c96eed87a in sqrtf () at w_sqrtf.c:33
#2  0x00007f7c96eedd70 in sqrtf () at w_sqrtf.c:33
#3  0x00007f7c96eef2bb in ?? () from /usr/lib64/libvdpau_nvidia.so
#4  0x00007f7c97aaf387 in vdpau_display_frame2 (this_gen=0x8009c0, frame_gen=0x88d480) at ../../../xine-lib-1.2/src/video_out/video_out_vdpau.c:1861
#5  0x00007f7c97aaea60 in vdpau_display_frame (this_gen=0x8009c0, frame_gen=0x88d480) at ../../../xine-lib-1.2/src/video_out/video_out_vdpau.c:1698
#6  0x00007f7c9f00239f in overlay_and_display_frame (this=0x889450, img=0x88d480, vpts=63289957) at ../../../xine-lib-1.2/src/xine-engine/video_out.c:1093
#7  0x00007f7c9f0029b0 in video_out_loop (this_gen=0x889450) at ../../../xine-lib-1.2/src/xine-engine/video_out.c:1255
#8  0x00007f7c9ca9565d in start_thread (arg=<value optimized out>) at pthread_create.c:297
#9  0x00007f7c9c804e1d in clone () from /lib64/libc.so.6
#10 0x0000000000000000 in ?? ()
(gdb)

(gdb) bt
#0  0x00007f7c9c7fd4b7 in ioctl () from /lib64/libc.so.6
#1  0x00007f7c96f64647 in ?? () from /usr/lib64/libvdpau_nvidia.so
#2  0x00007f7c96f192dd in ?? () from /usr/lib64/libvdpau_nvidia.so
#3  0x00007f7c96f15998 in ?? () from /usr/lib64/libvdpau_nvidia.so
#4  0x00007f7c96f374e9 in ?? () from /usr/lib64/libvdpau_nvidia.so
#5  0x00007f7c96f03b2c in ?? () from /usr/lib64/libvdpau_nvidia.so
#6  0x00007f7c96ef6df6 in ?? () from /usr/lib64/libvdpau_nvidia.so
#7  0x00007f7c97aa9c8b in guarded_vdp_decoder_render (decoder=46, target=16, picture_info=0x7f7c8e485c70, bitstream_buffer_count=1, bitstream_buffers=0x7f7c8e485fc0) at ../../../xine-lib-1.2/src/video_out/video_out_vdpau.c:239
#8  0x00007f7c7d87c96b in vdpau_decoder_render (this_gen=0x11bf990, vdp_buffer=0x7f7c8e485fc0, slice_count=1) at ../../../../xine-lib-1.2/src/video_dec/libvdpau/vdpau_h264.c:710
#9  0x00007f7c7d87d21b in vdpau_h264_decode_data (this_gen=0x11bf990, buf=0xc17c40) at ../../../../xine-lib-1.2/src/video_dec/libvdpau/vdpau_h264.c:905
#10 0x00007f7c9effe1f1 in video_decoder_loop (stream_gen=0xb3cbf0) at ../../../xine-lib-1.2/src/xine-engine/video_decoder.c:383
#11 0x00007f7c9ca9565d in start_thread (arg=<value optimized out>) at pthread_create.c:297
#12 0x00007f7c9c804e1d in clone () from /lib64/libc.so.6
#13 0x0000000000000000 in ?? ()
(gdb)
Bye.
rnissl is offline   Reply With Quote
Old 07-13-10, 04:31 AM   #3
durchflieger1
Registered User
 
Join Date: Jun 2008
Posts: 2
Default Re: VdpauDecoderRender() takes unusually long to complete

Hi,

i can confirm this behaviour with the current driver version 236.35.
I am using a modified xine-lib-1.2 with profiling for the relevant vdpau calls.
I am testing on two ICP based systems with Ubuntu 9.04/Geforce 8300 and Ubuntu 9.10/ION(C79)/Atom.
The problems are reproducable when playing recordings from the two main german televison stations. These video streams are in TS format 1280x720p.
Affected are mostly all calls related to decoder, mixer and display queue that sporadically take up to 2 seconds of execution time.

Please feel free to ask for samples of this recordings.

When using driver version 195.30 these streams play fine.

- Andreas
durchflieger1 is offline   Reply With Quote
Old 07-14-10, 01:03 PM   #4
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: VdpauDecoderRender() takes unusually long to complete

This typically happens when the HW experiences a problem decoding a particular frame. The extra time taken in the decoding can easily appear to affect other APIs. This could be caused by either a corrupted stream, and/or some kind of SW programming issue. Can you please upload a short sample of problematic streams to the NVIDIA file drop for analysis; see the forum sticky posts for instructions. Thank you. Do you know if the issue reproduced with MPlayer/ffmpeg as well as xine?
Stephen Warren is offline   Reply With Quote
Old 07-14-10, 06:05 PM   #5
rnissl
Registered User
 
Join Date: Jun 2005
Posts: 36
Default Re: VdpauDecoderRender() takes unusually long to complete

Hi,

in my tests I just wanted to make sure that the delays are not caused by other issues in xine-ui/xine-lib, e. g. waiting for XLockDisplay(). The below backtraces seem to rule that out.

So far I haven't tried to reproduce this issue with recordings, but I was told that other people have recordings and can reproduce it even with mplayer (if I recall correctly). What I have recognized so far is that it doesn't appear regularly, so even in a recording it doesn't happen always at the same location. Sometimes I had to watch almost the whole soccer game until one of my watchdogs fired (especially after avoiding the XLockDisplays() which I thought at first caused the delays). Signal strength was good at that time and there were no noticeable errors in the images.

Maybe durchflieger1 can provide further information.

Bye.
rnissl is offline   Reply With Quote
Old 07-15-10, 03:10 AM   #6
stecklum
Registered User
 
Join Date: Feb 2009
Posts: 56
Default Re: VdpauDecoderRender() takes unusually long to complete

Being a German DVB watcher too, I can confirm this behavior, at least from the visual impression. Indeed, I was surprised to see fitful sequences of the soccer games with 236.35/VDPAU on my 8400M GS. I did not notice that before with other drivers.
stecklum is offline   Reply With Quote
Old 01-22-11, 12:08 PM   #7
rnissl
Registered User
 
Join Date: Jun 2005
Posts: 36
Default Re: VdpauDecoderRender() takes unusually long to complete

Hi,

Quote:
Originally Posted by rnissl View Post
So far I haven't tried to reproduce this issue with recordings, but I was told that other people have recordings and can reproduce it even with mplayer (if I recall correctly).
Meanwhile I have been able to reproduce this behavior myself. It happens always for the same call (1795th in xine, 1796th in mplayer) of vdp_decoder_render() when replaying the sample from the beginning.

I'd like to upload that sample to partners.ftp.nvidia.com, but I cannot authenticate with "user ID is vdpau with no password", as mentioned here: http://www.nvnews.net/vbulletin/show...22&postcount=1.

The file plays well with xine and mplayer when using vdpau or software decoding. There are no noticeable decoding artefacts or something like that. Sometimes, the call takes longer than 13 * 40 ms in xine which causes an underrun in xines video output queue and hence a few dropped frames in the video sequence, though without decoding errors.

Attached is a patch for mplayer which gives the following output when playing the sample on my machine:
Code:
A:31440.1 V:31440.1 A-V:  0.000 ct: -0.549 1794/1794  2%  0%  0.4% 29 0 

========== vdp_decoder_render() returned after 44.690 ms ==========
call 1796

A:31444.9 V:31444.9 A-V:  0.000 ct: -0.549 2034/2034  1%  0%  0.4% 29 0
I'm using a GF 8600 GTS, driver 260.19.36.

Bye.
Attached Files
File Type: bz2 watchdogtest.trace.bz2 (54.4 KB, 89 views)
File Type: gz nvidia-bug-report.log.gz (75.4 KB, 89 views)
File Type: bz2 mplayer_watchdog.patch.bz2 (669 Bytes, 86 views)
rnissl is offline   Reply With Quote
Old 01-22-11, 06:28 PM   #8
traxanos
Registered User
 
Join Date: Jan 2011
Posts: 3
Default Re: VdpauDecoderRender() takes unusually long to complete

i have upload the file to my server.

http://marco-scholl.de/vdr/watchdogtest.ts

thanks to rnissl
traxanos is offline   Reply With Quote

Old 01-22-11, 07:02 PM   #9
traxanos
Registered User
 
Join Date: Jan 2011
Posts: 3
Default Re: VdpauDecoderRender() takes unusually long to complete

here my log

http://pastebin.com/DDayYjEp

a second maschine from gda

http://pastebin.de/14103
traxanos is offline   Reply With Quote
Old 01-23-11, 08:01 AM   #10
rnissl
Registered User
 
Join Date: Jun 2005
Posts: 36
Default Re: VdpauDecoderRender() takes unusually long to complete

Hi,

Quote:
Originally Posted by rnissl View Post
The file plays well with xine and mplayer when using vdpau or software decoding. There are no noticeable decoding artefacts or something like that. Sometimes, the call takes longer than 13 * 40 ms in xine which causes an underrun in xines video output queue and hence a few dropped frames in the video sequence, though without decoding errors.
Just wanted to add some further numbers from watching H.264 live TV in xine:
Code:
================= 12:59:58.880 WATCHDOG 35 ms: vdp_decoder_render returned after 894.750 ms =================
vi: (5000, 1080, 3919), ai: (2300,    0, 2300), vo: (30,  0, 13), ao: (32, 25,  7)
0 in the vo log line means, that there are no more frames ready for displaying in the video output queue (under run). As mentioned before, this is noticeable, as decoded frames after the delay get dropped to catch up with output time line.

Code:
================= 13:42:39.404 WATCHDOG 35 ms: vdp_decoder_render returned after 110.619 ms =================
vi: (5000,  576, 4423), ai: (2300,    0, 2300), vo: (30, 10,  2), ao: (32, 26,  6)
10 in the vo log line means, that there are still 10 frames ready for displaying in the video output queue (usually 13 frames are ready, so the queue level delta is 3 frames; the delay matches almost 3 * 40 ms). Hence, there is no noticeable effect (frame drop) of this delay.

Please find attached the xine-lib watchdog patch for creating the above WATCHDOG messages.

Bye.
Attached Files
File Type: bz2 xine_watchdog.patch.bz2 (2.0 KB, 100 views)

Last edited by rnissl; 01-23-11 at 08:06 AM. Reason: Added xine-lib watchdog patch
rnissl is offline   Reply With Quote
Old 01-24-11, 12:52 PM   #11
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: VdpauDecoderRender() takes unusually long to complete

I also see the sftp problem; I'll go bug our IT department about that.

traxanos, just so I'm clear - the sample you uploaded is the one rnissl was testing with?
Stephen Warren is offline   Reply With Quote
Old 01-24-11, 01:50 PM   #12
traxanos
Registered User
 
Join Date: Jan 2011
Posts: 3
Default Re: VdpauDecoderRender() takes unusually long to complete

yes this is our test video.
traxanos is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:29 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.