2011-03-12, 22:07
This guide is outdated ! Please use my new guide: http://forum.xbmc.org/showthread.php?tid=114368
Please note that this guide is very experimental. As the hardware and drivers are brand new, not everything is rock stable yet.
For this hardware we really need to use the newest available linux components we can get. Yes even the xorg edgers ppa is not up to date yet (specially the libva package is very outdated)
Of course this guide will be coming less and less complicated as the git changes get into the Ubuntu packages. I will update this guide all the time when there is a change which makes it less complicated.
What works:
Smooth VAAPI acceleration for mpeg2, h264, VC1 (not all files at the moment)
Auto refresh rate and smoothvideo function (with a small patch)
ProjectM with > 60fps (with recent patch in Intel driver)
Shader based HQ upscalers
Multichannel LPCM sound (with a workaround)
Suspend - resume
What is not working yet:
VAAPI deinterlacing (work is in progress)
So let's get to the steps:
1. Install OS
Get the netboot image for Ubuntu Natty 11.04 from here.
Burn, choose Command-line-install and use xbmc for username.
2. Install basic packages
After reboot, install ssh so you can continue work with Putty (for win) or with the "ssh -l xbmc your.IP.address" from a linux terminal. Also we install py-properties to easy add ppas. But before you ca do it remotely you need to install these packages. So get a terminal with crtl+alt+f1, than
Let's add the xorg edgers ppa right away.
Let's install some basic packages:
Let's add xbmc user to important groups than reboot
Now we will set the system that we can run Xorg without root privilages.
Let's get a working xorg.conf for Intel Sandy bridge. Note that this file is for one display system and it includes custom modelines which only work on HDTV-s. If you have a lower resolution monitor, you have to adjust the settings with "sudo nano /etc/X11/xorg.conf"
3. Compile LIBVA and MESA
For Sandy Bridge VAAPI to work we need the latest possible Libva package. At the xorg edgers ppa it is an old one at the moment. We need to build libva from git. Also to make it compatible we need to build a new MESA package. Here is how to do it. Note that we need a patch for libva for make to run without a missing include file.
For MESA
After this you can start Xorg with startx and with vainfo you should see something like this:
Note that when you run startx on a minimal system only an xterm terminal shows on your top-left corner of screen. You have to make it active with a mouse click. If you can't see it, you can try to adjust your TV's overscan settings.
Please verify that your output is HDMI2 (like at my case) because i created the xorg.conf file for that. To check, run xorg and than run:
If it is not HDMI2 at your system, you have to edit the downloaded xorg.conf with
4. Compile XBMC
We get some needed build packages first:
We compile libbluray to get bluray folder support for xbmc:
Now we compile a fresh xbmc version. Note that we need a small patch for auto refresh rate to work with smoothvideo enabled.
5. Various settings, autostart xbmc
For autostart xbmc we create an upstart init script:
In alsamixer unmute the spdif devices. Than we store this setting.
Let's install lirc. Note that for kernel 2.6.38 there is a key event support for MCE remotes. This results a double event for cursor keys. To disable this i added the needed line in the upstart script (we already installed in the previous point). Also we enable the remote to wakeup the system. For this you will need to adjust the /etc/udev/rules.d/90-mcewakeup.rules file after we download it. For that you can check the Device ID of your remote with lsusb. My output was:
Note that for MCE remote you have to choose "Windows Media Center Transceivers" after choose none, when install lirc.
For suspend to have it working we need to enable an inactive session to use upower. We do it this way:
After reboot you will be able to use xbmc.
6. Some remarks and experiences
For suspend to work you might need a BIOS upgrade. I had problems with some boards, some worked out of the box.
You can always start (and stop) xbmc even remotely with
Multichannel lpcm only works with a workaround. It is some kind of EDID parsing problem with alsa. You can check the modes detected by the kernel with
And check EDID detection with
Mine looks like this: http://pastebin.com/QQ91D5ih
and should have looked like this: http://pastebin.com/SeJfY18A
There is a workaround until automatic eld parsing works that triggers the available soundmodes manually. Just insert this into the /etc/init/xbmc.conf upstart script at the end of the "pre-start script" section (you might have to tune the values to your available configuration):
Deinterlacing is not yet implemented for vaapi in xbmc. Not even in libva yet. But it is being worked on. There are a few important commits already for the i965 libva driver for implementing hq upscaling and hw deinterlacing.
The guide was tested on a H67 motherboard and a core i5-2500K CPU.
Happy testing, Alan
Please note that this guide is very experimental. As the hardware and drivers are brand new, not everything is rock stable yet.
For this hardware we really need to use the newest available linux components we can get. Yes even the xorg edgers ppa is not up to date yet (specially the libva package is very outdated)
Of course this guide will be coming less and less complicated as the git changes get into the Ubuntu packages. I will update this guide all the time when there is a change which makes it less complicated.
What works:
Smooth VAAPI acceleration for mpeg2, h264, VC1 (not all files at the moment)
Auto refresh rate and smoothvideo function (with a small patch)
ProjectM with > 60fps (with recent patch in Intel driver)
Shader based HQ upscalers
Multichannel LPCM sound (with a workaround)
Suspend - resume
What is not working yet:
VAAPI deinterlacing (work is in progress)
So let's get to the steps:
1. Install OS
Get the netboot image for Ubuntu Natty 11.04 from here.
Burn, choose Command-line-install and use xbmc for username.
2. Install basic packages
After reboot, install ssh so you can continue work with Putty (for win) or with the "ssh -l xbmc your.IP.address" from a linux terminal. Also we install py-properties to easy add ppas. But before you ca do it remotely you need to install these packages. So get a terminal with crtl+alt+f1, than
Code:
sudo apt-get update
sudo apt-get upgrade
sudo reboot
sudo apt-get install ssh python-software-properties
Let's add the xorg edgers ppa right away.
Code:
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get upgrade
Let's install some basic packages:
Code:
sudo apt-get install udisks upower xorg alsa-utils mesa-utils git-core fontconfig liblcms1 libmng1 libqt3-mt librtmp0 libvdpau1 python-qt3 python-sip ttf-liberation libgtk2.0-bin libmad0
Let's add xbmc user to important groups than reboot
Code:
sudo adduser xbmc video
sudo adduser xbmc audio
sudo reboot
Now we will set the system that we can run Xorg without root privilages.
Code:
sudo dpkg-reconfigure x11-common
Let's get a working xorg.conf for Intel Sandy bridge. Note that this file is for one display system and it includes custom modelines which only work on HDTV-s. If you have a lower resolution monitor, you have to adjust the settings with "sudo nano /etc/X11/xorg.conf"
Code:
sudo wget http://paste.kde.org/6966/raw/ -O /etc/X11/xorg.conf
3. Compile LIBVA and MESA
For Sandy Bridge VAAPI to work we need the latest possible Libva package. At the xorg edgers ppa it is an old one at the moment. We need to build libva from git. Also to make it compatible we need to build a new MESA package. Here is how to do it. Note that we need a patch for libva for make to run without a missing include file.
Code:
cd ~
mkdir Builds
cd Builds
git clone git://anongit.freedesktop.org/git/libva
cd libva*
sudo apt-get build-dep libva1
wget http://paste.kde.org/6967/raw/ -O Libva_testdir_makefile.patch
patch -p1 < Libva_testdir_makefile.patch
./autogen.sh --enable-i965-driver --prefix=/usr
make
sudo make install
For MESA
Code:
cd ~/Builds
sudo apt-get build-dep mesa-common-dev
git clone git://git.freedesktop.org/git/mesa/mesa
cd mesa
./autogen.sh --prefix=/usr --with-driver=dri --disable-glut
make -j4
sudo make install
After this you can start Xorg with startx and with vainfo you should see something like this:
Code:
vainfo: VA API version: 0.32
vainfo: Driver version: i965 Driver 0.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Baseline : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
Note that when you run startx on a minimal system only an xterm terminal shows on your top-left corner of screen. You have to make it active with a mouse click. If you can't see it, you can try to adjust your TV's overscan settings.
Please verify that your output is HDMI2 (like at my case) because i created the xorg.conf file for that. To check, run xorg and than run:
Code:
xrandr -q
If it is not HDMI2 at your system, you have to edit the downloaded xorg.conf with
Code:
sudo nano /etc/X11/xorg.conf
4. Compile XBMC
We get some needed build packages first:
Code:
sudo apt-get install git-core make g++ gcc gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxtst-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmms-dev libmpeg3-dev libfaad-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libwavpack-dev libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs autopoint dh-autoreconf ccache libyajl-dev libbluetooth-dev python-dev libboost-thread-dev
We compile libbluray to get bluray folder support for xbmc:
Code:
cd ~/Builds
git clone git://git.videolan.org/libbluray.git
cd libbluray
./bootstrap
./configure --prefix=/usr
make
sudo make install
Now we compile a fresh xbmc version. Note that we need a small patch for auto refresh rate to work with smoothvideo enabled.
Code:
cd ~/Builds
git clone git://github.com/xbmc/xbmc.git
cd xbmc
./bootstrap
./configure --prefix=/usr --enable-vaapi --enable-libbluray
wget http://paste.kde.org/7020/raw/ -O ./ReferenceClockHang.patch
patch -p1 < ./ReferenceClockHang.patch
make -j4
sudo make install
5. Various settings, autostart xbmc
For autostart xbmc we create an upstart init script:
Code:
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 alsamixer unmute the spdif devices. Than we store this setting.
Code:
alsamixer
sudo alsactl store
Let's install lirc. Note that for kernel 2.6.38 there is a key event support for MCE remotes. This results a double event for cursor keys. To disable this i added the needed line in the upstart script (we already installed in the previous point). Also we enable the remote to wakeup the system. For this you will need to adjust the /etc/udev/rules.d/90-mcewakeup.rules file after we download it. For that you can check the Device ID of your remote with lsusb. My output was:
Code:
Bus 001 Device 003: ID 1784:0008 TopSeed Technology Corp. eHome Infrared Transceiver
Code:
sudo apt-get install lirc
sudo wget http://paste.kde.org/7159/raw/ -O /etc/udev/rules.d/90-mcewakeup.rules
sudo reboot
Note that for MCE remote you have to choose "Windows Media Center Transceivers" after choose none, when install lirc.
For suspend to have it working we need to enable an inactive session to use upower. We do it this way:
Code:
wget http://paste.kde.org/94699/raw/ -O /etc/polkit-1/localauthority/50-local.d/xbmc_rule.pkla
After reboot you will be able to use xbmc.
6. Some remarks and experiences
For suspend to work you might need a BIOS upgrade. I had problems with some boards, some worked out of the box.
You can always start (and stop) xbmc even remotely with
Code:
sudo start xbmc
sudo stop xbmc
Multichannel lpcm only works with a workaround. It is some kind of EDID parsing problem with alsa. You can check the modes detected by the kernel with
Code:
dmesg |grep HDMI
And check EDID detection with
Code:
cat /proc/asound/card0/eld#3.0
Mine looks like this: http://pastebin.com/QQ91D5ih
and should have looked like this: http://pastebin.com/SeJfY18A
There is a workaround until automatic eld parsing works that triggers the available soundmodes manually. Just insert this into the /etc/init/xbmc.conf upstart script at the end of the "pre-start script" section (you might have to tune the values to your available configuration):
Code:
echo sad0_rates 0x1ee0 > /proc/asound/card0/eld#3.0
echo speakers 0x4f > /proc/asound/card0/eld#3.0
echo sad0_channels 8 > /proc/asound/card0/eld#3.0
echo sad0_bits 0xe0000 > /proc/asound/card0/eld#3.0
Deinterlacing is not yet implemented for vaapi in xbmc. Not even in libva yet. But it is being worked on. There are a few important commits already for the i965 libva driver for implementing hq upscaling and hw deinterlacing.
The guide was tested on a H67 motherboard and a core i5-2500K CPU.
Happy testing, Alan