Opened 11 years ago

Closed 10 years ago

#6130 closed patch (fixed)

Experimental VDPAU optimisations

Reported by: markk Owned by: markk
Priority: minor Milestone: 0.22
Component: MythTV - Video Playback Version: head
Severity: medium Keywords: vdpau
Cc: Ticket locked: no

Description

Patch against r19681 which attempts to follow the NVIDIA performance recommendations as described at:-

http://us.download.nvidia.com/XFree86/Linux-x86/180.22/README/appendix-h-section-03.html

In summary:

  • allocate a bare minimum of 6 video buffers initially (currently 17)
  • create flip queue, osd etc as normal
  • use the h.264 stream info to allocate the number of internal decoder reference frames (usually less than the existing estimate)
  • if additional resources are available, add extra video buffers depending on the number of reference frames and deinterlacing.
  • if resources are still available, add additional output surfaces.

This should make playback more reliable on 256Mb cards and improve deinterlacing performance for lower end GPUs.

The most likely side effect (for 256Mb cards) is that PiP will no longer work.

Attachments (2)

vdpau_optimisations.diff (23.4 KB) - added by anonymous 11 years ago.
video_surfaces.diff (12.2 KB) - added by markk 10 years ago.
Updated patch for remaining decoder/video surfaces optimisation.

Download all attachments as: .zip

Change History (13)

Changed 11 years ago by anonymous

Attachment: vdpau_optimisations.diff added

comment:1 Changed 11 years ago by jheikkal@…

Just tried your patch with 8400GS(G98) 256MB and it made vdpau usable :P Default setup wouldn't even play SD stuff.

comment:2 Changed 11 years ago by markk

(In [19792]) Refs #6130. Use h.264 stream info to set the number of VDPAU decoder reference frames.

comment:3 Changed 11 years ago by markk

(In [19794]) Refs #6130. Increase the number of VDPAU output surfaces if there are enough resources. Testing with an 8400GS, there is a clear but small performance improvement with 4 surfaces rather than 2.

comment:4 Changed 11 years ago by jheikkal@…

Hmm...maybe resource checking is too aggressive? I'm getting VDPAU Error: Error at util-vdpau.cpp:1269 (#23, The system does not have enough resources to complete the requested operation at this time.) when trying to play 1080i h.264 stream. Tho only 256MB card. And I'm getting blank screen with SD mpeg =(

comment:5 Changed 10 years ago by jyavenard@…

What about merging those changes to trunk ? why keep a separate patch ?

I see that quite a few of those changes have made their way into trunk already..

Changed 10 years ago by markk

Attachment: video_surfaces.diff added

Updated patch for remaining decoder/video surfaces optimisation.

comment:6 Changed 10 years ago by markk

(In [20016]) Add the ability to dynamically increase the number of VDPAU video buffers. Refs #6130. N.B. not actually used yet.

comment:7 Changed 10 years ago by jo@…

witch revision 20016 and NVIDIA driver 180.29 I had to increase MAX_OUTPUT_SURFACES to 8 to play 1080p on my EN8600GT/HTDI/256M

comment:8 Changed 10 years ago by paulh

Owner: changed from Isaac Richards to markk
Status: newassigned

comment:9 Changed 10 years ago by markk

Component: Video PlaybackMythTV - Video Playback
Milestone: unknown0.22
Status: assignedaccepted

comment:10 Changed 10 years ago by markk

(In [22132]) VDPAU video buffering improvements.

Firstly, tweak the video buffers setup to fix the playback of certain h.264 streams (most notably, the infamous Wimbledon clip). I've tested extensively with my library of VDPAU 'special' clips on 2 setups and this does not seem to have an adverse impact anywhere and it does reduce the overall buffer size needed for some streams with 4 or more reference frames.

Secondly, add an option for the user to specify the number of VDPAU video buffers to use. It is enabled by adding vdpaubuffersize=X to the filters section of the video display profile. Valid values for X are in the range 6-50, 6 being the minimum that seems to work with most mpeg2 and h264 interlaced streams (with 2 reference frames).

The lowest setting can save over 80Mb of video memory for 1080i/p streams compared to the default buffer size of 17 frames. This may be enough for VDPAU playback on video cards with 256Mb of memory (though certainly no guarantee).

Increasing the video buffer size should fix playback for problematic streams with more than 2 reference frames. For example, the well known 'killa.sampla' h.264 clip needs around 32 video buffers for decent playback (16 reference frames) and most broken streams with 4 reference frames seem to need around 22 buffers.

This a stop gap fix for 0.22 and *should* be replaced by a more robust/intelligent/automatic solution for 0.23 - I just haven't worked out the magic formula yet...

Refs #7138, #6130.

comment:11 Changed 10 years ago by markk

Resolution: fixed
Status: acceptedclosed

Closing for 0.22. Any further improvements will be picked when VideoOutputVDPAU gets an overhaul for 0.23.

Note: See TracTickets for help on using tickets.