XBMC Community Forum
[LINUX] HOW-TO use VAAPI HW Acceleration on new Intel Sandy Bridge 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 new Intel Sandy Bridge platform (/showthread.php?tid=96669)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


- alanwww1 - 2011-03-13 16:06

Hammi Wrote:Ok, not so easy to play a movie. XBMC crashes when trying to generate a thumb for the movie I want to play:

I never had such problem with any of the files i tried. Well this does not even have anything to do with vaapi as it was tried to decode it in software. It is some sort of other ffmpeg problem.


- Hammi - 2011-03-13 16:30

Yes, ran some additional tests. Dharma has the same issues.

Anyhow, I was able to work around this, and XBMC played the first few mins of the movie with <10% CPU load. EXCELLENT!

Keyboard layout configuration did not work for the Natty install. I ran "dpkg-reconfigure console-data", but this did not have any effect on the layout in XBMC... I will have to look into this.

And then... shutting down via the menu doesn't work, either. XBMC exists to X and then restarts. Not sure if this is an issues of Ubuntu or the startup skript.

I will run some more test, try to fix the above issues (and watch an entire movie Smile ) before I will put the SSD from my current machine into the new one and reinstall for a "productive family machine".


- alanwww1 - 2011-03-13 17:14

Hammi Wrote:Anyhow, I was able to work around this, and XBMC played the first few mins of the movie with <10% CPU load. EXCELLENT!

And then... shutting down via the menu doesn't work, either. XBMC exists to X and then restarts. Not sure if this is an issues of Ubuntu or the startup skript.

Good to hear it works. What CPU do you have ? Could you please try projectM and what framerate do you have there ? I am just curious that can the 2000 series GPUS handle projectm the way the 3000 series ("K" letter in the product code) what i currently have. ?

Also can you try suspend. It probably won't work form xbmc but from terminal you can try sudo pm-suspend.

The shutdown behavior is expected and comes from the startup script i use. you can change that. I did it in case xbmc quits for some reason that it can start again.

Do you have the ocasional boot to black screen problem i have ?

Is Multichannel lpcm working for you with
Code:
speaker-test -Dhdmi -c6

I made a test with windows. Well dxva2 is NOT working properly at the moment with the newest drivers. So now linux support is actually ahead one step at the moment :-)

Suspend is working though.


- Hammi - 2011-03-13 22:15

alanwww1 Wrote:What CPU do you have ?

I have an i3-2100T.

alanwww1 Wrote:Could you please try projectM and what framerate do you have there?

Sorry, can't tell you. 2 secs after I start playing an MP3 (which plays fine with Dharma on my other machine) the screen locks up. The song continues playing, but I cannot locally control xbmc anymore. Logging in remotely via ssh also failed.

According to the log, there was no error in XBMC, so I guess it's some part of the display driver:

