[LINUX] HOW-TO use VAAPI HW Acceleration on AMD Zacate (Fusion) platform

  Thread Rating:
  • 14 Votes - 4.71 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
WytRaven Offline
Junior Member
Posts: 41
Joined: Jun 2011
Reputation: 0
Post: #121
Hey Robotica I see you updated the first post catalyst install section using the modified instructions I provided. That's great and all except my instructions are for 2.6.39 kernel and I thought your instructions were based on the standard 2.6.38 kernel. That might confuse people as I have no idea if that patch will break the driver if installed on 2.6.38...(you could test I suppose).
find quote
Robotica Offline
Posting Freak
Posts: 974
Joined: Aug 2010
Reputation: 3
Post: #122
True, but I also update OP with instructions to upgrade to newer kernel...

Also check this out, maybe it is usefull: http://phoronix.com/forums/showthread.ph...riverName()
(This post was last modified: 2011-06-16 17:13 by Robotica.)
find quote
Rapoza Offline
Junior Member
Posts: 36
Joined: Jun 2011
Reputation: 0
Post: #123
Robotica Wrote:Maybe it is easier to build from GIT instead of using 10. 1 since the patch is included.

The fact is perhaps that I don't understand well the instructions on the guide. You mean that here you offered two options? I thought the patch was something that wasn't included on CODE

@WytRaven: Yes I'm also using that kernel.
But I'm really lost on code order execution. I'll post my execution and perhaps we can make some "compositing". I'm more biased to include all orders in the guide, becouse then there's finally the possibility of making a script.

My notes, feel free to blame Wink
Code:
##DO A CLEAN INSTALLATION FROM A MINIMAL UBUNTU 11.04
##USED CLI METHOD
##LEAVES ME ON A BLACK SCREEN, I CONTINUE FROM CTRL-ALT-F1
####################################################
sudo apt-get update
sudo apt-get install -y ssh python-software-properties
sudo reboot

##ACCESSED FROM WINDOWS WITH PUTTY (OR LINUX WITH ssh -l xbmc my.IP.address)

sudo apt-get install -y udisks usbmount ntfs-3g upower acpi-support xorg alsa-utils mesa-utils
sudo usermod --group adm,sudo,cdrom,floppy,audio,video,plugdev,fuse xbmc #,netdev,powerdev,polkituser
#THIS LAST PERHAPS IS NOT REQUIRED. XBMC DOES IT.


####################################################
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo nano /etc/apt/sources.list
##ENSURE LINES FROM UNIVERSE, MULTIVERSE AND RESTRICTED ARE UNCOMMENTED. ALSO PARTNERS

sudo apt-get update && sudo apt-get dist-upgrade

##VAAPIVAAPIVAAPIVAAPIVAAPIVAAPI##########################
## RECOMMENDED OPTION:

cd ~/; mkdir vaapi; cd vaapi/
wget http://www.splitted-desktop.com/~gbeauchesne/libva/pkgs/amd64/libva1_0.32.0-1+sds2_amd64.deb
wget http://www.splitted-desktop.com/~gbeauchesne/libva/pkgs/amd64/libva-dev_0.32.0-1+sds2_amd64.deb

sudo apt-get install -y libkms1 libdrm-dev pkg-config
sudo dpkg -i libva1_0.32.0-1+sds2_amd64.deb libva-dev_0.32.0-1+sds2_amd64.deb

wget http://www.splitted-desktop.com/~gbeauchesne/xvba-video/xvba-video_0.8.0-1_amd64.deb
sudo dpkg -i xvba-video_0.8.0-1_amd64.deb

## SUPPOSED CORRECTION TO DRI AND VERSIONS PROBLEMS. DOES NOT WORK INCOMPATIBLE.
#sudo apt-add-repository ppa:rexbron/bugfixes
#sudo apt-get update && sudo apt-get dist-upgrade
#cd ~/vaapi
#wget https://launchpad.net/~rexbron/+archive/bugfixes/+files/xvba-va-driver_0.7.8-0ubuntu1_amd64.deb
#sudo dpkg -i xvba-va-driver_0.7.8-0ubuntu1_amd64.deb

## SUPPOSED CORRECTION TO ACCELERATION. DOES NOT WORK INCOMPATIBLE.
## http://ubuntuforums.org/showthread.php?t=1677477&page=2
## http://forum.xbmc.org/printthread.php?t=81286&pp=40&page=5
#sudo apt-add-repository ppa:dtl131/catalysthacks
#sudo apt-get update && sudo apt-get dist-upgrade


## UBUNTU OPTION ------------------------------------------------------
#sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
#sudo apt-get install -y libva1 libva-dev libva-glx1 libva-tpi1 libva-x11-1 vainfo

##THAT INSTALLS:
##libva1 (1.0.8-3) UPD
##libva-x11-1 (1.0.8-3) NEW
##libva-tpi1 (1.0.8-3) NEW
##libva-glx1 (1.0.8-3) NEW
##libva-dev (1.0.8-3) UPD
##-----------------------------------------------------------------------

vainfo
##RESULT: vainfo: Error, can't open display: ''

