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)



- peterk2005 - 2011-06-17 18:22

WytRaven Wrote:Holy shit! VA API just started working. I removed my old xorg.conf and did an "aticonfig --initial -f", rebooted and bobs my freakin uncle! Shocked

Can you try 24p, vsync on please? (I'm, using nemek's custom built XBMC live distro, and it's working fine, except 24P, vsync on, when I see this terrible tearing.)


- Robotica - 2011-06-17 18:25

peterk2005 Wrote:Can you try 24p, vsync on please?

First check if that mod-line is available....


- Rapoza - 2011-06-17 19:31

WytRaven, arrived to the point of testing the driver+va and obtained:
Quote:root@HTPC:~# export DISPLAY=:0
root@HTPC:~# fglrxinfo
Error: unable to open display (null)
root@HTPC:~# vainfo
vainfo: Error, can't open display: ':0'

I assume its normal becouse no X running on tty7.
Looks good. I continue.

After local startx on putty

Quote:xbmc@HTPC:~$ vainfo
No protocol specified
vainfo: Error, can't open display: ''
xbmc@HTPC:~$ fglrxinfo
Error: unable to open display (null)

Its normal startx only to show commandline in graphic mode? (guess yes lack of gnome, but...)


- Rapoza - 2011-06-17 19:47

Finally seems that I've done an installation on natty that runs xbmc. Thanks WytRaven for your steps. Strange maneuvers at the end thou.

All running, from ssh shows:
Quote:xbmc@HTPC:~$ sudo vainfo
libva: libva version 0.32.0
Xlib: extension "XFree86-DRI" missing on display ":0.0".
libva: va_getDriverName() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

xbmc@HTPC:~$ fglrxinfo
Error: unable to open display (null)

Time to play. Big Grin


- WytRaven - 2011-06-18 02:57

Good to hear you have had some success Rapoza although I'm not sure quite what is going on with your fglrxinfo and vainfo. I didn't add it to the bottom of my instructions (and I also updated them toward the bottom so that might have something to do with weirdness) but I did an apt-get dist-upgrade at the end somewhere which upgraded two packages from memory but I don't remember which ones. try apt-get -s dist-upgrade so you can see what will happen first before actually committing.

Here's my fglrxinfo and vainfo output for reference (xbmc running on box and run from ssh login into xbmc user on remote machine):
Code:
xbmc@somehostname:~$ fglrxinfo
display: :0  screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: AMD Radeon HD 6300 series Graphics
OpenGL version string: 4.1.10834 Compatibility Profile Context

xbmc@somehostname:~$ 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.7.8
vainfo: Supported profile and entrypoints
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD

That vainfo error of yours doesn't look good Sad


The Beast - WytRaven - 2011-06-18 03:24

Here's my current setup. Thought you lot might get a laugh out of this Wink:

[Image: thebeastl.jpg]


- WytRaven - 2011-06-18 05:12

peterk2005 Wrote:Can you try 24p, vsync on please? (I'm, using nemek's custom built XBMC live distro, and it's working fine, except 24P, vsync on, when I see this terrible tearing.)

At this point I have exactly the same behaviour. That said, I haven't begun playing with modelines yet. 1920/1080p 24Hz without vsync works fine though, in fact apart from initial tearing in the first 5 seconds or so it then cleans up and syncs perfectly on it's own. But without vysnc enable 50/60Hz tear like a bitch.

Edit: Not entirely true tearing does not clear up completely but is minimal. I think this may have something to do with the 24Hz is not actually 24Hz thing which means modelines probably are the solution.


- gaspo100 - 2011-06-18 06:51

Thanks WytRaven for the instructions. I followed them exactly and got xbmc to run. vainfo and fglrxinfo show the same messages as what you get.
However, when I start playing any audio or video file I get instant xbmc crash:
Code:
xbmc@ubuntu-xbmc:~$ xbmc
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Running DIL (3.6.0) Version
DtsDeviceOpen: Opening HW in mode 0
DtsDeviceOpen: Create File Failed
libva: libva version 0.32.0
libva: va_getDriverName() returns 0
Segmentation fault
Crash report available at /home/xbmc/xbmc_crashlog-20110618_143119.log
xbmc_crashlog.log
Edit: Fixed the crashing when playing audio - had to install libmad0 and libcrystalHD3. Not sure anything else is needed for video playback.
XBMC crashes when VAAPI is enabled. When I disable VAAPI video plays but no HW acceleration Sad
@Rapoza
Quote:All running, from ssh shows:
Code:
xbmc@HTPC:~$ sudo vainfo
libva: libva version 0.32.0
Xlib: extension "XFree86-DRI" missing on display ":0.0".
libva: va_getDriverName() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

xbmc@HTPC:~$ fglrxinfo
Error: unable to open display (null)
When I forgot to set 'export DEVICE=:0' and run vainfo I got got the same weird messages. Once the DEVICE was set I got vainfo,fglrxinfo messages as WytRaven.


- WytRaven - 2011-06-18 09:17

gaspo100 Wrote:Thanks WytRaven for the instructions. I followed them exactly and got xbmc to run. vainfo and fglrxinfo show the same messages as what you get.
However, when I start playing any audio or video file I get instant xbmc crash:

I'm not sure exactly what to say on this. I know that I was initially getting crashing when playing video with VAAPI enabled.

Three things occurred, that I remember, since the end of my instructions. I deleted my /etc/X11/xorg.conf and did an "aticonfig --initial -f" and I am also pretty sure I did an "apt-get dist-upgrade" and finally I installed SLiM and started booting into the xbmc user to launch xbmc.

Other than telling you that, I am not sure what else I can do to help. The user running xbmc needs audio, video, and I believe also netdev for internet access (but this last one may be unnecessary but I haven't tried without to see access is still available). I wish I could give you a magical "click here" solution but I can't Confused


- gaspo100 - 2011-06-18 10:03

Thanks Raven. Not to worry, I'll get it working eventually.
I did a clean install following your instructions, all went fine. Initially, XBMC was crashing due to missing libmad0. I guess, there still could be something missing from my install compared to yours.


- Robotica - 2011-06-18 13:07

WytRaven Wrote:Here's my current setup. Thought you lot might get a laugh out of this Wink:

----removed pic----------[/url]

lol, can't decide on the case? Hopefully you can make a passive system out of that hardware.

btw.. thanx for your hard work (and sharing) to get this AMD Zacate platform running on Linux.


- peterk2005 - 2011-06-18 13:44

WytRaven Wrote:At this point I have exactly the same behaviour. That said, I haven't begun playing with modelines yet. 1920/1080p 24Hz without vsync works fine though, in fact apart from initial tearing in the first 5 seconds or so it then cleans up and syncs perfectly on it's own. But without vysnc enable 50/60Hz tear like a bitch.

Edit: Not entirely true tearing does not clear up completely but is minimal. I think this may have something to do with the 24Hz is not actually 24Hz thing which means modelines probably are the solution.

I think it's sadly an XBMC issue. Sad If I set 1080/24P in ati control center, and set vsync to forced on, then mplayer plays the same file perfectly. XBMC however has this terrible tearing/jumping.


- WytRaven - 2011-06-18 15:26

Robotica Wrote:lol, can't decide on the case? Hopefully you can make a passive system out of that hardware.

I'll be building a custom case for it that is designed to retard sound emissions. I can't really go completely passive as those hard drives have 5 platters each and as such physics declares they must produce a lot of heat when spinning...and they do. I am also running the E-350 over-clocked to 1680MHz as well so keeping air moving through the enclosure will be important.

That said those fans don't make much noise at all and once inside the enclosure will be completely silent.


- jbo87 - 2011-06-18 20:12

@WytRaven: I think you should install the ATI driver before you unmute w/ alsamixer because otherwise the HDMI output is not detected. At least for me.


Finally fixed the "SegFault" - dafrog - 2011-06-18 22:29

I fixed my "Segmentation Fault" issue!!! Big Grin
My first mention was right... vainfo crashed xbmc

See this link - I already posted the last time...

Here is what I did at first:
Code:
wget http://cgit.freedesktop.org/libva/snapshot/libva-1.0.13.tar.gz
tar xfv libva-1.0.13.tar.gz
cd libva-1.0.13/
vi va/va.c
##Here I added only the "else" part below
#   if (VA_STATUS_SUCCESS == vaStatus && driver_name != 0)
#    {
#        vaStatus = va_openDriver(dpy, driver_name);
#        va_infoMessage("va_openDriver() returns %d\n", vaStatus);
#
#        *major_version = VA_MAJOR_VERSION;
#        *minor_version = VA_MINOR_VERSION;
#    }

    else
    {
        vaStatus = VA_STATUS_ERROR_UNKNOWN;
    }
##
#now build it
./autogen.sh
make
sudo make install
#
# most important thing to point to the right driver directory/name
#if working set the variables permanent in /etc/environment
export LIBVA_DRIVERS_PATH=/usr/lib/dri
export LIBVA_DRIVER_NAME=fglrx
#
#you can again check with
export DISPLAY=:0
fglrxinfo
vainfo
#libva: libva version 0.32.0
#libva: User requested driver 'fglrx'
#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

#
#now test it with
xbmc

After getting it working I tried to use the xvba driver I installed before. That was from ppa:xorg-edgers/ppa without any change to the source code:
Code:
export LIBVA_DRIVER_NAME=xvba
export LIBVA_DRIVERS_PATH=/usr/lib/va/drivers
vainfo
#libva: libva version 0.32.0
#libva: User requested driver 'xvba'
#libva: Trying to open /usr/lib/va/drivers/xvba_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

In the end the origin of my problem was not directly vainfo/libva but the "not set" paths to the correct library's?!! Can somebody confirm that?

My vainfo output before my modification was:
Code:
xbmc@htpc:~$ 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.7.8
vainfo: Supported profile and entrypoints
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD

Anyway - now I will relax and watch a good 1080p movie... at about 15% CPU usage...


Regards
Fabian


p.s.
I have some picture "offsets" - looking like a line separating the movie in two parts ... above the line "old frame" (1/4) below "new frame"(3/4). This line appears on top(1/4) or bottom (1/4). I hope I described it coherent...
Any solution?