Code:
21:01:42 T:3047446336 M:1829220352   DEBUG: CFileCache::Open - opening </srv/netstore/Musik/Alben/Eros Ramazzotti - Live/01 - Io Amerò.mp3> using cache
21:01:42 T:3047446336 M:1829220352   DEBUG: DllLibApeTag: Using libapetag library
21:01:42 T:2884791152 M:1829347328   DEBUG: thread start, auto delete: 0
21:01:42 T:3047446336 M:1829347328   DEBUG: SECTION:LoadDLL(special://xbmcbin/system/libid3tag-i486-linux.so)
21:01:42 T:3047446336 M:1829244928   DEBUG: Loading: /usr/lib/xbmc/system/libid3tag-i486-linux.so
21:01:42 T:3047446336 M:1829142528   DEBUG: DllLibApeTag: Using libapetag library
21:01:42 T:3047446336 M:1829142528    INFO: PAPlayer: Playing /srv/netstore/Musik/Alben/Eros Ramazzotti - Live/01 - Io Amerò.mp3
21:01:42 T:3047446336 M:1829142528   DEBUG: PAPlayer: Creating new audio renderer
21:01:42 T:3047446336 M:1829142528    INFO: AudioRendererFactory:  not a explicit device, trying to autodetect.
21:01:42 T:3047446336 M:1829142528   DEBUG: RemoveActiveDevice - Removing device 1
21:01:42 T:3047446336 M:1829142528   DEBUG: CGUIAudioManager::DeInitialize
21:01:42 T:2884791152 M:1825800192    INFO: CFileCache::Process - Hit eof.
21:01:42 T:3047446336 M:1825800192   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
21:01:42 T:3047446336 M:1825800192   DEBUG: RemoveActiveDevice - Removing device 0
21:01:42 T:3047446336 M:1825800192   DEBUG: PulseAudio: Context failed
21:01:42 T:3047446336 M:1825800192   ERROR: PulseAudio: Waited for the Context but it failed
21:01:42 T:3047446336 M:1825800192   ERROR: PulseAudio: Failed to create context
21:01:42 T:3047446336 M:1825800192   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
21:01:42 T:3047446336 M:1825800192   DEBUG: RemoveActiveDevice - Removing device 2
21:01:42 T:3047446336 M:1825800192   DEBUG: CGUIAudioManager::Initialize
21:01:42 T:3047446336 M:1825738752   DEBUG: RemoveActiveDevice - Removing device 1
21:01:42 T:3047446336 M:1825738752   DEBUG: CGUIAudioManager::DeInitialize
21:01:42 T:3047446336 M:1825738752   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
21:01:42 T:3047446336 M:1825738752   DEBUG: RemoveActiveDevice - Removing device 0
21:01:42 T:3047446336 M:1825738752   DEBUG: Initialize - using alsa device default
21:01:42 T:3047446336 M:1825738752   DEBUG: CALSADirectSound::Initialize - frame count:940, packet count:16, buffer size:15052
21:01:42 T:3047446336 M:1825738752   DEBUG: CALSADirectSound::Initialize - Channels: 2 - SampleRate: 44100 - SampleBit: 16 - Resample false - IsMusic true - IsPassthrough false - audioDevice: default
21:01:42 T:3047446336 M:1825738752   DEBUG: CAnnouncementManager - Announcement: PlaybackStarted from xbmc
21:01:42 T:2950601584 M:1825738752   DEBUG: thread start, auto delete: 0
21:01:42 T:2950601584 M:1825738752   DEBUG: PAPlayer: Thread started
21:01:42 T:3047446336 M:1825484800   DEBUG: ADDON: Dll Initializing - projectM
21:01:42 T:3047446336 M:1825484800   DEBUG: SECTION:LoadDLL(/usr/lib/xbmc/addons/visualization.projectm/projectM.vis)
21:01:42 T:3047446336 M:1825484800   DEBUG: Loading: /usr/lib/xbmc/addons/visualization.projectm/projectM.vis
21:01:42 T:2950601584 M:1825103872    INFO: AudioDecoder: File is queued
21:01:42 T:3047446336 M:1825075200   DEBUG: Calling TransferSettings for: projectM
21:01:43 T:3047446336 M:1823563776   DEBUG: GetZipList - Processing zip://special%3a%2f%2fxbmc%2faddons%2fvisualization%2eprojectm%2fresources%2fpresets%2​ezip/
21:01:43 T:3047446336 M:1822752768   DEBUG: Visualisation::Start()
21:01:43 T:3047446336 M:1822752768   DEBUG: OnInitialize() started
21:01:43 T:3047446336 M:1822752768   DEBUG: OnInitialize() done
21:01:43 T:3047446336 M:1821429760   DEBUG: CGUIInfoManager::SetCurrentSong(/srv/netstore/Musik/Alben/Eros Ramazzotti - Live/01 - Io Amerò.mp3)
21:01:43 T:3047446336 M:1821429760   DEBUG: Loading additional tag info for file /srv/netstore/Musik/Alben/Eros Ramazzotti - Live/01 - Io Amerò.mp3
21:01:43 T:3047446336 M:1821429760   DEBUG: Updating visualisation albumart: /home/xbmc/.xbmc/userdata/Thumbnails/Music/f/f3d4e815.tbn
21:02:10 T:2905246576 M:1815236608   DEBUG: Thread 2905246576 terminating (autodelete)
21:02:10 T:2840169328 M:1815130112   DEBUG: Thread 2840169328 terminating (autodelete)
21:04:20 T:2950601584 M:1782669312   DEBUG: CAnnouncementManager - Announcement: QueueNextItem from xbmc
21:04:25 T:2950601584 M:1781391360    INFO: CAudioDecoder::GetData() ending track - only have 3048 samples left
21:04:25 T:2950601584 M:1781391360    INFO: PAPlayer: End of playback reached
21:04:25 T:2950601584 M:1781391360   DEBUG: CAnnouncementManager - Announcement: PlaybackEnded from xbmc
21:04:25 T:2950601584 M:1781391360   DEBUG: PAPlayer: Thread end
21:04:25 T:2950601584 M:1781391360   DEBUG: Thread 2950601584 terminating

... Yes, according to Xorg.0.log.old, the GPU was hanging:

Code:
[    17.943] (II) intel(0): Modeline "1920x1080"x0.0   74.25  1920 2448 2492 2640  1080 1084 1089 1125 +hsync +vsync (28.1 kHz)
[    17.943] (II) intel(0): Modeline "720x480"x0.0   27.00  720 736 798 858  480 489 495 525 -hsync -vsync (31.5 kHz)
[    17.943] (II) intel(0): Modeline "1440x288"x0.0   27.00  1440 1464 1590 1728  288 290 293 312 -hsync -vsync (15.6 kHz)
[    17.943] (II) intel(0): Modeline "1440x240"x0.0   27.00  1440 1478 1602 1716  240 244 247 262 -hsync -vsync (15.7 kHz)
[   394.660] (EE) intel(0): Failed to submit batch buffer, expect rendering corruption or even a frozen display: Device or resource busy.
[   397.668] (EE) intel(0): Failed to submit batch buffer, expect rendering corruption or even a frozen display: Device or resource busy.
[   400.676] (EE) intel(0): Failed to submit batch buffer, expect rendering corruption or even a frozen display: Device or resource busy.
[   400.692] (EE) intel(0): Detected a hung GPU, disabling acceleration.

alanwww1 Wrote:Also can you try suspend. It probably won't work form xbmc but from terminal you can try sudo pm-suspend.

pm-suspend sends the machine to sleep. But it took me 3 attempts, including 2 times cutting power, to get the machine come back up again - of course, as a new boot. So all in all, I would still consider this "not working".

alanwww1 Wrote:The shutdown behavior is expected and comes from the startup script i use. you can change that. I did it in case xbmc quits for some reason that it can start again.

Where would I need to look for this? /usr/bin/runXBMC looks as if it would create an .xsession which should create a '/tmp/noRestartXBMC' in case no restart is wanted... All I'm looking for is the behavior controlled from XBMC's menus. If it's crashing, well... then it's crashing. Smile

alanwww1 Wrote:Do you have the ocasional boot to black screen problem i have ?

Not sure... I may have just had that, but it may also have been simply because the HDMI cable was not plugged in when I started the machine.

alanwww1 Wrote:Is Multichannel lpcm working for you with
Code:
speaker-test -Dhdmi -c6

I'm not using sound via HDMI, but via SPDIF. That seems(!) to be working ok.


- Hammi - 2011-03-14 09:02

Just a quick update: I watched a movie, and saw (after the initial frame drops when starting the move) no framedrops. Although I had deinterlacing turned on ("Auto"), CPU load was still around 10%. There was also no crash or anything (noticeable) wrong with the video driver.

The only exception is: Crushed blacks. There is no conversion or anything comparable in XBMC or the driver to compensate for this, like there is for nVidia? Does anybody know if there are any plans to implement this?

Because of the GPU freeze with projectM (mentioned in my post above) and the hanging system when playing audio CDs (which, I think, also occurred when I did not have projectM activated), I'll try the 10.10 + 2.6.37 kernel from mainline + xorg-edgers + jools-ppa approach for Sandy Bridge as well (once I find the time to).

Will report back how that goes.


- Percius - 2011-03-14 20:46

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 00:40

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 01:22

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 12:27

@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 14:08

@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