##DRIVERDRIVERDRIVERDRIVERDRIVERDRIVERDRIVER#################
## PRIVATIVE OPTION
sudo apt-get install -y build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4 wget execstack libelfg0 dh-modaliases
sudo apt-get install -y ia32-libs

cd ~/; mkdir catalyst11.6; cd catalyst11.6/
wget http://www2.ati.com/drivers/linux/ati-driver-installer-11-6-x86.x86_64.run
chmod +x ati-driver-installer-11-6-x86.x86_64.run

sudo sh ./ati-driver-installer-11-6-x86.x86_64.run --buildpkg Ubuntu/natty
sudo dpkg -i fglrx*.deb

sudo aticonfig --initial -f ##--adapter=all##
sudo reboot

##ERROR VIDEO.SO ON VAINFO--------------------------------------------
sudo nano /etc/X11/xorg.conf
## ADD TO [MODULE]:
## Load "dri"
## Change DPMS to false (energy saving)

fglrxinfo
##RESULT: Error: unable to open display (null)
fgl_glxgears
##RESULT: Error: couldn't open display (null)


## OPEN SOURCE OPTION-------------------------------------------------
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update && sudo apt-get install fglrx

sudo aticonfig --initial -f
sudo reboot

glxinfo
glxgears
##-----------------------------------------------------------------------

## IF REQUIRED-----------------------------------------------------------
??sudo aticonfig --set-pcs-str="DDX,EnableRandR12,FALSE" ##DUAL MONITORS
??sudo aticonfig --input=/etc/X11/xorg.conf --tls=1 ##FORCE CHANGES
sudo reboot

##ERRORS FIX===============================================
## UNSUPPORTED HARDWARE WATERMARK
cd ~/catalyst11.5/
#IF NOT PRESENT
sh ati-driver-installer-11-5-x86.x86_64.run --extract driver

sudo mv /etc/ati/control ~/control.bak
sudo cp driver/common/etc/ati/control /etc/ati

## OR
nano fixwatermark.sh

#!/bin/sh
DRIVER=/usr/lib/fglrx/xorg/modules/drivers/fglrx_drv.so
for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER
done

chmod +x fixwatermark.sh
sudo sh fixwatermark.sh

## IF HANGING
sudo aticonfig --tls=0

##XBMCXBMCXBMCXBMCXBMCXBMCXBMC----------------------------------
sudo apt-add-repository ppa:lars-opdenkamp/xbmc-pvr
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install -y xbmc

## AUTORUN
sudo apt-get install xbmc-live
## TEST
xinit xbmc-standalone

##ERRORS LOGGED:
grep EE /var/log/Xorg.0.log
##If you want to boot to a console for repair without starting XBMC,
##hold down the shift key when booting and "grub" will give you a choice of "(recovery mode)".


## SUPPORT NTFS--------------------------------------------------------
sudo nano /etc/usbmount/usbmount.conf
##FILESYSTEMS="ntfs vfat ext2 ext3 ext4 hfsplus"

## PERMIT XBMC POWERDOWN RESTART + AUTOMOUNT + NTFS-------------
sudo nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
##[Actions for xbmc user]
##Identity=unix-user:xbmc
##Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freede​sktop.udisks.*
##ResultActive=yes
find quote
Rapoza Offline
Junior Member
Posts: 36
Joined: Jun 2011
Reputation: 0
Post: #124
Robotica Wrote:True, but I also update OP with instructions to upgrade to newer kernel...

Also check this out, maybe it is usefull: http://phoronix.com/forums/showthread.ph...riverName()

But by now 2.6.39 its the default kernel on natty minimal installations.
Thats my objective. Make a minimal running machine with the newer possible os and drivers.

Seems that the code post by WytRaven will make my installation finally work. That could be the issue. Now I must see where it goes.
I understand that it replaces the entire driver installation section?

