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)



- MaZZly - 2011-10-12 08:26

Redsandro Wrote:Easy XBMC-VAAPI installation

This is awesome Big Grin

I got an easy way of getting VAAPI to work with XBMC on my AMD Fusion A50M chipset (Zotac Fusion mainboard)

1. Install Ubuntu 11.10 Beta 2

Download the image and use unetbootin to create a bootable USB stick. Install from there.

2. Fixes

This is beta-software (next week the full version comes out, maybe you don't need this anymore.)

Code:
$ sudo apt-get update
$ sudo apt-get upgrade

2b. Optional fixes

Code:
$ sudo apt-get install gnome-shell
$ sudo apt-get remove overlay-scrollbar
$ sudo apt-get remove liboverlay-scrollbar-0.2-0

3. Install VAAPI driver from Splitted-Desktop

New URL
Code:
$ wget http://www.splitted-desktop.com/static/libva/xvba-video/xvba-video_0.8.0-1_amd64.deb
sudo dpkg -i xvba-video_0.8.0-1_amd64.deb

4. Install Catalyst 11.8 drivers.
Run jockey-gtk and install the ATI/AMD proprietary FGLRX graphics driver. The (post-release updates) version doesn't work. Yet. Maybe it works when the final version of Ubuntu Oneiric comes out.

5. Install patched XBMC from lars-opdenkamp PPA

Create /etc/apt/sources.list.d/xbmc-opdenkamp.list with following contents:
Code:
# RED 2011-10-08
# XBMC VAAPI patched natty repo

deb http://ppa.launchpad.net/lars-opdenkamp/xbmc-pvr/ubuntu natty main
deb-src http://ppa.launchpad.net/lars-opdenkamp/xbmc-pvr/ubuntu natty main

Code:
$ apt-get update
The PPA will complain about missing key. Take the last 8 characters from the key ID and insert like so:
Code:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8NUMHERE
Replace 8NUMHERE with the actual key ID that the complaining apt-get update provides.

Code:
$ apt-get update
$ apt-get install xbmc

5b. (optional) Check non-VAAPI playback
Movies already play back faster in XBMC due to the catalyst driver, but 1080 will probably not play back smooth yet. You can check this to make you extra happy when VAAPI works.

6. Verify correct installation of drivers

Code:
$ vainfo
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 -1
Error! Make a symbolic link like Robotica proposed:

Code:
$ sudo ln -s /usr/lib/va/drivers/fglrx_drv_video.so /usr/lib/dri/

Code:
$ vainfo
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.8.0
vainfo: Supported profile and entrypoints
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
Correct!

Code:
$ fglrxinfo
display: :0.0  screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: AMD Radeon HD 6300 series Graphics
OpenGL version string: 4.1.11005 Compatibility Profile Context
Correct!

7. Start XBMC and enable VAAPI, disable VDPAU

Robotica provided a nice screenshot:
http://gaspo.dyndns.org/files/xbmc-settings-videos-playback.png

8. Start XBMC, ready for action!
Restart XBMC, and play your 1080p movie.

Big GrinBig GrinBig GrinBig Grin


Now, if only someone knew a trick to make Adobe Flash play fluent fullscreen in the browser..

I tried your guide and could get it to work only if i started xbmc from terminal, when starting it normally it crashes when i was about to start a video..
also when i started it the startup logo was weird.

BUT
then i tried your optional fix to install gnome shell, and when inlogged into gnome shell it works flawlessly..

so maybe make that step non-optional? =D

thnx m8

now my 170€ htpc works fine.. love it how spdif works out of the box also =)


- Robotica - 2011-10-12 14:23

fritsch Wrote:I have the same problem.

I filed two bugs, which tell the "two last" problems for me with the Zacate platform:

http://trac.xbmc.org/ticket/11862 (hang in menu, etc.)
http://trac.xbmc.org/ticket/12015 (problems using newer ffmpeg, which should fix the stop in video and sound issues)

My system crashes very hard if this is happening, process gets defunc and not killable anymore

There is a patch for compiling against newer FFMPEG: http://trac.xbmc.org/ticket/11689
And for this ticket, it is best to cc Fernetmenta/bobo1on1 in the ticket: http://trac.xbmc.org/ticket/11862

