XBMC Community Forum
[LINUX] HOW-TO use VAAPI HW Acceleration on AMD Zacate (Fusion) platform - 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] HOW-TO use VAAPI HW Acceleration on AMD Zacate (Fusion) platform (/showthread.php?tid=99154)



- SDM2011 - 2011-06-19 16:32

Quote:No audio. Xbmc says cannot access to audio card, check settings. I searching for the command to choose audio adapter from cl. Anyone remembers?

I just installed pulseaudio and set it to output to all devices simultaneously (include "module-combine" in the pulse config, add yourself to the pulse groups). Works great for me. The only thing that doesn't work is that xbmc itself doesn't output to this sound sink, it just uses the analog output, regardless of the audio settings. There's a manual setting I have to tweak somewhere, I just haven't gotten around to it.

Quote:How do you configure system for the XBMC shutdown options to work properly? I mean, when I select shutdown or reboot, I get command prompt login or sometimes just black screen with cursor blinking.

I just partially solved this issue myself:

  1. Follow the wiki guide: http://wiki.xbmc.org/index.php?title=Ubuntu_Suspend_/_Wake
  2. Change the command you use to launch xbmc, to launch via ck-launch-session:
    Code:
    ck-launch-session xbmc --standalone

This allows shutdown for me, though not suspend or hibernate. If anyone can shed light on the latter two, that would be much appreciated.


- craigdabbs - 2011-06-19 17:32

thanks dafrog,

i had spent hours and hours of reinstalling ubuntu trying to get vaapi working. Seems it was all to do with the missing variables.
Also thanks to wytraven, very nice guide Smile.

I now have it running 1080p perfect with surround sound through a receiver and xbmc starting up automatically.
I have only just started using linux so its been a bit of a learning curve.

I stayed with the default kernel and unpatched ati driver, seems to work fine btw.

Thanks for this thread and everyones input without it i would of been stuffed.

dont forget for menu sounds create ~/.asoundrc file with
Code:
pcm.!default {
   type plug
   slave {
       pcm "hw:0,3"
       rate 48000
   }
}
find your device with aplay -l

Craig

MP3 playback needed a extra library installed
apt-get install libmad0


- htpcero - 2011-06-19 19:02

Rapoza Wrote:Good morning boys.
Setting the driver variables fixed the crash problem. So I included them in the envorinment file:


I also managed to mount the network shared drive. That wasn't trivial as they are both samba and cifs involved and some bug there.

I got rid of the Tearing adjusting the options related to vsync in xbmc. Adjust screen freq to video=on and Vsync always on.

Now playing with 15%/10% cpu load.

But I still have two issues:
No audio. Xbmc says cannot access to audio card, check settings. I searching for the command to choose audio adapter from cl. Anyone remembers?

Other thing is I'm surprised that xbmc doesn't load automatically at start after "xinit xbmc-standalone" as my other installations. WytRaven, is something due to any command in your instructions.
And I have some underscan... or over. Don't know. The fact is that I always have the black frame around. Perhaps "aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0" wasn't needed for my screen? If so, How this can be disabled?

Tomorow will post some captures and the contents of xorg.conf

Regards
Sergio.


This fixed the VAAPI crash in my htpc too!! I am running Natty/AMD64, on AMD Fusion (ASUS E35MI-1 Deluxe), XBMC-PVR from Lars' PPA; and for the first time I have VAAPI working (zero drops when playing MPEG4/H264 content, 14% CPU; before, I had hundreds and hundreds of frame drops and 95% CPU)

In my case, the third line (DISPLAY) above was not needed.

The below may help you or give you pointers with regards to the issues you see.

