[LINUX] HOW-TO use VAAPI HW Acceleration in Intel Core i3 / i5 / i7 integrated GPU

  Thread Rating:
  • 4 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
BoBeRzE Offline
Junior Member
Posts: 36
Joined: Jun 2010
Reputation: 0
Post: #31
Hi all,

to VC-1 decode:

Good to hear whats no fault on my config Smile

To autoframerate "FIX"

i set up my minimal (ubuntu 10.10) installation as as follows:

1. follow the greate guide from alanwww1
1.1 i just run make with the parameter -j 5. Whis decrease the compile-time frome 17 to ~7 minutes

2. setup Autologon

Code:
sudo nano /etc/init/tty1.conf

Change the line

Code:
exec /sbin/getty 38400 tty1

to (change xbmc to your username)
Code:
exec /bin/login -f xbmc < /dev/tty1 > /dev/tty1 2>&1

To clear the screen and start X we craete a file named .bash_profile:

Code:
nano ~/.bash_profile

And add these lines to the file:

Code:
case "`tty`" in
/dev/tty1) clear && startx &>/dev/null;;
esac

For autostart XBMC with our custom resolution we need .xinitrc
Code:
nano ~/.xinitrc

And add these lines to the file: (it could be what you need other Modlines for your TV)

Code:
exec xrandr --newmode "1920x1080_24" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
exec xrandr --addmode HDMI1 1920x1080_24
exec xrandr --newmode "1920x1080_23.976" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
exec xrandr --addmode HDMI1 1920x1080_23.976
exec xrandr --newmode "1920x1080_59.94" 148.350 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
exec xrandr --addmode HDMI1 1920x1080_59.94
exec xrandr --newmode "1920x1080_29.97" 74.175 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
exec xrandr --addmode HDMI1 1920x1080_29.97
exec xbmc --standalone

In my case i have a fast booting XBMC Machine with the following framerates:

60hz, 59.94hz, 50hz, 29.97hz, 24hz and the best Smile 23.976hz (50hz and 60hz comes frome x directly)

Now i have to set up a virtual machine for win7 with KVM, but waths aonther topic.

i hope its all correct (im a linux newbee) and could help a few other peoples Smile
find quote
alanwww1 Offline
Team-Kodi Member
Posts: 1,365
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #32
@BoBeRzE

Big Grin Thanks for the pretty good solution. Now one of the problems we have is solved. I will edit the first page so that people following the guide could know about it. I still want to find a solution though, with plain xorg.conf which would be a little bit more elegant.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Dogan Offline
Junior Member
Posts: 10
Joined: Dec 2010
Reputation: 0
Post: #33
Hi Alan,

Thanks for the reply. I tried to run the line you suggested
"sudo apt-get install libva1 vainfo i965-va-driver libva-glx1 libva-dev"
It did actually say it is installing etc. BUT now vainfo reports back:

ahmet@fipc2:~$ vainfo
libva: libva version 0.31.1
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/psb_drv_video.so
libva: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

I am sure it was giving good results when I tried this the first time. But it failed during bootstrap as I post it initially. Maybe I missed something and the initial driver was still working which I installed when I first setup Ubuntu via :

$sudo add-apt-repository ppa:gma500/ppa
$sudo apt-get update
$sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config

I tried a clean install twice the last two days, but get the same problem with vainfo. I could not go back how I managed to pass vainfo...

Any thoughts?
find quote
alanwww1 Offline
Team-Kodi Member
Posts: 1,365
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #34
Dogan Wrote:$sudo add-apt-repository ppa:gma500/ppa
$sudo apt-get update
$sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config

Sorry mate, but you have some nice competition between the gma500 ppa and the Ubuntu Xorg-Edgers ppa. I am not familiar with the Poulsbo drivers, but if it is in the new Xorg drivers or Kernel you won't need the gma500 ppa at all. You would only need the xorg edgers ppa. But as i said i don't really know if these drivers are living in the kernel or not.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
alanwww1 Offline
Team-Kodi Member
Posts: 1,365
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #35
Guys, i have good news !

I made a test with today's Xorg-Edgers ppa drivers and the Bicubic, Lanczos shader based upscalers seem to work perfect now. No more signs of any artifacts.

Could you please test that they are working on your system ?

Thx,

Alan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
alanwww1 Offline
Team-Kodi Member
Posts: 1,365
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #36
Problemms are getting solved fast:
With new drivers:

- Shader based upscaling works perfectly.
- Multichannel LPCM sound over hdmi works perfectly, with correct channel mapping
- Adjust refresh rate works if smoothvideo is not activated

For more info, check my first post where i updated and extended the guide.

I need confirmation that smoothvideo is not working WITH adjust refresh rate.

For me refresh rate gets changed (I can see when i press "Y") but when i press "O" the previous refersh rate gets written out and i have thousand of sync errors. After that xbmc crashes. If smoothvideo is not activated, everything is fine.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Dogan Offline
Junior Member
Posts: 10
Joined: Dec 2010
Reputation: 0
Post: #37
Hi Alan,