Together with Fernetmenta patches for the 24p bug, audio out of sync after pause/seek issue, the catylist driver 11.8 which solved the Suspend Problems and the the great bugreport from fritsch, it looks like all known problems will be soon solved. Oh, only the big pixel issue could be handled better by XBMC.

Make sure to have your settings set to rendermethod is VAAPI, set Always vsync= enabled, sync audio to video = disabled & "Adjust display refresh rate to match video". If you have the "Adjust display refresh rate to match video" setting enabled XBMC will adjust the refresh rate to 24Hz, 25Hz, or whatever the video frame rate is when you play the video. The ATI control center helpfully sets the screen scaling separately for each refresh rate, so the screen scaling will vary depending on what video you play.


Last things: I am running without a GUI and with aticonfig cli-based, it is possible to activate the "tearfree option" setting.

Answer:
Code:
$ amdxdg-su -c amdcccle

or

$ sudo amdcccle

And I've read someone was using a leightweight windows manager (replacement for X). Maybe something like twm-kiosk, wayland, enlightment, fluxbox or windowmaker? Any more info on this? And I would love to test some even more minimal distro's? anyone idea's?


- Redsandro - 2011-10-12 18:24

MaZZly Wrote:I tried your guide and could get it to work only if i
thnx m8

Thanks MaZZly, I added your suggestion to the optional step. Smile
Honestly, I didn't try it without the optional step, because without it Ubuntu is more like EwwBuntu to me. Frown But I know some people like it the way it is, so I made the step optional not to offend anynoe. Big Grin

btw you shouldn't quote such a lengthy post in it's entirety. :o

@Robotica: Could you give some pointers on getting mplayer-vaapi and/or gstreamer-vaapi to work with vaapi?

Using the information both provided by Splitted-Desktop and by your second post, I just couldn't get them to work.

These little Fusion machines are worth so much more within Linux if we could get some desktop player to play video like a boss also.


- Robotica - 2011-10-13 10:41

Doesn't this work:
Code:
cd /usr/src
wget http://www.splitted-desktop.com/static/libva/mplayer-vaapi/
tar xvfj mplayer-vaapi-latest.tar.bz2  (or: tar -xpvf mplayer-vaapi-latest-FULL.tar.bz2 )
cd mplayer-vaapi-20110127/
./checkout-patch-build.sh
cd mplayer-vaapi
(sudo)make install
ldconfig

