[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
alanwww1 Offline
Team-XBMC Member
Posts: 1,299
Joined: Nov 2008
Reputation: 31
Location: Hungary
Post: #21
[quote=typhoe]
Code:
which mplayer
/usr/local/bin/mplayer
typhoe@ns10:~/gpu_accel/mplayer/mplayer-vaapi-20100713/mplayer-vaapi$ mplayer -vo vaapi /media/USB_HD_1To/tv_sample_720p.mkv

any idea what I missed?
[/quote]

I think you miss a few things :-)
First of all, be sure to use the vaapi enabled mplayer. If you executed sudo make install, you can normally use simply mplayer. But if you are in the build directory, be sure to use ./mplayer.

Also it is not enough to use -vo vaapi. You should use it like this (use the -va switch as well)

[CODE]./mplayer -vo vaapi -va vaapi moviename.mkv

I am really curious the results you have with mplayer. On my machine the files which are stuttering in xbmc, play well in mplayer.

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
typhoe Offline
Member+
Posts: 41
Joined: Jun 2008
Reputation: 0
Post: #22
alanwww1 Wrote:I think you miss a few things :-)
First of all, be sure to use the vaapi enabled mplayer. If you executed sudo make install, you can normally use simply mplayer. But if you are in the build directory, be sure to use ./mplayer.

Also it is not enough to use -vo vaapi. You should use it like this (use the -va switch as well)

Code:
./mplayer -vo vaapi -va vaapi moviename.mkv

I am really curious the results you have with mplayer. On my machine the files which are stuttering in xbmc, play well in mplayer.

Well, I used mplayer directly because I previously remove the ubuntu packaged mplayer (sudo apt-get remove mplayer) and installed the compiled mplayer using checkinstall (sudo checkinstall -D make install).
So trying to prefixe mplayer to launch the binary from the compilation directory does the same.
I tried the -va option too, no more results...

Code:
typhoe@ns10:~/gpu_accel/mplayer/mplayer-vaapi-20100713/mplayer-vaapi$ ./mplayer -vo vaapi -va vaapi -ao pulse /media/USB_HD_1To/sample_720p.mkv
MPlayer SVN-r31722-4.4.5 (C) 2000-2010 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.

Playing /media/USB_HD_1To/sample_720p.mkv.
libavformat file format detected.
[matroska @ 0x2056570] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: audio (ac3), -aid 0
[lavf] stream 1: video (h264), -vid 0
VIDEO:  [H264]  1280x720  0bpp  24.000 fps    0.0 kbps ( 0.0 kbyte/s)
Error opening/initializing the selected video_out (-vo) device.
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  20.2 (20.2) of 2464.2 (41:04.2) 27.0%


MPlayer interrupted by signal 2 in module: play_audio
A:  20.3 (20.2) of 2464.2 (41:04.2) 26.9%

Exiting... (Quit)
typhoe@ns10:~/gpu_accel/mplayer/mplayer-vaapi-20100713/mplayer-vaapi$

So... I really don't know...

XBMC Openelec Eden
Xtreamer Ultra + USB-CEC -> HDMI output to Onkyo TX-NR3008 and Sony KDL-52W5500
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,299
Joined: Nov 2008
Reputation: 31
Location: Hungary
Post: #23
typhoe Wrote:So... I really don't know...

I will go through my guide again regarding the mplayer part as well to check what i not included at the mplayer part.

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: #24
Hi Alan,

I tried your instructions on a FitPC Intel Atom processor with Intel GM500 graphic chip. I am very interested trying XBMC with vaapi, so your instructions are came in very handy... Especially considering I am new to Linux world Smile

Anyways, everything seemed to work smooth until bootstrap, where it complained like "configure: error: == Could not find libva. VAAPI support disabled. =="
I am attaching my terminal output. I had to cut some part out for the post to fit here.

Can you please check what might have gone wrong? What can I check to understand what is going on?
Thanks