Thanks for the feedback, makes sense. I will play around see if I can your instructions to work with gma500. Do you know if vaapi is enabled in Dharma 10.0 at default installation, or do we have compile with it vaapi support? The version history is not clear, it only says that vaspi is supported with appropriate hw and drivers. But I cannot see the vaapi selection under video settings at my default installation which makes me think it is supported but not included at default. Am I right?
(This post was last modified: 2010-12-23 01:06 by Dogan.)
find quote
bustamelon Offline
Junior Member
Posts: 43
Joined: Dec 2010
Reputation: 0
Location: CT, USA
Post: #38
Dogan Wrote:Hi Alan,

Thanks for the feedback, makes sense. I will play around see if I can your instructions to work with gma500. Do you know if vaapi is enabled in Dharma 10.0 at default installation, or do we have compile with it vaapi support? The version history is not clear, it only says that vaspi is supported with appropriate hw and drivers. But I cannot see the vaapi selection under video settings at my default installation which makes me think it is supported but not included at default. Am I right?

Wondering the same thing here. No clear info on this anywhere that I've seen.
find quote
alanwww1 Offline
Team-Kodi Member
Posts: 1,365
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #39
Not sure. What is sure is that it is supported, and you ca compile a Dharma build insted of trunk, but on the ppa the build is not compiled with vaapi enabled. You can compile a Dharma version if you change these lines in my guide:

Code:
svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/tags/10.0-Dharma xbmc-dharma
cd xbmc-dharma

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
thaughbaer Offline
Junior Member
Posts: 18
Joined: Sep 2010
Reputation: 0
Post: #40
bustamelon Wrote:Wondering the same thing here. No clear info on this anywhere that I've seen.

It's not there. You have to roll your own.

Mike
find quote
Dogan Offline
Junior Member
Posts: 10
Joined: Dec 2010
Reputation: 0
Post: #41
Hi Alan,

I was able to load all necessary libraries and compile XBMC Dharma with vaapi support. At least I can see the vaapi selection under video playback setting for the first time. However when I try to run a video, the screen is just black. I can hear the sound, and even the subtitles are working but no video. I am stuck. As soon as I disable vaapi under video playback setting I can see the video as well but it is choppy as it used to be. Any ideas where to look?
Cheers,
find quote
alanwww1 Offline
Team-Kodi Member
Posts: 1,365
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #42
Hi Dogan !

Again, the guide is tested and made for Coreix GPUs. GMA500 with the pulsbo driver is a complete different architecture. Sorry but i ca not help you further from here because i don't have the hw.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
magnimus Offline
Junior Member
Posts: 25
Joined: Dec 2010
Reputation: 0
Post: #43
Dogan Wrote:Hi Alan,

I was able to load all necessary libraries and compile XBMC Dharma with vaapi support. At least I can see the vaapi selection under video playback setting for the first time. However when I try to run a video, the screen is just black. I can hear the sound, and even the subtitles are working but no video. I am stuck. As soon as I disable vaapi under video playback setting I can see the video as well but it is choppy as it used to be. Any ideas where to look?
Cheers,

you need kernel 2.6.35+
find quote
h3rr3gud Offline
Junior Member
Posts: 5
Joined: Jan 2009
Reputation: 0
Post: #44
I followed this guide except for the SVN install of XBMC.
Vainfo displays exactly the information i wanted but my Xorg.0.log is flooded with the these lines:

[ 11567.552] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577437 < target_msc 577438
[ 11567.572] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577438 < target_msc 577439
[ 11567.592] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577439 < target_msc 577440
[ 11567.612] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577440 < target_msc 577441
[ 11567.632] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577441 < target_msc 577442
[ 11567.652] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577442 < target_msc 577443
[ 11567.672] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577443 < target_msc 577444
[ 11567.692] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577444 < target_msc 577445
[ 11567.712] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577445 < target_msc 577446
[ 11567.732] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577446 < target_msc 577447
[ 11567.752] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577447 < target_msc 577448
[ 11567.772] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577448 < target_msc 577449
[ 11567.792] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577449 < target_msc 577450
[ 11567.812] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577450 < target_msc 577451
[ 11567.832] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577451 < target_msc 577452
[ 11567.852] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577452 < target_msc 577453
[ 11567.872] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577453 < target_msc 577454
[ 11567.892] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577454 < target_msc 577455
[ 11567.912] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577455 < target_msc 577456
[ 11567.932] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577456 < target_msc 577457

After some hours the log file has reached 300MB!

I created a bug report here: https://bugs.freedesktop.org/show_bug.cgi?id=32680

But this might just as well be a configuration or install error I have made...

Any advise?



libva: libva version 0.31.1
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/i965_drv_video.so
libva: va_openDriver() returns 0
vainfo: VA API version: 0.31
vainfo: Driver version: i965 Driver 0.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Baseline : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
find quote
alanwww1 Offline
Team-Kodi Member
Posts: 1,365
Joined: Nov 2008
Reputation: 33
Location: Hungary
Post: #45
h3rr3gud Wrote:my Xorg.0.log is flooded with the these lines:
[ 11567.552] (WW) intel(0): I830DRI2FlipEventHandler: Pageflip completion has impossible msc 577437 < target_msc 577438

I have no idea. This should be some driver problem.

Anyway i have good news. There might be a solution for stuttering of VAAPI played x264 files with high reference frame count. Increasing the available surfaces in VAAPI.cpp solves the problem for me. Just check my first post. I updated the guide.

Please test for yourselves. I need feedback. Also AMD users are welcome to test.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Post Reply