I am using Nvidia Optimus = Intel + Nvidia. As no one on Gentoo forum doesn't know how to use vdpau with Optimus system, so I have to use just Intel card. The problem is on Intel card I do not have such tool like nvidia-setting and very useful option for watching video - Sync to VBlank. Fortunatley on Wiki Arch I have found this article:
https://wiki.archlinux.org/index.php/Intel

If you want to enable hardware accelerated video decode/encode in multimedia applications (such as VLC or MPlayer) for Intel HD graphics controllers (G45, Sandybridge), install the libva-driver-intel package, available in the Official Repositories.

To take advantage of VA-API, use a VAAPI supported video player. If you use mplayer, install mplayer-vaapi, and use -vo vaapi parameter. To enable hardware video decoding in flash, add EnableLinuxHWVideoDecode=1 to
/etc/adobe/mms.cfg. If hardware video decoding is still not working, you can also try adding
OverrideGPUValidation = 1.

Unfortunatley I can not find mplayer-vaapi for Gentoo, so I hope maybe XBMC will better than Mplayer/Mplayer2, as there is possible to compile with vaapi flag. I will let you know...

I'm having the same issue as you. Video works fine without the vaapi flag set in xbmc. If xbmc is emerged with the vaapi flag, xbmc crashes as soon as I play a video (I've tried only x264 hd videos). I've read many forum articles, tried several different things, can't seem to get it to work.

Recently got mplayer-vaapi working on my brand spankin' new Sager 6165NP (Ivy Bridge / nVidia 650M) following the instructions of the above article. But I found the LibVA and Intel G45 steps were unnecessary, and a simple:

...was sufficient to have a working mplayer-vaapi. You may want to ~arch the intel and libva just in case however. You must run autoconf after the git branch is pulled or the vaapi codecs won't get built at all, and you must run

Code:

mplayer -vo vaapi -va vaapi

... to make it work.

Now if only I had a working GeForce 650M to go with it

Last edited by a7thson on Thu May 31, 2012 10:50 pm; edited 1 time in total

That helped to make mplayer with vaapi support.
It plays well but I cannot make smplayer use it in the right way. As soon as I switch to vaapi output in smpalyer it starts crashing with the following message:

