You are not logged in.

#1 2013-10-02 08:27:08

ddeeds
Member
Registered: 2013-10-02
Posts: 8

Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Radeon, XBMC, VDPAU, HD Audio plus a 50% decrease in CPU usage over AMD Catalyst Drivers

Big Thanks goes out to Fritsch! I could not have put this all together without him doing all the upfront grunt work.

For Fritch's thread and install guide for Ubuntu:

Linux Radeon OSS with vdpau (Ubuntu How To).

Since you are using Arch Linux (which requires Linux experience) I take that into account with my instructions. Consider this an OVERVIEW with the various packages, patches, etc. that you will need to do it yourself.

(If you have installed Arch, XBMC, etc. this should be a breeze. Otherwise, if you need additional help... post and I or someone else will reply.)

What you get:

- Bitstream Audio (including DTS-HD, TrueHD, LPCM 7.1)
- max resolution: 2048 x 1152
- mpeg2, mpeg4, h264, vc1 accleration
- Bob deinterlacing via vdpau
- 24 fps Video Playback (AMD and Intel Haswell CPUs)
- XBMC runs with 50% less CPU usage over AMD Catalyst Drivers

Hardware tested on:

CPU - AMD 8350
Video Cards Tested - AMD 5770 and AMD HD6450

Instructions:

1. Install of Arch (Running Linux Kernel 3.12.1)

2. Install the mesa10-git
(mesa-git,mesa--libgl-git,ati-dri-git)

3. Install linux-firmware, xorg-server, xf86-video-ati, xorg-xinit, etc. using Pacman (Arch Package Manager).

Below is a link to my xorg.conf:

Note: I am running Xen, unRAID, XBMC and several other VMs. XBMC is my desktop so I disabled composite. If you are running a desktop, enable it.

Radeon xorg.conf

Be sure to check out the Radeon Wiki on how to set up your xorg.conf correctly and other settings like Dynamic power management.

4. Add radeon.dpm=1 radeon.audio=1 clocksource=hpet hpet=enable to GRUB_CMDLINE_LINUX in /etc/default/grub.

5. Update grub.

grub-mkconfig -o /boot/grub/grub.cfg

6. Add export LIBVA_DRIVER_NAME=vdpau and export VDPAU_DRIVER=r600 to /etc/bash.bashrc and to /var/lib/xbmc/.bashrc.

7. Unmute any of the S/PDIFs that might be muted.

alsamixer

8. Store alsamixer settings.

alsactl store

9. May be required - Edit /usr/share/alsa/alsa.conf and set the correct card and device id.

For my System:

defaults.pcm.card 0
defaults.pcm.device 3

10. Install xbmc-xvba (FernetMenta).

11. Enable XBMC to autostart:

systemctl enable xbmc.service

To start xbmc:

systemctl start xbmc.service

12. Add / Create advancedsettings.xml (location: /var/lib/xbmc/.xbmc/userdata) and add the following:

<advancedsettings>
   <loglevel hide="false">0</loglevel>
  <gui>    
    <algorithmdirtyregions>3</algorithmdirtyregions>
    <nofliptimeout>0</nofliptimeout>
  </gui>    
<video>
  <latency>
    <delay>0</delay>
    <refresh>
      <min>23</min>
      <max>24</max>
      <delay>175</delay> <!-- set to zero or adjust if audio seems out of sync with 24p movies -->
     </refresh>
  </latency>
</video>
</advancedsettings>

13. Restart XBMC for the above settings to be used:

systemctl restart xbmc.service

XBMC Settings:

Settings->System->Video Output:
Vertical Sync: Always Enabled

Settings->Video->Playback:
VDPAU: On
Prefer VDPAU Mixer: ON
VAAPI: Off
XVBA: Off
Adjust Refreshrate to match video: Off <--- If this is not set to off DTS-HD and TrueHD will not work.
Sync Playback to Display: Off <--- When turned on audio sync issues are possible.