The only outstanding issue I currently have is on the LIRC side of things: Suspend works fine, and resume works as well however after resume, my mce-remote dies (the IR receiver's LED stays on continously after the box wakes up); the system log shows a kernel exception related to lirc. There is a bug opened on launchpad.



Audio (I use SPDIF)
Code:
Enable SPDIF output

run “alsamixer”

In alsamixer unmute the spdif devices. Then we store this setting.

alsamixer
sudo alsactl store

Then in XBMC, select:

        Audio Output = Optical/Coax
        Dolby Digital Capable Receiver = ON
        DTS Capable Receiver = ON
        Audio Output Device = HDA ATI SB iec958 (ALSA)
        Passthrough Output Device = HDA ATI SB iec958 (ALSA)


Passthrough confirmed to work OK (Dolby & DTS) on this setup with my receiver


Automatically execute XBMC on boot (and automatically relaunch it if it crashes, using Ubuntu's upstart):

Code:
Autostart XBMC on boot (properly - using upstart)

The following  will create a “/usr/bin/runXBMC” script, and a new upstart job (/etc/init/xbmc.conf)

sudo wget http://paste.kde.org/7158/raw/ -O /etc/init/xbmc.conf
sudo ln -s /lib/init/upstart-job /etc/init.d/xbmc
sudo wget http://paste.kde.org/7022/raw/ -O /usr/bin/runXBMC
sudo chmod a+x /usr/bin/runXBMC

in /usr/bin/runXBMC, change the path to reflect the location of the executable in your system:

    /usr/lib/xbmc/xbmc.bin  --standalone


To avoid grub from overiding the “kernel selection timeout counter” after a hard reboot or crash (otherwise, a keyboard would be needed to select the kernel to boot after a hard reboot)

       # the following will have grub to always auto-select the default kernel after the timeout period elapses

        sudo grub-editenv /boot/grub/grubenv set recordfail=0


Underscan issue:

To fix the underscan issue, I added the following to my xbmc launch script:

Code:
aticonfig --set-dispattrib=dfp1,positionX:0
aticonfig --set-dispattrib=dfp1,positionY:0
aticonfig --set-dispattrib=dfp1,sizeX:1920
aticonfig --set-dispattrib=dfp1,sizeX:1920

The "dfp1" string (works like a screen name) may differ in your system; see the following links for reference:

Code:
http://ubuntuforums.org/showthread.php?t=1409508
http://forum.xbmc.org/showthread.php?p=782438



- craigdabbs - 2011-06-19 20:07

@ rapoza

selecting the right audio device in xbmc is a bit hit and miss, you can add it manually using the custom option

In terminal do aplay -l

find the soundcard you want to use, look for card: X device: X
then just add hw:0,3 to the custom field in xbmc on both. replace 0,3 with your card,device.

Also make sure you have added the user running xbmc to the audio and video group
sudo adduser "user" audio


- jbo87 - 2011-06-19 22:00

So wakeup from STR works for you under linux? I guess ur not using the AsRock E350M1 then...


- htpcero - 2011-06-19 22:38

jbo87 Wrote:So wakeup from STR works for you under linux? I guess ur not using the AsRock E350M1 then...

as posted above, using ASUS E35M1-I Deluxe -yes- suspend & resume work just fine - other than the issue with the mce-remote dying after the wakeup, but I have hope that this will be sorted out as well. The lirc guy asked for logs & stuff and seems to be really pro-active. Will see.


- WytRaven - 2011-06-19 23:29

Thanks Rapoza for the environment stuff. I have updated the installation.txt to include the following after fglrx installation

Code:
### Add some fglrx related variables to environment
echo "" >> /etc/environment
echo "LIBVA_DRIVERS_PATH=/usr/lib/dri" >> /etc/environment
echo "LIBVA_DRIVER_NAME=fglrx" >> /etc/environment

htpcero is right, you shouldn't need the DISPLAY variable there. That was only there to let one user know about the display that had been started by the xserver under another user. Once up and running under the user that started x it shouldn't be required.

It's great to hear so many people are getting going now. I must admit though I am a little surprised at this:
gaspo100 Wrote:To get rid of tearing in Settings>System>Video Output I set 'Vertical blank sync' to 'Always On'. I didn't have to change any other settings. My audio device is set to 'hdmi (ALSA)' for playback and passthrough.

All is working fine, bluray rips play with 10-15% cpu.
The only thing I have noticed is that when trying to play mkv HD TV shows (SG Universe, Bing Bang Theory, etc.) it takes about 5-10 seconds before audio starts playing and syncs with video.

I have tried every combination of every setting I can think of to get 24p blu-ray playback without tearing or extreme judder to no avail. Any chance you could screen shot your video/playback and system/video settings tabs for reference please?


- SDM2011 - 2011-06-19 23:41

Quote:as posted above, using ASUS E35M1-I Deluxe -yes- suspend & resume work just fine

I wonder why it works in your configuration, but not mine. Perhaps because you launch xbmc from upstart, likely with root permissions which supercedes the PolicyKit restrictions. I just wonder what I need to tweak to get suspend/hibernate working with PolicyKit.

Quote:I have tried every combination of every setting I can think of to get 24p blu-ray playback without tearing or extreme judder to no avail.

Probably covered already, but did you set the tearing setting in the AMD control panel?

Edit: I believe the suspend issues are because the script process launching xbmc.bin disappears after xbmc starts, so it loses the policy kit session. I altered my .xinitrc to simply be:
Code:
exec ck-launch-session xbmc-standalone
This is a standard script in the xbmc package that launches pulseaudio and xbmc.bin, and seems to stick around, thus keeping ck-launch-session active. I've been able to suspend a few times, but it doesn't work every time. I can't seem to find anywhere that failures are logged, so this is a little difficult to diagnose.


- Rapoza - 2011-06-20 10:53

craigdabbs Wrote:find the soundcard you want to use, look for card: X device: X
then just add hw:0,3 to the custom field in xbmc on both. replace 0,3 with your card,device.

That fixed the problem of no audio in xbmc. Although the ~/.asoundrc file does not fix the silent menus.

I've installed pulseaudio and also isn't fixed. I think I've done something wrong with it. I'm having hard time deciphering english when things become so tech. Nod
Is pulse (with all its dependencies) needed for the interface have sounds of anything? As putting manually the sound device in xbmc fixed the playing sound I think i want to get rid of it.

@htpzero: That directions supposed to make xbmc autostart as is? without including xbmcrun in any init script? does not work for me. Confused
The underscan lines (curiously after the underscan command i have overscan) where they have to be placed? bottom of xbmcrun?

Edit: You have the two lower lines identical. Wouldn't one of those be:
Code:
aticonfig --set-dispattrib=dfp1,sizeY:1080

Merit on the env thing goes to dafrog, who pointed it.


- Rapoza - 2011-06-20 10:57

jbo87 Wrote:So wakeup from STR works for you under linux? I guess ur not using the AsRock E350M1 then...

I wrote anywhere back 'E350m1' being my mobo. Sorry, I'm so tired, many sleepless nights. Mines ASUS E35M1-i deluxe