MPlayer SVN-r34578-4.6.3 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Terminal type `unknown' is not defined.

MPlayer interrupted by signal 11 in module: decode video
ID_SIGNAL=11
- MPlayer crashed by bad usage of CPU/FPU/RAM.
Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it's MPlayer's fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
won't help unless you provide this information when reporting a possible bug.

I'll try to fix that and use mplayer until xbmc gets proper vaapi support._________________gentoo user

I'll try to fix that and use mplayer until xbmc gets proper vaapi support.

I had no luck with smplayer either; luckily you should be able to wire up an external player in xbmc pretty easily, though it does mean you lose the xbmc controls, if your setup is configured to work with a joystick or IR remote etc, you will fall back to the mplayer configuration when playing movies. There's a lot of crap in that command line invocation of mplayer so I guess we should not be surprised that something is screwing it up.

You could try removing bits and pieces of that command line, running it directly and see what you get. Strip it to the essentials first (vo, va, ao), no filters or postproc or slave-mode or identify or ... etc ... and see if you can stumble on what's breaking it.

I managed to get XBMC to work with vaapi, even though it's not an "ideal" solution, but it seems to work great. Basically all you have to do is have XBMC use its internal libraries, which is done by modifying its ebuild ( /usr/portage/media-tv/xbmc/xbmc-9999.ebuild ).

Open it up in an editor, find the line "--enable-external-libraries \" and comment it out (#--enable-external-libraries \).

[update]
after couple of recompilation and reconfiguration of audio settings in xbmc, finally I got both vaapi and sound!
to be honest, right now I have no idea what was wrong. maybe new libva ( 1.1.0 ) and libva-intel driver ( 1.0.18 ) I recompiled in meanwhile helped too, but for sure I'll not touch anything:
libva-1.1.0
libva-intel-driver-1.0.18
xbmc-11.0 with "enable-external-libraries" commented out

as the result I have completely glichless and tearingless reproduction. that was a little bit different with vaapi enabled mplayer.

With XBMC 12 they introduced HD audio, which benefits many people greatly. Also, sound was actually a lot easier to set up for me in XBMC 12 (I get audio from the HDMI port). With XBMC 11 I had to create a custom profile and tell XBMC where to get the audio (hw:1,3). With XBMC, all I had to do is select the HDMI port which is recognized correctly, set up the options correctly (make sure your audio player, be it a TV or a home theater system supports all the options you are setting. For example I personally had to disable DTS-HD). One option I had to disable to make sound work in the menus was "Enable stereo output on all speakers" (or something along those line, I'm not at home right now, can't check). After that everything works smoothly, I am really happy about the results.

Of course, if everything works as expected with XBMC 11, it's probably better to stay there for you. A lot of add-ons don't work on XBMC 12, and since it is still in development, it has not been optimized yet.

Btw, mplayer vaapi support relies on a custom ebuild, or the current mplayer 1 ebuild will work fine? I have a core i3 with HD3000 and it lags more on Linux than my old core 2 duo (although it has a decent gpu).

I managed to get XBMC to work with vaapi, even though it's not an "ideal" solution, but it seems to work great. Basically all you have to do is have XBMC use its internal libraries, which is done by modifying its ebuild ( /usr/portage/media-tv/xbmc/xbmc-9999.ebuild ).

Open it up in an editor, find the line "--enable-external-libraries \" and comment it out (#--enable-external-libraries \).

Recently got mplayer-vaapi working on my brand spankin' new Sager 6165NP (Ivy Bridge / nVidia 650M) following the instructions of the above article. But I found the LibVA and Intel G45 steps were unnecessary, and a simple:

...was sufficient to have a working mplayer-vaapi. You may want to ~arch the intel and libva just in case however. You must run autoconf after the git branch is pulled or the vaapi codecs won't get built at all, and you must run

Code:

mplayer -vo vaapi -va vaapi

... to make it work.

Will these instructions be enough to install mplayer-vaapi without harming the whole system? Will I have to remove mplayer2?
What do you mean by "running autoconf after the git branch is pulled"?

Thanks and sorry for the crossposting in a similar thread around here.

Recently got mplayer-vaapi working on my brand spankin' new Sager 6165NP (Ivy Bridge / nVidia 650M) following the instructions of the above article. But I found the LibVA and Intel G45 steps were unnecessary, and a simple:

...was sufficient to have a working mplayer-vaapi. You may want to ~arch the intel and libva just in case however. You must run autoconf after the git branch is pulled or the vaapi codecs won't get built at all, and you must run

Code:

mplayer -vo vaapi -va vaapi

... to make it work.

Will these instructions be enough to install mplayer-vaapi without harming the whole system? Will I have to remove mplayer2?
What do you mean by "running autoconf after the git branch is pulled"?

Thanks and sorry for the crossposting in a similar thread around here.

Without a working ebuild, I think this's a very bad idea. That's why I didn't do it. Also the project is not that active; someone has to add VA API to the official Mplayer.

I had to compile ffmpeg too, i was asked to do so. All the executables went in that directory, /usr/local remained empty.
No make install and also this is false in my experience

Quote:

You must run autoconf after the git branch is pulled or the vaapi codecs won't get built at all

All seems to work fine, i'm getting hw video acceleration! I've also run emerge --sync and emerge -avDu world to see if something was messed up but it wasn't.

I run it with

Code:

mplayer-vaapi -vo vaapi -va vaapi

but what does the -va option do? I can't find it in the manual while instead mplayer-vaapi -vo help shows all the available video output options.

The vaapi implementation is not meged in the mplayer2 project because "the vaapi implementation sucks" and i guess the mplayer2 aims at good quality of code. The original mplayer project is not that active.

A solution would to write an ebuild for gentoo that pulls the sources from the git site of mplayer-vaapi. Anyone willing to do that, I could help but i'm not an expert at all.