Settings->System->Audio Output
Audio Output: HDMI
Speaker Configuration: 7.1 (5.1 if that is how many speakers you have)
Boost Volume Level on Downmix: On
Output To All Speakers: Off
Dolby Digital (AC-3): On
DTS: On
AAC: On (Not every Receiver can decode AAC. If not, set it to off)
Multichannel LPCM: On
TrueHD:On
DTS-HD:On
Audio Output Device: HD-Audio Generic
Passthrough Output Device: HD-Audio Generic

Last edited by ddeeds (2013-11-29 05:19:44)

Offline

#2 2013-10-19 11:22:06

elangelo
Member
Registered: 2013-10-15
Posts: 3

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

what hardware are you using for this?

What version of XBMC (AUR? ) YOu wouldn't happen to have some a PKGBUILD file for those patches?

Offline

#3 2013-10-20 06:23:33

ddeeds
Member
Registered: 2013-10-02
Posts: 8

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

I was chasing an XBMC Library issue for an hour and after pulling my hair out... I found out that sqlite 3.8.1 breaks it.

There are two different methods to fix the problem:

HOW-TO:Share libraries using MySQL

Or...

1. Install downgrade from AUR.

2. Stop XBMC

systemctl stop xbmc.service

3. Enter the following command:

downgrade sqlite

4. Select sqlite-3.8.0.2-1-x86_64.pkg.tar.xz

5. Restart XBMC

systemctl start xbmc.service

Offline

#4 2013-10-20 06:46:08

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,552
Website

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Moving to Community Contributions...


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#5 2013-10-20 07:06:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,427

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Offline

#6 2013-10-20 08:58:29

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

I've applied all the kernel patches and compiled it, but I still get no more than 2 channels in LPCM.
Does this also require the mesa patches?

(I wanted to test with only the kernel, so that if anything went wrong, I would have less potential breakers...)

oh and I tried watching videos and it was lagging like hell....
I'll have to recompile with one patch at a time and see which one made it that bad...

I looked and compiled a patch at a time and... somehow I don't have that issue anymore... strange.
Still no more than 2 channels LPCM though.

Last edited by gee (2013-10-20 22:45:11)

Offline

#7 2013-10-21 00:31:01

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Also which patch do you apply to Mesa?
You only linked Koenig's log.
I would be fine with creating pkgbuild with the patches, but I do not know which one to use.

Thanks

Offline

#8 2013-10-21 21:12:35

niekez
Member
Registered: 2011-11-03
Posts: 14

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Compiling the patched kernel right now...

Will these patches be merged into the packages eventually or do we keep having to "hack" together a working system? Thanks for the guide anyhow...

Offline

#9 2013-10-22 04:57:18

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

The mesa patches should end up on the next Mesa versions minus the vdpau part.
Last time I checked, this was not finalized so who knows...

Same for the alsa patch for multichannel lpcm, that one should come in 3.13 kernel I believe, the other kernel patches in .12 or .13 I think.

Offline

#10 2013-10-22 07:48:09

niekez
Member
Registered: 2011-11-03
Posts: 14

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

I came across this package in the AUR:

mesa-full-amd-vdpau

Maybe it's usefull?

Offline

#11 2013-10-25 02:27:14

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

The patches you want are not yet in mesa Master so not really.
You still need to patch mesa Master with Koenig's patches.

Offline

#12 2013-10-26 02:42:54

ddeeds
Member
Registered: 2013-10-02
Posts: 8

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Updated the links with the latest patches needed for Linux Kernel 3.12-rc6 or use the custom Linux Kernel package.

Last edited by ddeeds (2013-10-26 02:48:55)

Offline

#13 2013-10-27 10:40:52

niekez
Member
Registered: 2011-11-03
Posts: 14

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

gee wrote:

The patches you want are not yet in mesa Master so not really.
You still need to patch mesa Master with Koenig's patches.

The package has König's glinterop and interop patches, that's why I mentioned it.


ddeeds wrote:

Updated the links with the latest patches needed for Linux Kernel 3.12-rc6 or use the custom Linux Kernel package.

Thanks! What are the advantages over rc5?

Offline

#14 2013-10-29 03:04:32

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Ooops smile

It is now merged upstream so simple mesa-git should do it.

Offline

#15 2013-10-29 22:33:11