Tomorrow I'll take the htpc to my desktop and clean-start from what we concret today.
If you want me to post the installed kernel, xorg, alsa, mesa, etc versions at some moment, please tell me how to obtain. (Don't make me look at some dist-upgrade text, please)
(This post was last modified: 2011-06-16 17:27 by Rapoza.)
find quote
Robotica Offline
Posting Freak
Posts: 974
Joined: Aug 2010
Reputation: 3
Post: #125
Rapoza Wrote:The fact is perhaps that I don't understand well the instructions on the guide. You mean that here you offered two options? I thought the patch was something that wasn't included on CODE

Depends on your source:
Not included: 10.0, 10.1
Included: Git

Rapoza Wrote:But by now 2.6.39 its the default kernel on natty minimal installations.
The source I refer to is based on 2.6.38. Where is your source?
(This post was last modified: 2011-06-16 17:37 by Robotica.)
find quote
Rapoza Offline
Junior Member
Posts: 36
Joined: Jun 2011
Reputation: 0
Post: #126
WytRaven Wrote:If you are like me and using the 2.6.39 kernel then the standard method of installation wont work. Here's a revised version based on Robotica's original format which works for us:

Quote:Only if you don't have an /etc/X11/xorg.conf already. Well let's just say that I didn't do an aticonfig and already had an /etc/X11/xorg.conf in place and it worked for me.

Its needed when you do minimal install. That was the reason of my first insanity, until I realized that doing a complete ubuntu install creates some configuration files that I was missing (prior of installation of xbmc AND live script)
I made a maverick complete and all was nice and clean. So I'm now trying the minimal.

@Robotica

Errr... The minimal downloads all the packages at the moment. I'm getting that kernel from start. I got it before doing any dist-upgrade. In fact, on all of them it said 0 upgrades.

YEES! Its GIT! I tought you recommended.

Note that ##--adapter=all## is commented. Only required if you have two gfx adapters. I tried becouse I was getting strange resolution issues without using DVI+HDMI.

Also look that I took the maximum possible code from before you can do ssh connection, so people can cutri-paste from putty.
Also Python could be later.
(This post was last modified: 2011-06-16 17:59 by Rapoza.)
find quote
Rapoza Offline
Junior Member
Posts: 36
Joined: Jun 2011
Reputation: 0
Post: #127
WytRaven Wrote:But I have not compiled xbmc yet. I'm still playing with mplayer and have no sound and -vo vaapi crashes it every time. I may just go straight for the xbmc build and then start figuring out the issues as I have no idea if the mplayer crash is it's fault or the vaapi libs at this point and I have no intention of using mplayer on this machine beyond this testing I'm doing.

Try with XBMC it installs plenty of audio dependencies. I think your scenario would change too much to stay on mplayer first.

HAve you already tested disabling composite and unity for the crashes. I saw anything around.
find quote
Robotica Offline
Posting Freak
Posts: 974
Joined: Aug 2010
Reputation: 3
Post: #128
WytRaven Wrote:But I have not compiled xbmc yet. I'm still playing with mplayer and have no sound and -vo vaapi crashes it every time. I may just go straight for the xbmc build and then start figuring out the issues as I have no idea if the mplayer crash is it's fault or the vaapi libs at this point and I have no intention of using mplayer on this machine beyond this testing I'm doing.

Sound problem in linux: http://forum.xbmc.org/showthread.php?tid=103563
find quote
SDM2011 Offline
Junior Member
Posts: 28
Joined: Mar 2011
Reputation: 0
Post: #129
I have an Ubuntu minimal install, I have full video acceleration, and I didn't compile a single package. I really don't think it's necessary in fact. I installed two relevant ppas: lars-opdenkamp/xbmc-pvr, and ubuntu-x-swat/x-updates.

I have these packages installed:
  1. xbmc 11.0-pvr+odk40-eden~git20110530.615e173-0ubuntu1~ppa+odk40~natty
  2. xbmc-bin 11.0-pvr+odk40-eden~git20110530.615e173-0ubuntu1~ppa+odk40~natty
  3. libva-glx1 0.12-1~xup
  4. libva-x11-1 0.12-1~xup
  5. libva1 0.12-1~xup
  6. xvba-va-driver 7.8-0ubuntu1
  7. xserver-xorg 7.6+4ubuntu3
  8. xserver-xorg-core 1.10.1-1ubuntu1.1
  9. fglrx 8.850-0ubuntu1~xup2~natty
  10. fglrx-amdcccle 2:8.850-0ubuntu1~xup2~natty
  11. fglrx-dev 8.850-0ubuntu1~xup2~natty
  12. linux-image-2.6.39-3-generic 6.39-3.9

All the packages should be available from the above ppas and/or the main repos. Note that I did *not* use splitted-desktop's debs, because of a recent conflict with fglrx (IIRC). I did not run aticonfig to generate an xorg, I just let the driver auto-detect the screen's resolution during startup [1].

Be sure to run this command and pick fglrx:
Code:
sudo update-alternatives --config gl_conf

Be sure that your user is added to audio, video groups. There may be more groups required depending on your install, ie. whether you use pulseaudio like I do, etc. My vainfo:
Code:
libva: libva version 0.32.0
Xlib:  extension "XFree86-DRI" missing on display ":0.0".
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/fglrx_drv_video.so
libva: va_openDriver() returns 0
vainfo: VA API version: 0.32
vainfo: Driver version: Splitted-Desktop Systems XvBA backend for VA-API - 0.7.8
vainfo: Supported profile and entrypoints
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD

Others seemed worried that va_openDriver() returning 0 indicated a problem, but that does not seem to be the case for me. I have fully accelerated decoding for 1080p H.264 and VC-1.

My installation isn't perfect, but I mainly have to contend with driver bugs, so I imagine the issues are common to every install.

[1] The only problem with this is that if the screen is not plugged in or started at boot time, xbmc may start with the wrong resolution. In this case you have to log out and back in. I have the Slim login manager installed, set to auto-login at boot.
find quote
Rapoza Offline
Junior Member
Posts: 36
Joined: Jun 2011
Reputation: 0
Post: #130
In fact "returns 0" means no errors. 1=errors.

I tried that way the first time but didn't work on natty. thats the reason of the 2nd option in my notes.

Can you please post the commands and more important the execution order?

THX.
find quote
Post Reply