[Linux] Radeon OSS with vdpau (howto) - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: XBMC General Help and Support (/forumdisplay.php?fid=111)
+---- Forum: Linux and Live support (/forumdisplay.php?fid=52)
+---- Thread: [Linux] Radeon OSS with vdpau (howto) (/showthread.php?tid=174854)
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
Radeon OSS with vdpau (howto) - fritsch - 2013-10-03 10:52
Warning: This Howto assumes you know how to use ssh and howto create a file on a linux system. Furthermore you need to know what sudo is - if one is unknown to you - this is not the howto you want to follow
After AMD proprietary department did not care for XvBA for more than 2 years now and no AMD driver since 12.10 was really usable, we got into contact with the AMD OSS devs. Within just 2 weeks, we got more working than we ever hoped with the oss radeon vdpau in comparison to fglrx binary blob xvba implementation. As it now made a whole lot of fun working with AMD hardware, we have dropped XvBA completely (it is parked in fernetmentas xvba branch).
What you get
- Bitstream Audio (including DTS-HD, TrueHD, LPCM 7.1)
- max resolution: 2048 x 1152
- mpeg2, mpeg4, h264, vc1 advanced accleration
- Bob and Temporal deinterlacing via vdpau
- 110% speed as with the fglrx implementation
Known issues for now
- xbmc will segfault when you press stop - this will be fixed when ubuntu updates their mesa package (See the workaround below)
-1.) Hardware Requirements / Software Requirements
UVD 2.2 or higher See here: http://en.wikipedia.org/wiki/Unified_Video_Decoder#UVD_enabled_GPUs
Ubuntu Trusty mini or server iso installed x64.
You can download the mini.iso here: http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/mini.iso
UEFI: If you need an UEFI installation, please use the server iso instead, but make sure you boot the Computer in UEFI mode, you can download the server iso from here: http://cdimage.ubuntu.com/ubuntu-server/daily/current/trusty-server-amd64.iso
0.) Basic Installation and script tuning
After the mini iso is installed, continue with the following steps:
Allow every user (everyone) to start X11
Create the xbmc user and it add it the relevant groups. If you have created the xbmc user during installation only do the usermod part.
To use the following upstart procedure you need to create /etc/init/xbmc.conf to start xbmc via upstart. That scripts does only wait for your HDMI device, if you want to wait for networking, you have to add that.
edit /etc/security/limits.conf and add before the end. remember xbmc is the username, not the application. This will allow your user to get the audio thread a bit more priority.
Last thing is missing some permissions to shutdown, suspend the computer, therefore create the file /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla with the following content (don't introduce line breaks, especially the Action= line must be exactly one line (especially no linebreaks or auto ".." in freedesktop.udisks.*), verify this):
1a) Installation of the Fernetmenta version of xbmc with hevc, ffmpeg 2.2.x)
This option 1a includes the following changes:
- multimonitor support (SDL is removed)
- ffmpeg 2.2.x with HEVC (aka H265) support
- VC1 interlaced playback support
- SWFilter for VAAPI installations for advanced deinterlacing (not relevant for AMD users)
- It is based on xbmc master therefore will likely get unstable after gotham is out.
XOR You only need one of those
1b) Installation of the team xbmc repository with gotham final mainline builds
We are done now with installing. We will reboot now, remember to make the following settings within xbmc in step 2. It could also be good to disable the RSS Reader to save some processing power.
If you loose keyboard with the option 1a, please use 1b instead ... SDL won't survive it ...
2.) XBMC settings
(Set xbmc to Advanced or Expert before doing this - settings hierarchies, see in the middle of confluence)
Vertical blank sync: Let Driver choose
Prefer VDPAU Mixer: ON
System -> Video -> Playback:
Adjust Refreshrate to match video: On
Sync Playback to Display: On
Sync Method: Video Clock (Drop/Dupe)
advancedsettings.xml in /home/xbmc/.xbmc/userdata/advancedsettings.xml should contain (don't create that file / directory as root - use the xbmc user):
Here we need to workaround a segfault bug, when stopping videos (this will hopefully be fixed with final trusty released):
Final reboot and we are done:
Installation is now finished - you can start to enjoy your xbmc installation
In case something should not work as you expected it, please follow the Troubleshooting steps.
We need full debug logs that show the issue. We don't look at cut out logfiles, as most of the time, the important part is missing. Additionally get us the output of dmesg, Xorg.0.log and vdpauinfo. Don't post the logs inline, don't use google drive or something, just post links to known pastebins. Set xbmc into debugging mode, redo what is causing errors and afterwards do:
If you have bad luck, you got an AMD card that does mpeg-2 decoding in shaders, which segfaults when done multithreaded. Switch Confluence to Expert and disable Mpeg-2 under Video Acceleration.
Relevant output from qvdpauinfo:
Audio trouble shooting
Check if you audio device is muted
You can use alsamixer -c0 or alsamixer -c1 to do it manually, or use something like:
If DTS-HD / TrueHD does not work or your kernel complains about broken edid, consider the following:
Download: https://dl.dropboxusercontent.com/u/55728161/marantz.bin and save it to /lib/firmware/edid
You have to create the /lib/firmware/edid directory. Make 100% sure, the file has exact 256 Byte after download, if not redownload it.
afterwards edit /etc/default/grub:
Other EDID workarounds: http://forum.xbmc.org/showthread.php?tid=174854&pid=1685301#pid1685301
Bitstream audio still not working
Some receivers deny Bitstream Audio for everything not 60hz. In that case disable Adjust Refreshrate to match Video and also set the Sync Playback to Display to Audio Clock.
Out of historical reasons, you can join #xbmc-xvba for discussing this howto. The channel name shall make us remember forever, that best hardware is worth nothing, if there are no drivers for it :-)
RE: Radeon OSS with vdpau (howto) - fritsch - 2013-10-03 10:54
2013/10/05: Updated kernel to 3.11.4
2013/10/14: wsnipex has built a fixed mesa version with all relevant patches in a special mesa ppa. Use this one, if you want an always working version. You can still run oibaf, where this version (+ the compile fix) was copied from.
2013/10/19: Changed howto to use 3.12-rc5 it includes the bitstream audio patch and the pll clock change, as well as lipsync preparation. (2.1)
2013/10/19: I picked a patch, which enables Audio by default, when radeon.audio=1 is passed to the command line, details see above thread (2.2)
2013/10/19: Updated to kernel 3.12-rc6 with the usual patches.
2013/10/20: Added the hpet timer to the grub/default config - let's see who investigates a difference ;-)
2013/10/21: Uploaded 3.12-rc6 0.2 kernel. The faulty PLL clock patch on machines > E450 has been reverted.
2013/10/22: Missed some groups in the original howto (dip, dialout) sudo adduser xbmc dip && sudo adduser xbmc dialout && sudo reboot can fix that
2013/10/22: Audio Clock finally working (Kernel 3.12-rc6 0.3) - see above.
2013/10/24: Added some audio trouble shooting (unmute + bitstream audio known workarounds)
2013/10/27: Updated to 3.12-rc6+ which contains a lot of the other patches. Added one clock multiplier patch for Evergreen to use the same values as fglrx.
2013/10/28: Update to 3.12-rc7+ and changed howto to disable Adjust Refresh Rate to match video - it seems 23.976 mode causes drops with passthrough audio.
2013/11/04: Update to 3.12.0 final - all patches can be found on my github (howto branch of linux)
2013/11/05: Howto now uses Ubuntu Saucy 64 bit as installation medium. Thanks for wsnipex for providing updated mesa packages with the advanced deinterlacing packages.
2013/11/05: 24p and 24.0 hz is working fine again, therefore they can be enabled again
2013/11/06: There is now a howto for OpenSuse: http://forum.xbmc.org/showthread.php?tid=174854&pid=1546145#pid1546145 (thx to Tomtomme).
2013/11/08: Thanks to Grigori (zgreg) we als have temporal deinterlacing included. This was fixed for HD7xxx+ in version v8
2013/11/11: If your Saucy installation hangs without keyboard input possible, use this workaround: http://forum.xbmc.org/showthread.php?tid=174854&pid=1547981#pid1547981 (thanks to gWr71Tv)
2013/11/18: Updated 3.12 kernel with dropping a fractional div patch. It did not help us. Now all patches are in 3.13.
2013/11/26: Updated advancedsettings.xml to actually read CPU and GPU temperature, thx to Strangenoises.
2013/11/27: It could very well be, that your specific model needs other advancedsettings, e.g. here: http://pastebin.com/9TbQ0nZb or here: http://forum.xbmc.org/showthread.php?tid=174854&pid=1563088#pid1563088 (thx to Redeemer and menthos)
2013/12/15: Updated the upstart script to honor nice level, so that we really get what we want. upstart does not read the /etc/security/limits.conf things: limit nice 21 21
2013/12/19: Finally Artifacts on Richland are fixed. Nice christmas present from the AMD guys - it does for sure not hurt, to ask them, if there is a amazon wishlist or something. Though they are being paied by AMD, they are investing a whole lot of their free time to help us, are directly available in their irc channel and so on. Was a good year for AMD and their OSS support. Patches can be found in my drm-fixes-3.13 branch on github.com/fritsch
2013/12/30: I changed the upstart script to start /usr/bin/xbmc --standalone directly. Many users were confused and not able to also create a startxbmc.sh in the correct location.
2013/12/30: Updated howto to use 3.13-rc6 kernel from ubuntu mainline - all patches are now upstream.
2014/01/05: Updated howto to use 3.13-rc7. We now also have all the Radeon SI performance patches in mainline.
2014/01/10: Removed all patches as they are all upstream now and included in the mainline builds.
2014/01/12: Updated Kernel to 3.13-rc8
2014/01/20: We are stable now. Kernel was updated to 3.13 final.
2014/01/26: Removed the hpet - did not do anything.
2014/01/30: Updated to kernel 3.13.1
2014/02/07: Updated to kernel 3.13.2
2014/02/14: Updated to kernel 3.13.3
2014/02/22: Updated to kernel 3.13.4
2014/02/24: Updated to kernel 3.13.5 this adds two important fixes for HD 7xxx and Kabini
2014/03/01: Changed the settings descriptions as settings.xml was changed upstream. New Video Settings: Acceleration
2014/04/08: Updated the howto to Ubuntu Trusty 14.04
2014/04/14: Some users noted, that after upgrade from saucy to trusty there was a 100% load on home screen. If that happens to you, please start from a fresh profile by e.g. removing your .xbmc directory.
2014/04/26: Note for upgraders from saucy. Make sure to run: sudo ppa-purge ppa:wsnipex/mesa and ppa-purge ppa:wsnipex/xbmc-fernetmenta-master prior to running sudo do-release-upgrade - If you have missed those steps, you need to readd the saucy line of the mesa ppa, run sudo apt-get update and purge afterwards.
2014/05/03: ckoenig of AMD has found the skip issue which was driving us nuts the last year. It was a kernel fault and will hopefully be fixed in 3.15 kernel - for the time in between, you can use these images:
2014/06/30: deadite66 build 3.15.2 kernels with one offending commit reverted. This commit made the Temporal Deinterlacer drop and skip. I suggest the kernels here:
2014/07/11: Kernel 3.15.5 is released - you can download / install it via the usual location -> http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.15.5-utopic/
RE: Radeon OSS with vdpau (howto) - laric - 2013-10-03 10:59
Finally we can get HD sound in linux...
Installed and working now.
AMD A6-3500 APU with Radeon HD Graphics
VDPAU API version : 1
VDPAU implementation : G3DVL VDPAU Driver Shared Library version 1.0
FATAL: get_bits failed : No backend implementation could be loaded.!!
MPEG DECODING (1920x1080): 75 frames/s
MPEG DECODING (1280x720): 113 frames/s
H264 DECODING (1920x1080): 47 frames/s
H264 DECODING (1280x720): 86 frames/s
VC1 DECODING (1440x1080): 101 frames/s
MPEG4 DECODING (1920x1080): 66 frames/s
MIXER WEAVE (1920x1080): 625 frames/s
MIXER BOB (1920x1080): 1023 fields/s
MIXER TEMPORAL (1920x1080): 1087 fields/s
MIXER TEMPORAL + IVTC (1920x1080): 1087 fields/s
MIXER TEMPORAL + SKIP_CHROMA (1920x1080): 1088 fields/s
MIXER TEMPORAL_SPATIAL (1920x1080): 1087 fields/s
MIXER TEMPORAL_SPATIAL + IVTC (1920x1080): 1087 fields/s
MIXER TEMPORAL_SPATIAL + SKIP_CHROMA (1920x1080): 1088 fields/s
MIXER TEMPORAL_SPATIAL (720x576 video to 1920x1080 display): 1162 fields/s
MULTITHREADED MPEG DECODING (1920x1080): 70 frames/s
MULTITHREADED MIXER TEMPORAL (1920x1080): 1118 fields/s
RE: Radeon OSS with vdpau (howto) - Claudio.Sjo - 2013-10-03 12:59
fritsch, please highlith this thread (and possibly remove the attention from the old one)
RE: Radeon OSS with vdpau (howto) - Orcie - 2013-10-03 15:50
Could you point out what the performance is vs xvba? Is the limitation in fps noticeble? Should people move away from xvba towards a solution with the OSS driver?
RE: Radeon OSS with vdpau (howto) - laric - 2013-10-03 16:33
Performance is fine on my a6-3500 as you see above..
And it supports HD audio so well worth to change into.
RE: Radeon OSS with vdpau (howto) - deadite66 - 2013-10-03 18:01
does this mean oibaf has glinterop in mesa again?
RE: Radeon OSS with vdpau (howto) - locomot1f - 2013-10-03 18:51
i just get a whole lot of tearing...
here's my debug log -- http://pastebin.com/EBqDiDZ5
i tried the generic Mesa drivers. better.. no tearing, but not a very image.
am I missing something? or is my Radeon GPU not supported yet? HD 6000 series
since i don't have any other X sessions, i can't run the other commands to get the info. is there another way through ssh terminal to get what you need?
FYI: videos play fine.. great quality. just the XBMC interface... just lots of tearing.
RE: Radeon OSS with vdpau (howto) - BenvanDamme - 2013-10-03 19:36
Do you have any knowledge on how to use this on arch linux ?
RE: Radeon OSS with vdpau (howto) - fritsch - 2013-10-03 20:22
@locomot1f: Please provide all the logfiles that are mentioned above. Turn on debug logging before
@BenvanDamme: It is not difficult. Use your standard arch way of installing packages and just add the relevant patches to your aur build source.
RE: Radeon OSS with vdpau (howto) - locomot1f - 2013-10-03 20:31
@BenvanDamme -- http://forum.xbmc.org/showthread.php?tid=116996&pid=1518647#pid1518647
RE: Radeon OSS with vdpau (howto) - goldbär - 2013-10-03 20:38
I get some errors after the dist-upgrade
That's what I did:
Then I got these unresolved dependencies
Then I tried with
What can I do to solve the problem?
RE: Radeon OSS with vdpau (howto) - fritsch - 2013-10-03 20:39
Following command is a one liner:
PS: That error was expected.
RE: Radeon OSS with vdpau (howto) - BenvanDamme - 2013-10-03 20:44
Thank you for your help
RE: Radeon OSS with vdpau (howto) - goldbär - 2013-10-03 20:49
Thank you very much for your fast reply.
That fixed it.