ddeeds
Member
Registered: 2013-10-02
Posts: 8

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

niekez wrote:

Thanks! What are the advantages over rc5?

Patches, Fixes, Updates and we they have incorporated 4 of the previous patches that were need. Now we are down to 2.

Offline

#16 2013-10-29 22:43:40

ddeeds
Member
Registered: 2013-10-02
Posts: 8

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

gee wrote:

Ooops smile

It is now merged upstream so simple mesa-git should do it.

Thanks for the update. I updated my post with Linux Kernel 3.12rc7 and to use mesa-git from AUR.

IMPORTANT NOTE:

1. Update your Kernel boot options to what I have above.

2. Change your XBMC settings to what I have above.

Otherwise, you will get no sound when playing TrueHD or DTS-HD movies / blurays.

Last edited by ddeeds (2013-10-29 22:45:17)

Offline

#17 2013-11-02 10:33:09

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

I think you should use that patch as well:
http://mailman.alsa-project.org/piperma … 67847.html

Offline

#18 2013-11-02 15:06:37

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

Just tried the new patches and still:

Channels count (5) not available for playbacks: Invalid argument

hmm

Offline

#19 2013-11-13 07:00:46

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

and now the kernel stuff should be merged in -rc1 smile

Offline

#20 2013-11-15 16:13:50

niekez
Member
Registered: 2011-11-03
Posts: 14

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

So we can upgrade to linux-3.12-1 from the repositories?

Offline

#21 2013-11-15 19:12:39

rubenvb
Member
Registered: 2011-01-14
Posts: 83

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

I can confirm that with the settings above (well, actually, just the ones mentioned here), everything ... just works!

I'm happy. Very happy. AMD Open Source Drivers FTW! Now get to work on that 3D and OpenCL stuff tongue

Offline

#22 2013-11-25 05:25:11

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

niekez wrote:

So we can upgrade to linux-3.12-1 from the repositories?

No, it's in 3.13 not 3.12.

I just installed 3.13-rc1 but speaker test still fails to give me sound on more than 2 channels...
It doesn't crash on -c6 anymore though, but no sound..
Am I missing something?
HD4670 here.

Thanks!

Offline

#23 2013-11-28 07:31:00

gee
Member
Registered: 2006-11-29
Posts: 242

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

but it worked on a 7870.. strange...

Offline

#24 2013-12-05 12:13:28

niekez
Member
Registered: 2011-11-03
Posts: 14

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

gee wrote:
niekez wrote:

So we can upgrade to linux-3.12-1 from the repositories?

No, it's in 3.13 not 3.12.

I just installed 3.13-rc1 but speaker test still fails to give me sound on more than 2 channels...
It doesn't crash on -c6 anymore though, but no sound..
Am I missing something?
HD4670 here.

Thanks!

It says 3.12 in the op.

Maybe a typo? Because with the 3.12 kernel I get massive framedrops and stuttering audio.

Else, would this package be the right one to install? linux-mainline

Offline

#25 2013-12-05 16:45:51

necbot
Member
Registered: 2013-12-05
Posts: 59

Re: Radeon, XBMC, HD Audio plus a 50% decrease in CPU usage over Catalyst

I followed these instrucitons and the worked perfectly on my HTPC build (running the AMD APU A4-4000 on a Gigabyte GA-F2A88XN-WIFI).  I have a quick question though.  When I want to shutdown or reboot I hit the power button on the lower left of the XBMC main window.  Usually a dialog menu pops up giving me the option to Suspend, Shut-Down, Reboot... etc. etc.  The menu in the xbmc-xvba build only shows "Exit".  How do I enable these other options?  I'd like to at least be able to shutdown or reboot from within XBMC.

EDIT:
Nevermind, I solved it..

I found this thread

It says that running XBMC as a service will not register my session and polkit will not work.  I have to autologin as the user xbmc and startx automatically.

I followed the instructions here and here.  Then I added "exec xbmc --standalone" to the end of my /var/lib/xbmc/.xinitrc file.

Everything works fine now.

Last edited by necbot (2013-12-05 17:30:18)

Offline

Board footer

Powered by FluxBB