Kodi Community Forum
[LINUX] HOW-TO use VAAPI HW Acceleration on new Intel Sandy Bridge platform - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: [LINUX] HOW-TO use VAAPI HW Acceleration on new Intel Sandy Bridge platform (/showthread.php?tid=96669)

Pages: 1 2 3 4 5 6 7 8 9 10 11


- Percius - 2011-03-14

Thank you thank you thank you....


Using your instructions I have full 1080P output with 8% CPU utilization (8% on one of the 4 cores).

Notes: Compiz crashes completely. When I had just 1 monitor setup it crashed 2 out of 10 boots, when I have 2 monitors connected (1 on vga for console, 1 hdmi(2)) mirrored @ 1080P 60hz it crashes every time.

Did not get more then 2.0 audio out of HDMI, however Digital Coax just works.

XBMC crashed every time I started a video. Applying todays updates then recompiling Mesa magically fixed the issue. Before that Log simply showed last event was starting a shader. It would crash and reload itself.

MSI H67MA-E35 ... Core I5 2400
Ubuntu 11.04 Alpha 3

Notes: Setting Xorg for 2 monitors was necessary for ubuntu to detect 2 monitors, however once ubuntu had them set to mirror I have 1 monitor & screen commented out in xorg.conf ... Not sure if this is associated with the video magically working but it works.

hopefully this board lasts longer then my AMD 780G board did. Lost sata ports on 4 of those boards (different manufacturers) within 2 years. Asus, MSI, Foxconn, another Asus....


- Percius - 2011-03-15

Anyone know how to patch LIRC with this kernel. LIRC is close to being unresponsive..... Have to hit a remote button for up to 10 seconds for a response....


http://www.gossamer-threads.com/lists/mythtv/users/463268


- alanwww1 - 2011-03-15

Percius Wrote:Applying todays updates then recompiling Mesa magically fixed the issue. Before that Log simply showed last event was starting a shader. It would crash and reload itself.

MSI H67MA-E35 ... Core I5 2400
Ubuntu 11.04 Alpha 3

Well i should have thought that not everybody uses the net install mini image, which automatically installs the newest packages. I will add an upgrade part to the guide.

Also whenever libgl-mesa* packages get updated from ppa, you have to recompile ans install mesa again.


- Hammi - 2011-03-15

@exobuzz:

exobuzz Wrote:I stuck some packages on my sandy bridge ppa with new libva and xbmc with vaapi support for those that want it up and running nice and easy on ubuntu maverick. its the bleeding edge git xbmc not the dharma 10.1 though.

Once you have xorg-edgers ppa added and kernel 2.6.37 (from somewhere - i might put one on my ppa also) (.38 seems to be buggy on sandy bridge still - at least for me)

sudo apt-add-repository ppa:jools/sandybridge
sudo apt-get install xbmc i965-va-driver vainfo

I tried this after installing a basic 10.10 server, but for some reason, it's not working for me. XBMC apparently is the version from your repo (it shows pre-11), but when playing movies, the "o" info shows ff-h269, no sign of vaapi, and CPU load is high.

What I did after a minimal server install, all as root:

Remove apparmor, install 2.6.37 kernel from mainline:

Code:
/etc/init.d/apparmor stop
update-rc.d -f apparmor remove
/etc/init.d/apparmor teardown
apt-get -y purge apparmor apparmor-utils
#
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.37-natty/linux-headers-2.6.37-020637-generic_2.6.37-020637.201101050908_i386.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.37-natty/linux-headers-2.6.37-020637_2.6.37-020637.201101050908_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.37-natty/linux-image-2.6.37-020637-generic_2.6.37-020637.201101050908_i386.deb
dpkg -i *.deb
#
reboot

Install some basic drivers:

Code:
apt-get -y install udisks upower xorg alsa-utils mesa-utils
adduser UserName video
adduser UserName audio
reboot

Update from xorg-edgers:

Code:
apt-get -y install python-software-properties
add-apt-repository ppa:xorg-edgers/ppa
apt-get update
apt-get upgrade
apt-get -y install libva1 vainfo i965-va-driver libva-glx1 libva-dev
reboot

Install xbmc:

Code:
wget http://paste.kde.org/6966/raw/ -O /etc/X11/xorg.conf
#
add-apt-repository ppa:team-xbmc/ppa
apt-get update
apt-get -y install xbmc xinit x11-xserver-utils
adduser xbmc --gecos XBMC
usermod --group audio,video,fuse,cdrom,plugdev xbmc
apt-get -y install xbmc-live
#
apt-get -y install alsa-utils
alsamixer
alsactl store 0
#
reboot