.....
A xbmc/LICENSE.GPL
A xbmc/.dummy.am
A xbmc/.gitignore
A xbmc/xbmc-xrandr.c
A xbmc/README.ubuntu
U xbmc
Checked out revision 35636.
ahmet@fitpc:~$ cd xbmc
ahmet@fitpc:~/xbmc$ ./bootstrap
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.in: tracing
autoreconf: running: libtoolize --install --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
libtoolize: copying file `build-aux/config.guess'
libtoolize: copying file `build-aux/config.sub'
libtoolize: copying file `build-aux/install-sh'
libtoolize: copying file `build-aux/ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.in:10: installing `build-aux/missing'
autoreconf: Leaving directory `.'
autoreconf: Entering directory `lib/cpluff'
autoreconf: running: autopoint --force
Copying file ABOUT-NLS
.....
.....
configure: == GOOM disabled. ==
checking librtmp/log.h usability... no
checking librtmp/log.h presence... no
checking for librtmp/log.h... no
configure: == Could not find libRTMP. RTMP support disabled. ==
checking librtmp/amf.h usability... no
checking librtmp/amf.h presence... no
checking for librtmp/amf.h... no
checking librtmp/rtmp.h usability... no
checking librtmp/rtmp.h presence... no
checking for librtmp/rtmp.h... no
configure: == Use of external ffmpeg disabled. ==
configure: == Use of external liba52 disabled. ==
configure: == Use of external libdts disabled. ==
configure: == Use of external python disabled. ==
checking vdpau/vdpau.h usability... no
checking vdpau/vdpau.h presence... no
checking for vdpau/vdpau.h... no
== Could not find libvdpau. VDPAU support disabled. ==
checking for main in -lva... no
configure: error: == Could not find libva. VAAPI support disabled. ==
ahmet@fitpc:~/xbmc$ make
make: *** No targets specified and no makefile found. Stop.
ahmet@fitpc:~/xbmc$ sudo make install
[sudo] password for ahmet:
make: *** No rule to make target `install'. Stop.
ahmet@fitpc:~/xbmc$ sudo ln -s /usr/lib/libva.so.1 /usr/lib/libva-0.31.1.1.so.1
ln: creating symbolic link `/usr/lib/libva-0.31.1.1.so.1': File exists
ahmet@fitpc:~/xbmc$ sudo ln -s /usr/lib/libva-glx.so.1 /usr/lib/libva-glx-0.31.1.1.so.1
ln: creating symbolic link `/usr/lib/libva-glx-0.31.1.1.so.1': File exists
ahmet@fitpc:~/xbmc$ xbmc
No command 'xbmc' found, did you mean:
Command 'xsmc' from package 'xsmc-calc' (universe)
xbmc: command not found
...
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,299
Joined: Nov 2008
Reputation: 31
Location: Hungary
Post: #25
Dogan Wrote:Anyways, everything seemed to work smooth until bootstrap, where it complained like "configure: error: == Could not find libva. VAAPI support disabled. =="

Have you ran this line ?
Code:
sudo apt-get install libva1 vainfo i965-va-driver libva-glx1 libva-dev

Make sure you installed libva-dev !

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-XBMC Member
Posts: 1,299
Joined: Nov 2008
Reputation: 31
Location: Hungary
Post: #26
I filled in a bug report about Intel Linux drivers describing the problematic working of shader based HW upscaling on Linux drivers compared to the windows OpenGL drivers.

https://bugs.freedesktop.org/show_bug.cgi?id=32358

If anyone has any more info to add, please make it there.

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
Robotica Offline
Posting Freak
Posts: 928
Joined: Aug 2010
Reputation: 3
Post: #27
Great to see all your efforts Alan! I also found the ticket related to VAAPI: http://trac.xbmc.org/ticket/10865

Hopefullyu soon this will run Linux as smooth as Win so we have an extra and more powerfull alternative to ION.
find quote
surfriderbr Offline
Junior Member
Posts: 7
Joined: Aug 2010
Reputation: 0
Post: #28
I have similar problems...On XBMC I get a green screen with h264 files using VAAPI enable and on mplayer-vaapi I have:
Error opening/initializing the selected video_out (-vo) device.

Vainfo seems ok

mediacenter@mediacenter-desktop:~/mplayer-vaapi-20100713/mplayer-vaapi$ vainfo
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

I didn't notice any error on both compiles (XBMC and Mplayer).
find quote
BoBeRzE Offline
Junior Member
Posts: 15
Joined: Jun 2010
Reputation: 0
Smile  Auto Framerate switching is working Post: #29
Hello Core i Owner Big Grin

with

xrandr --newmode "1920x1080_23.976" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
xrandr --addmode HDMI1 1920x1080_23.976
xrandr --output HDMI1 --mode 1920x1080_23.976

i can activate 24p Mode for my TV. Auto Framerate switching is now working for me. Nod

But VAAPI HW Acceleration for VC-1 Codec is not working. It shows only dc:ff-vc-1 if i press o on my keyboard.

Sorry for my poor english Blush
find quote
alanwww1 Offline
Team-XBMC Member
Posts: 1,299
Joined: Nov 2008
Reputation: 31
Location: Hungary
Post: #30
BoBeRzE Wrote:xrandr --newmode "1920x1080_23.976" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
xrandr --addmode HDMI1 1920x1080_23.976
xrandr --output HDMI1 --mode 1920x1080_23.976

i can activate 24p Mode for my TV. Auto Framerate switching is now working for me. Nod

But VAAPI HW Acceleration for VC-1 Codec is not working. It shows only dc:ff-vc-1 if i press o on my keyboard.

Sorry for my poor english Blush

Hi BoBeRzE !

That is a great find. WOuld be good to find the xorg.conf equivalent of the above commands. What i don't understand is why manual modelines are not working in the xorg.conf. Maybe we have to specify those differently.

As i know vc-1 decode is not enabled in the Intel driver yet. I'd even be happy if x264 would work properly.

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