(I just used the build instructions: http://www.splitted-desktop.com/static/libva/mplayer-vaapi/)

Then play with
./mplayer -vo vaapi -va vaapi filename


- Redsandro - 2011-10-13 14:46

That is so weird, I must be missing something.

I tried it again, I just keep getting
Error opening/initializing the selected video_out (-vo) device.
There is no vaapi.

Build:
Quote:# tar -xjpf mplayer-vaapi-20110127-FULL.tar.bz2
# cd mplayer-vaapi-20110127
# ./checkout-patch-build.sh
patching file Makefile
(...)
Checking for VA-API ... no
Checking for VA-API (with GLX support) ... no
(...)
Config files successfully generated by ./configure --enable-vaapi --disable-vdpau !
# cd mplayer-vaapi/
# make install
install -d /usr/local/bin /usr/local/etc/mplayer /usr/local/lib
install -m 755 -s mencoder /usr/local/bin
install -d /usr/local/share/man/man1
install -m 644 DOCS/man/en/mplayer.1 /usr/local/share/man/man1/
cd /usr/local/share/man/man1 && ln -sf mplayer.1 mencoder.1
install -m 755 -s mplayer /usr/local/bin
# ldconfig

Play:
Quote:# ./mplayer -vo vaapi -va vaapi /home/sample.mkv
MPlayer SVN-r32819-4.6.1 © 2000-2011 MPlayer Team
/home/sample.mkv
Playing /home/sample.mkv.
libavformat file format detected.
[matroska,webm @ 0x2d3a880] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (dca), -aid 0, -alang eng
VIDEO: [H264] 1280x720 0bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
Load subtitles in /home/
Error opening/initializing the selected video_out (-vo) device.
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [ffdca] afm: ffmpeg (FFmpeg DTS)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
DVB card number must be between 1 and 4
AO: [null] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...

Code:
# [b]./mplayer -vo help[/b]
MPlayer SVN-r32819-4.6.1 (C) 2000-2011 MPlayer Team
Available video output drivers:
    fbdev    Framebuffer Device
    fbdev2    Framebuffer Device
    v4l2    V4L2 MPEG Video Decoder Output
    cvidix    console VIDIX
    null    Null video output
    mpegpes    MPEG-PES to DVB card
    yuv4mpeg    yuv4mpeg output for mjpegtools
    png    PNG file
    tga    Targa output
    pnm    PPM/PGM/PGMYUV file
    md5sum    md5sum of each frame



- Robotica - 2011-10-13 15:04

The patched libVA must be installed on the system prior to building the patched MPlayer. The libVA installation must be complete; it is not sufficient to copy the libva.so and corresponding symbolic links because the updated VA header files are required during the build of the modified MPlayer. Complete installation requires “make install” of libVA.


- Redsandro - 2011-10-13 15:12

Thanks for the pointer. They won't build or install due to files already existing with newer file names. I thought those were good. Can I just remove all packages it complains about?

Also, in stead of building, there are also .deb files in the same Splitted-Desktop directory. But same story. Can I remove the stuff with newer filenames, without breaking Xubuntu or XBMC, which works extremely nice right now?

Quote:# dpkg -i libva-dev_0.32.0-1+sds2_amd64.deb
dpkg: warning: downgrading libva-dev from 1.0.12-2 to 0.32.0-1+sds2.
(Reading database ... 226187 files and directories currently installed.)
Preparing to replace libva-dev 1.0.12-2 (using libva-dev_0.32.0-1+sds2_amd64.deb) ...
Unpacking replacement libva-dev ...
dpkg: dependency problems prevent configuration of libva-dev:
libva-dev depends on libva1 (= 0.32.0-1+sds2); however:
Version of libva1 on system is 1.0.12-2.



- Robotica - 2011-10-13 15:20

I am not sure about breaking your install... Clone it so you can play a little..

Do you have Symlink:
ln -s mplayer-vaapi /mplayer/mplayer

looks like you need to refer to libva source

And if you set the environment variable:

export LIBVA_DRIVER_NAME=xvba

before starting mplayer?

Or last option:
install a front-end for MPLayer by running the following in a terminal:
sudo apt-get install smplayer

and then changing the video out device in the SMPlayer preferences:

Options --> Preferences --> General --> Video --> Output Driver

mplayer -vo help will also get you a list of output devices


- Ragtreme - 2011-10-13 15:56

Used RedSandro's Guide from the previous page.

Had to disable vaapi in the settings to play mkvSad

Seems to run okay (not great) Anyone else experiencing the same problem?

Thanks a lot by the way, I'm a absolute Linux-Newbie.

Had to look up how to create the xbmc list, but it worked in the end.

UPDATE: 11.10 is official, maybe it's now going to be easier...


Optical or Analog out - MarsianMan - 2011-10-14 01:44

I am really excited to get the ZBox AD02 working with XBMC, but I am having some issues. So far I have been able to get HDMI audio working, but it is very static filled. My speakers are Logtiech z-680 (similar to the z-5500 I believe). the only inputs are 1 optical, 1 coax, 6ch / 2ch in. In order to get HDMI audio to the speakers, it has to go through the TV and then to the speakers, which is creating a very loud static noise.

Ideally I would like to bypass the TV by whatever means possible. I am fine with 2ch or using optical but none of the options in XBMC seem to work. I was able to get mplayer to work over analog (I had to disable Azalia in bios to get the HDMI audio working).

Is there a way to get XBMC working with non-HDMI audio? Does anyone have some suggestions? I would think Analog would be the easiest, but I would prefer optical. What kind of options are accepted by "custom" audio devices? Would it accept what I give to mplayer after -ao alsa:device=xxxx=#.#?

I have spent over 25 hours this week on getting this box running already!