Update from your ppa (I removed xorg-edgers and team-xbmc first, as there is a conflict in app names between these repos and yours, and I wanted to make sure I install from your ppa:

Code:
rm /etc/apt/sources.list.d/team-xbmc-*
rm /etc/apt/sources.list.d/xorg-edgers-*
apt-add-repository ppa:jools/sandybridge
apt-get update
apt-get -y install i965-va-driver vainfo xbmc

As mentioned above, there seems to be an issue with the driver. Not sure if it's the kernel or the update from your repo... Any hint what I may have been missing?


- alanwww1 - 2011-03-15

@Hammi

Could you please discuss
the stuff related to

ppa:jools/sandybridge

in another thread ? Users who read this thread will be confused of the two methods and the solutions for them.

Thanks, Alan


- Hammi - 2011-03-16

Well, for me this is still the same topic, as I have the issues I described above with Sandy Bridge on Natty. So trying to find a setup on 10.10 seems to be well worth the effort, hopefully not just for me, but also for others with similar issues.

I have, by the way, managed to resolve the projectM issue and have XBMC running on 10.10 now. What I did was I used the approach I described above (largely based on your other VAAPI how-to), but after installing the packets from jools PPA (which did not leave me with any vaapi acceleration in XBMC) compiled libva from git as described in your how-to in this thread.

I also tried to compile mesa from git, but the 10.10 install, with updates from xorg-edgers, leaves me with a too old version of libdrm.

To answer your remaining open question: projectM runs at 12 to 16.67 fps with this built - not that impressive, but the good news is that it works at all. On my Atom, projectM still runs with 28 to 50 fps. But maybe the GPU performance will increase with later revisions of the driver. And maybe sometime we will also see some settings to address the crushed blacks.


- exobuzz - 2011-03-16

if you want I could help you debug using my ppa on another thread. the libva/xbmc there does work with vaapi - as I am using it myself. I just have ubuntu maverick/kernel 2.6.37/xorg-edgers and my ppa, so I wonder if you missed something out.


- alanwww1 - 2011-03-16

Hammi Wrote:I also tried to compile mesa from git, but the 10.10 install, with updates from xorg-edgers, leaves me with a too old version of libdrm.

To answer your remaining open question: projectM runs at 12 to 16.67 fps with this built - not that impressive, but the good news is that it works at all.

There is a massive performance increase in this git commit in mesa.

http://www.phoronix.com/scan.php?page=article&item=intel_snb_13lines&num=1

But maybe for that you need the other packages from the Xorg stack updated. For me projectM goes 60fps+ with latest packages.

Here is how to build the whole Xorg stack. Of course the only thing you can NOT update here is the drm kernel modules built into the kernel. For that you need a kernel update. But maybe you can gain performance without that.

Code:
git clone git://git.freedesktop.org/git/mesa/drm
cd drm
./autogen.sh --prefix=/usr
make
sudo make install

Code:
sudo apt-get build-dep mesa-common-dev
sudo apt-get install flex
git clone git://git.freedesktop.org/git/mesa/mesa
cd mesa
./autogen.sh --prefix=/usr --with-driver=dri --disable-glut
make
sudo make install

Code:
sudo apt-get build-dep xserver-common
git clone git://anongit.freedesktop.org/pixman
cd pixman
./autogen.sh --prefix=/usr
make
sudo make install

Code:
git clone git://git.freedesktop.org/git/xorg/xserver
cd xserver
./autogen.sh --prefix=/usr --enable-builtin-fonts
make
make install
sudo chmod +s /usr/bin/Xorg

Code:
git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-intel
cd xf86-video-intel/
sudo apt-get build-dep xserver-xorg-video-intel
./autogen.sh --prefix=/usr
make
sudo make install

Code:
git clone git://anongit.freedesktop.org/xorg/driver/xf86-input-evdev
cd xf86-video-evdev/
./autogen.sh --prefix=/usr
make
sudo make install

I contacted the authors for the Xorg edgers ppa, to update the outdated libva package they have. They defined a very complicated debian based method of building the needed libva packages for the ppa. Unfortunately it does not work at the moment. I try to figure out why.

If the updated libva package could go into the ppa, we could have an easier job getting things work for Natty.


- Hammi - 2011-03-18

Thanks. For some reason, that didn't really help much here, either. I had a spare GT 430 here, so I just plugged that into the box, put 10.10 and XBMC onto it with my script, , and I'm now back to a solid 50 fps projectM (running 1080@50 as the standard mode here), and am not having crushed black playing movies.

The iGPU was a test for me, and I'm sure I'll try again later, maybe if XBMC 11 builds on a kernel support Sandy Bridge with then some more mature and more fully featured drivers.


- GTMoraes - 2011-03-19

Hey, give me a hand here.
I'm trying to install the latest drivers here, but I'm stuck at MESA one.

Running "./autogen.sh --prefix=/usr --with-driver=dri --disable-glut" gives me this
Code:
...
checking pkg-config files for X11 are available... yes
checking for X11... yes
checking for LIBDRM... no
configure: error: Package requirements (libdrm >= 2.4.24) were not met:

Requested 'libdrm >= 2.4.24' but version of libdrm is 2.4.23

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBDRM_CFLAGS
and LIBDRM_LIBS to avoid the need to call pkg-config.
...
Seems like I can't update to 2.4.24 or I'm doing it wrong. I've downloaded the libdrm-2.4.24.tar.bz2 file and followed the instructions. It looked like it installed fine, but running the MESA command gives me the same error again.

What should I do?


- Hammi - 2011-03-19

Let me guess: You're trying to install the stuff under 10.10. That gave me that error as well. Alan's how-to only works with Natty.

So you could either use Natty Alpha3, or install mesa from xorg-edgers, then add the packages from jools ppa, and maybe compile libva1 on top (following Alan's guidance). With kerne 2.6.37, that should work.

Maybe there is also a way to update libdrm separately. But that was nothing I ever tried.


- Krautmaster - 2011-03-19

is it possible to play interlaced material smooth now having VAAPI enabled...?


- Hammi - 2011-03-19

Yes, it was smooth for me. projectM-performance was not really convincing, and I had crushed black. But no stuttering et al.


- Krautmaster - 2011-03-19

in XBMC?


- Hammi - 2011-03-19

I never tried anything else. Just follow Alan's guide in the first post. If you daren't moving to Natty Alpha kernel, the ride might be a bit bumpy, but it could still work for you.