[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
arnoo Offline
Junior Member
Posts: 4
Joined: May 2011
Reputation: 0
Post: #231
Krautmaster Wrote:hmi cannot build libva with my clarkdale any more...

ideas?

Code:
sudo apt-get install libpciaccess-dev libpciaccess0
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #232
After a lot of testing by reinstalling some packages, trying libva git, reinstalling xbmc again and again to the latests revisions... I'm still getting the same thing as here. Is there something wrong in my setup or is xbmc's vaapi support broken ?

Also, now I'm getting many segfaults since the revision where the skin changed to an horizontal bar... I think it's related to mysql's support for the video database (I tried with a new system user and had no problem until I put the mysql videodatabase configuration). I'll start a thread for that specific problem.
find quote
gven Offline
Junior Member
Posts: 17
Joined: May 2011
Reputation: 0
Post: #233
alexb38 Wrote:After a lot of testing by reinstalling some packages, trying libva git, reinstalling xbmc again and again to the latests revisions... I'm still getting the same thing as here. Is there something wrong in my setup or is xbmc's vaapi support broken ?

Also, now I'm getting many segfaults since the revision where the skin changed to an horizontal bar... I think it's related to mysql's support for the video database (I tried with a new system user and had no problem until I put the mysql videodatabase configuration). I'll start a thread for that specific problem.

I did get XBMC 11 compile from latest yesterday to work well with VAAPI, so VAAPI support is NOT broken. I do have the same problems with segfaults as in your second paragraphs but that is independent of using VAAPI for playback.

Your symptoms are exactly what happens with XBMC 10.1 for me but XBMC 11 works fine for VAAPI. So not sure where the problem is.

A couple of things to try.

First disable VAAPI in the xbmc settings and make sure XBMC is able to play the video properly in your 11 build. If not, it may indicate some other problems.

Next turn the VAAPI settings on and quit. Move vainfo to a temporary directory so XBMC cannot find it (I think XBMC uses this to check for VAAPI availability, at least XBMC 10 did, not sure of 11) and see if XBMC is able to play the video but without VAAPI.

If XBMC passes the above two tests, then it should have eliminated any problem with XBMC and point to problems with your driver stack.

What does your vainfo output say?
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #234
Thanks for your reply.

I already tested playing videos without VAAPI activated in XBMC, it works well. You can see my post in the previous page of this thread for more details on my setup and some logs.

I tried what you said : activated VAAPI, stop XBMC, renamed vaapi, started XBMC and tried a video in HD -> still the same problem (black video behind XBMC interface, sound playing and if I press X then XBMC freezes and I have to do killall -9 xbmc.bin). Also, with vainfo renamed, XBMC still proposes VAAPI in the options.

Here is the output of vainfo :
Code:
libva: libva version 0.32.0
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib64/dri/i965_drv_video.so
libva: va_openDriver() returns 0
vatmp: VA API version: 0.32
vatmp: Driver version: i965 Driver 0.1
vatmp: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Baseline           : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
(This post was last modified: 2011-05-31 11:36 by alexb38.)
find quote
gven Offline
Junior Member
Posts: 17
Joined: May 2011
Reputation: 0
Post: #235
VAINFO looks fine. Since XBMC 11 latest build works for me with VAAPI, the problem can only be in the libraries being linked to. One of the things I did to verify that my driver stack was working for VAAPI was to run vlc and enable hardware acceleration. I have described that process in my post towards the end of the parallel thread on HW acceleration for Sandy Bridge. See first if VLC is able to play the same source in your current stack and check with CPU usage. VLC has two settings, one for direct rendering which provides the biggest bang for the buck and another for using graphics hardware (may still be labeled experimental). It is the latter that refers to VAAPI. See what happens with the combination of those settings. If VLC is able to play fine with all combinations of those settings and you notice the settings making a difference in CPU load, then your driver stack is fine. That isolates the problem entirely to your xbmc 11 build. Hope that helps.
find quote
kaayman Offline
Junior Member
Posts: 5
Joined: Jun 2011
Reputation: 0
Post: #236
First of all i would like to thank the topic starter for writing this clear instruction to get vaapi working. It was very entertaining and learned a lot from it.

Today i upgraded my ubuntu (11.04) with a va-api compatible xbmc. Very nice.

I had one problem with compiling the xbmc sources. I had to download and install python-dev using the following command: sudo apt-get python-dev.

For some reason that was missing. Perhaps it has something to do with the ubuntu version used. It is a 32 bit desktop version of 11.04.
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #237
gven Wrote:VAINFO looks fine. Since XBMC 11 latest build works for me with VAAPI, the problem can only be in the libraries being linked to. One of the things I did to verify that my driver stack was working for VAAPI was to run vlc and enable hardware acceleration. I have described that process in my post towards the end of the parallel thread on HW acceleration for Sandy Bridge. See first if VLC is able to play the same source in your current stack and check with CPU usage. VLC has two settings, one for direct rendering which provides the biggest bang for the buck and another for using graphics hardware (may still be labeled experimental). It is the latter that refers to VAAPI. See what happens with the combination of those settings. If VLC is able to play fine with all combinations of those settings and you notice the settings making a difference in CPU load, then your driver stack is fine. That isolates the problem entirely to your xbmc 11 build. Hope that helps.

Thanks! Looks like it's a XBMC related problem, because I tried with VLC and it works fine when I activate "hardware acceleration" (cpu usage goes from 50-60% in standard mode to 20-25% with vaapi while playing a x264 file in 1080p).

I have external-libraries activated in XBMC, perhaps the problem is here ? But I didn't change any compilation option since the time it worked for me.
find quote
gven Offline
Junior Member
Posts: 17
Joined: May 2011
Reputation: 0
Post: #238
alexb38 Wrote:Thanks! Looks like it's a XBMC related problem, because I tried with VLC and it works fine when I activate "hardware acceleration" (cpu usage goes from 50-60% in standard mode to 20-25% with vaapi while playing a x264 file in 1080p).

I have external-libraries activated in XBMC, perhaps the problem is here ? But I didn't change any compilation option since the time it worked for me.

Just to be sure, did you see the CPU load drop when you checked the "Accelerated video output (Overlay)" in the Video section of VLC preferences or "Use GPU acceleration (experimental) in the Input & Codecs section? Like in typical linux freeware tradition, the wordings are ambiguous and confusing unless you are an expert and/or know exactly the developer mindset (rather than a typical user mindset).

The first option should result in a huge CPU load drop but this has nothing to do with chip enabled decoding. The second one is the one that benefits from VAAPI. Depending on the power of the CPU, use of VAAPI may actually see an increase in CPU usage when that is enabled in VLC. This is because, VLC uses hardware decoding on the chip and gets the output back to itself on which it apples post-processing filters. This may increase the reported CPU usage.

With Intel i7 2600k on my system, VLC CPU usage increases with VAAPI (Use GPU acceleration) slightly while Xorg CPU usage goes down. That is how I know VAAPI is being used. But it is the first option above that significantly reduces the CPU usage.
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #239
Ok, yes I used the good option "Use GPU acceleration (experimental)" just under /dev/dvd in "input & codecs".

Here we can see that VLC is really using VAAPI :
Code:
libva: libva version 0.32.0
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib64/dri/i965_drv_video.so
libva: va_openDriver() returns 0
[0x1f60f60] avcodec decoder: Using VA API version 0.32 for hardware decoding.
(This post was last modified: 2011-06-06 02:36 by alexb38.)
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #240
Any idea? Confused
find quote
Post Reply