Quote:
Originally Posted by tux99 /t/1358314/vaapi-non-nvidia-really-working-yet#post_22102074
I realise this is an old thread but since I came across it I was wondering how hardware assisted decoding works with the FOSS radeon drivers.
Do the FOSS radeon drivers support vaapi (if yes with what back-end?) or how else does this work?
I'm curious because I have never heard before that the FOSS radeon drivers do hardware video decoding!
Current Status
In a nutshell, currently only MPEG2 decoding is available via XvMC & VDPAU state trackers on Gallium3D R300 & R600. At the beginning of this year, some ground work for H.264 decode was laid down in the VDPAU state tracker, but that's unfinished work -- let me get back to this point in a second.
Video decode playback via the state trackers with gallium is done in the 3D engine via shaders, not with the dedicated UVD engine. AMD's OSS driver developers are looking into trying to get UVD support, but they may not be able to because of legal mumbo jumbo surrounding protecting the DRM (digital rights restrictitons management) ... however, that said, it is apparent that code review is (or was) undertaken in this regard. Getting back to the point about the VDPAU state tracker, apparently part of the reason why not too much further progression (or at least as far as I"m aware) with the h.264 implementation has occurred has been because of diversion of resources towards the possibility of adding UVD support. Anyway, the future will tell us more. But in the mean time, back to the story...
A Note on the Mesa Gallium3D drivers
The Gallium3D R300 driver (aka R300g) covers hardware ASICS between R300 and R500 (i.e. up through the X1xxx series) (see
http://en.wikipedia.org/wiki/Comparison_of_ATI_graphics_processing_units#Radeon_R300_series for more details)
The Gallium3D R600 driver (aka R600g) covers hardware ASICS (including that in the Llano Fusion APU hardware) between R600 to NI (see the wikipedia article and work through the R600 (HD 2xxx, HD 3xxx), R700 (HD 4xxx), Evergreen series ( HD 5xxx), NI ( HD 6xxx) )
The Gallium3D RadeonSI driver -- its the new and apparently still very, very basic driver for the Southern Islands ASICS ( HD 7xxx series ...again, see the wikipedia article for some granularity of the devices this covers)
Points of Notoriety in the Development History
Oct/Nov 2010 -- XvMC state tracker with R600g arrives ... MC and iDCT supported
Apr/May 2011 -- VDPAU state tracker with R600g arrives for MPEG2 decode
June-ish 2011 -- both XvMC and VDPAU state tracker support arrives for R300g
July 2011 -- the development branch (Mesa pipe-video) where all this goodness was becoming available is merged into the master Mesa git repo ... this stuff will be introduced in Mesa 8.0 release (Jan 2012)
Nov 2011 - the 6.14.3 release of the xf86-video-ati (radeon) driver (i.e. the DDX)... adds the XvMC & VDPAU support via the Gallium3D drivers for >R300 hardware
Jan 2012 -- some H.264 "infrastructure" laid down in the VDPAU state tracker .... also sometime that month Mesa 8.0 was released.
To present -- see "Current Status" above
Umm, so how do I use these new toys? Part 1
Roughtly nine months ago I wrote:
Quote:
Which likely means -- unless you dig rolling your own kernels, MESA, DDX, blah blah blah (insert associated necessary components here) -- that out of the box acceleration won't be seen by most folks until the mid '12 distro releases.
So here we are about mid '12 and, somewhat surprisingly, that prediction actually held up pretty good I believe.
So, as it stands, you
might possibly be able to use the state trackers to accelerate MPEG2 decode if, installed in your system, you have
- R300 or R600 class hardware
- v6.14.3 or greater of the radeon driver and
- v8.0 or greater of the Mesa drivers and
- Mesa was built with the respective --enable flags for vdpau and xvmc If they were, you should have (assuming a 64bit system, otherwise regular /lib directory)
/usr/lib64/libXvMCr600.so
/usr/lib64/libXvMCsoftpipe.so
/usr/lib64/vdpau/libvdpau_r600.so
/usr/lib64/vdpau/libvdpau_softpipe.so
And while some current distros meet the above listed software requirements out of the box, or their users can get updated driver packages that provide the necessities --- [ Evidently: Ubuntu has updated versions in PPA; Debian provides good to go drivers; as well as Arch and Gentoo too I believe ] ... other distro's do not ... so you'd have to roll your own in those cases. For example, Fedora (
https://bugzilla.redhat.com/show_bug.cgi?id=815569 ) and openSUSE appear not have the build flags enabled.
Umm, so how do I use these new toys? Part 2
To test with MPlayer you could:
via XvMC
(Note: apparently the developers of MPlayer2 removed XvMC support, so you'll have to use the original 'mplayer' to test the XvMC state tracker support)
$ mplayer -vo xvmc -vc ffmpeg12mc filename.mpg
if you are wanted to watch an mpeg2 encoded TV channel (as would be the case with ATSC .... I'm not sure if any DVB-x (x=T,C,S,T2,S2...) streams are mpeg2 anymore or if h.264/avc mpeg4 rules the roost) and provided you have your channels.conf setup, you could very similarly use:
$ mplayer dvb://channelname -vo xvmc -vc ffmpeg12mc
via VDPAU
$ mplayer -vo vdpau -vc ffmpeg12vdpau filename.mpg
$ mplayer dvb://channelname -vo vdpau -vc ffmpeg12vdpau
Hopefully all of the above provides some clarity.