[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
HarryRosen Offline
Senior Member
Posts: 254
Joined: Dec 2009
Reputation: 0
Post: #221
I have tried this guide so many times, I have no idea why I can't get it to work properly, Everything seems fine until I try and compile xbmc, Is it possible to install the live version and then recompile in the VAAPI?
find quote
margante Offline
Junior Member
Posts: 3
Joined: Apr 2011
Reputation: 0
Post: #222
HarryRosen Wrote:I have tried this guide so many times, I have no idea why I can't get it to work properly, Everything seems fine until I try and compile xbmc, Is it possible to install the live version and then recompile in the VAAPI?

I felt your pain...for three days I have been trying to work through this guide and I was about to give up. I was stuck at the same point you were. I could not compile the xbmc. It was giving me an error about not being able to find a directory related to python. I searched Google and finally found an answer that worked so I will share with you everything I did. Warning I am not an expert and I may not have done everything perfect but in the end it worked

I started out by installing the Maverick mini version of Unbuntu and the only option I selected that was not the default was the "OpenSSH server" option. From there I followed alanwww1 instructions with a few minor changes which I will detail below:

No changes from what he listed here:

Code:
sudo apt-get update
sudo apt-get install udisks upower xorg alsa-utils mesa-utils
sudo adduser YourUserName video
sudo adduser YourUserName audio
sudo reboot

I replaced this line "sudo apt-get install libva1 vainfo i965-va-driver libva-glx1 libva-dev" he originally had with this line "sudo apt-get install libdrm2 libva1 i965-va-driver vainfo" that I found in a reply in this thread. See Below:

Code:
sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libdrm2 libva1 i965-va-driver vainfo
sudo reboot

I couldn't get it to compile xbmc correctly later on due to a python error and libva missing so I had to add "python2.6-dev" to the list below and also "libva-dev". I also added the "smbfs" and "smbclient" variables so that I could connect to the drives on my windows network through the windows smbclient.

Code:
sudo apt-get install git-core make g++ gcc gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxtst-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmms-dev libmpeg3-dev libfaad-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libwavpack-dev libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs autopoint dh-autoreconf python2.6-dev libva-dev smbfs smbclient

From here on everything is the same as the first page:

Code:
cd ~
git clone git://git.videolan.org/libbluray.git
cd libbluray/
./bootstrap
./configure --prefix=/usr
make
sudo make install

cd ~
git clone git://github.com/xbmc/xbmc.git
cd xbmc
./bootstrap
./configure --prefix=/usr --enable-vaapi --enable-libbluray

wget http://paste.kde.org/7020/raw/ -O ./ReferenceClockHang.patch
patch -p1 < ./ReferenceClockHang.patch

make
sudo make install
sudo ln -s /usr/lib/libva.so.1 /usr/lib/libva-0.31.1.1.so.1
sudo ln -s /usr/lib/libva-glx.so.1 /usr/lib/libva-glx-0.31.1.1.so.1

At this point I was able to run a startx session and run xbmc using the command:

Code:
exec  xbmc  --standalone

It is still not perfect. I still have to change a few things to make it boot into xbmc instead of a command line but it feels great to know that I can get to xbmc and my movies run smoothly. I hope this helps. Thanks alanwww1 for the great starting point.
find quote
HarryRosen Offline
Senior Member
Posts: 254
Joined: Dec 2009
Reputation: 0
Post: #223
Thanks will give it a shot today
find quote
HarryRosen Offline
Senior Member
Posts: 254
Joined: Dec 2009
Reputation: 0
Post: #224
That worked great, just how do you get it to autostart into xbmc?
find quote
margante Offline
Junior Member
Posts: 3
Joined: Apr 2011
Reputation: 0
Post: #225
HarryRosen Wrote:That worked great, just how do you get it to autostart into xbmc?

Still working on that. I will post when I figure it out. I believe this is the answer here: http://forum.xbmc.org/showthread.php?tid=38473 but I have not been able to get the time to try it out.
find quote
margante Offline
Junior Member
Posts: 3
Joined: Apr 2011
Reputation: 0
Post: #226
HarryRosen Wrote:That worked great, just how do you get it to autostart into xbmc?

I got my XBMC to autostart by following the link I posted earlier (http://forum.xbmc.org/showthread.php?tid=38473). However, there were a few differences. When I installed rcconf there was no gdm to turn off. In the end I don't think it hurt anything because it still worked but what do I know.

Also the tty directory /etc/events.d/tty1 has changed to /etc/init/tty1.conf From there on everything else is the same.

Other than that being the noob that I am, I had trouble for a few minutes trying to figure out how to update a readonly file.
find quote
HarryRosen Offline
Senior Member
Posts: 254
Joined: Dec 2009
Reputation: 0
Post: #227
Great Thanks, I ended up using a version of OpenElec, it worked just like a live cd but with VAAPI already included.
find quote
tstack77 Offline
Member
Posts: 59
Joined: Oct 2008
Reputation: 0
Post: #228
alanwww1 Wrote:We have to wait for Intel and Xorg devs to solve the problems. Most of the problems will be solved in Natty final, but we have to see later.

Is it now known if natty final fixed all of the issues?
find quote
alexb38 Offline
Junior Member
Posts: 44
Joined: Nov 2010
Reputation: 0
Location: France
Post: #229
I'm experiencing a problem with VAAPI since sometime : when I activate VAAPI and play some x264 content, then XBMC freezes and I need to restart it.

Here is the setup I'm using :
- Intel Core i3 540, 4GB of memory, raid 5
- Gentoo Linux
- XBMC, built on May 23 2011 (Git:b30c4327399cdc53a2fd95ea98757754f950453a)
Installed versions: 9999{tbz2}(00:33:41 23/05/2011)(alsa bluray css pulseaudio rtmp sse sse2 vaapi webserver xrandr -altivec -avahi -debug -joystick -midi -profile -udev -vdpau)
- with external ffmpeg, built on May 23 2011 (git-N-30149-g458f20b)
Installed versions: 9999{tbz2}(00:12:19 23/05/2011)(3dnow 3dnowext X alsa bzip2 encode faac hardcoded-tables mmx mmxext mp3 network qt-faststart rtmp sdl ssse3 theora threads truetype vaapi vorbis vpx x264 xvid zlib -aac -altivec -amr -avx -bindist -celt -cpudetection -custom-cflags -debug -dirac -doc -frei0r -gsm -ieee1394 -jack -jpeg2k -oss -pic -schroedinger -speex -static-libs -test -v4l -v4l2 -vdpau -video_cards_nvidia)
- kernel 2.6.38-gentoo-r5-ipv6-64 (x86_64)
- xorg-server 1.10.1.901
- xf86-video-intel 2.15.0
- mesa 7.10.2-r1
- libdrm 2.4.25
- libva 1.0.12

I installed the packages specified for "Intel Graphics Package 2011Q1"

Here is the part of the log when playing a video in x264 : http://pastebin.com/rRUiQJCA

When I open the video, there's a black screen below the library view but nothing happens, no image and no sound.

At this point I pressed "X" (stop) and after that XBMC freezes :
Code:
23:43:12 T:140706974553984 M:3509981184   DEBUG: SDLKeyboard: scancode: cb, sym: 0139, unicode: 0000, modifier: 1000
23:43:12 T:140706974553984 M:3509981184   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
23:43:12 T:140706974553984 M:3509981184   DEBUG: Previous line repeats 3 times.
23:43:12 T:140706974553984 M:3509981184   DEBUG: OnKey: 0 (f200) pressed, action is
23:43:12 T:140706974553984 M:3509981184   DEBUG: SDLKeyboard: scancode: 35, sym: 0078, unicode: 0078, modifier: 5000
23:43:12 T:140706974553984 M:3509981184   DEBUG: OnKey: x (f058) pressed, action is Stop
23:43:12 T:140706974553984 M:3509981184  NOTICE: CDVDPlayer::CloseFile()
23:43:12 T:140706229430016 M:3509981184   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(32000,000000, 1)
23:43:12 T:140706229430016 M:3509981184   DEBUG: CDVDPlayerAudio:: Discontinuity - was:0,000000, should be:0,000000, error:0,000000
23:43:12 T:140706296469248 M:3509981184   DEBUG: CAnnouncementManager - Announcement: PlaybackSpeedChanged from xbmc
23:43:12 T:140706296469248 M:3509981184   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message PlaybackSpeedChanged
23:43:12 T:140706974553984 M:3509981184  NOTICE: DVDPlayer: waiting for threads to exit
23:43:12 T:140706296469248 M:3509981184  NOTICE: CDVDPlayer::OnExit()
23:43:12 T:140706296469248 M:3509981184  NOTICE: DVDPlayer: closing audio stream
23:43:12 T:140706296469248 M:3509981184  NOTICE: Closing audio stream
23:43:12 T:140706296469248 M:3509981184  NOTICE: Waiting for audio thread to exit
23:43:12 T:140706229430016 M:3509981184  NOTICE: thread end: CDVDPlayerAudio::OnExit()
23:43:12 T:140706229430016 M:3509981184   DEBUG: Thread CDVDPlayerAudio 140706229430016 terminating
23:43:12 T:140706296469248 M:3509981184  NOTICE: Closing audio device
23:43:12 T:140706296469248 M:3509981184   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
23:43:12 T:140706296469248 M:3509981184   DEBUG: RemoveActiveDevice - Removing device 2
23:43:12 T:140706296469248 M:3509981184   DEBUG: CGUIAudioManager::Initialize
23:43:12 T:140706296469248 M:3509981184  NOTICE: Deleting audio codec
23:43:12 T:140706296469248 M:3509981184  NOTICE: DVDPlayer: closing video stream
23:43:12 T:140706296469248 M:3509981184  NOTICE: Closing video stream
23:43:12 T:140706296469248 M:3509981184  NOTICE: waiting for video thread to exit

Here are the lines about graphics init at the start of the log :
Code:
00:45:39 T:140587379574656 M:3550851072 WARNING: VIDEO database configuration is experimental.
00:45:39 T:140587379574656 M:3550851072  NOTICE: Getting hardware information now...
00:45:39 T:140587379574656 M:3550851072  NOTICE: Checking resolution 12
00:45:39 T:140587379574656 M:3550851072  NOTICE: Default DVD Player: dvdplayer
00:45:39 T:140587379574656 M:3550851072  NOTICE: Default Video Player: dvdplayer
00:45:39 T:140587379574656 M:3550851072  NOTICE: Default Audio Player: paplayer
00:45:39 T:140587379574656 M:3550851072  NOTICE: Loading media sources from special://masterprofile/sources.xml
00:45:40 T:140587379574656 M:3546931200  NOTICE: Using visual 0x22
00:45:40 T:140587379574656 M:3544100864  NOTICE: GL_VENDOR = Tungsten Graphics, Inc
00:45:40 T:140587379574656 M:3544100864  NOTICE: GL_RENDERER = Mesa DRI Intel(R) Ironlake Desktop
00:45:40 T:140587379574656 M:3544100864  NOTICE: GL_VERSION = 2.1 Mesa 7.10.2
00:45:40 T:140587379574656 M:3544100864  NOTICE: GL_SHADING_LANGUAGE_VERSION = 1.20
00:45:40 T:140587379574656 M:3544100864  NOTICE: GL_EXTENSIONS = GL_ARB_copy_buffer GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_swizzle GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_logic_op GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_texture GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_gpu_program_parameters GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texture3D GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_texture GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_vertex_array_bgra GL_EXT_vertex_array GL_OES_EGL_image GL_OES_read_format GL_3DFX_texture_compression_FXT1 GL_APPLE_client_storage GL_APPLE_object_purgeable GL_APPLE_packed_pixels GL_APPLE_vertex_array_object GL_ATI_blend_equation_separate GL_ATI_envmap_bumpmap GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_IBM_multimode_draw_arrays GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_INGR_blend_func_separate GL_MESA_pack_invert GL_MESA_texture_signed_rgba GL_MESA_window_pos GL_MESA_ycbcr_texture GL_NV_blend_square GL_NV_depth_clamp GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_vertex_program1_1 GL_NV_vertex_program GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays
00:45:40 T:140587379574656 M:3544100864   ERROR: GLX: Same window as before, refreshing context

The output of vainfo :
Code:
$ DISPLAY=:1 vainfo
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
vainfo: VA API version: 0.32
vainfo: Driver version: i965 Driver 0.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Baseline           : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
EDIT: I might have an idea after trying vainfo... seems like X still uses the old version of libva.
EDIT2: or not, because in config.h of libva-1.0.12 there are lines like this : #define PACKAGE_STRING "libva 0.32.0"

The problem started a few months ago after updating some packages and XBMC.

It worked ok when I had the packages mentionned here : http://intellinuxgraphics.org/2010Q4.html and the latest XBMC from that time (I think xbmc still used subversion at this time).

When the VAAPI option isn't activated, everything works fine...

Does anyone have an idea on how to solve this problem ?
(This post was last modified: 2011-05-27 00:52 by alexb38.)
find quote
Krautmaster Offline
Senior Member
Posts: 198
Joined: Jul 2010
Reputation: 1
Post: #230
hmi cannot build libva with my clarkdale any more...

Quote:make[3]: Betrete Verzeichnis '/root/Builds/libva/test/encode'
CC avcenc.o
avcenc.c:19: fatal error: pciaccess.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
make[3]: *** [avcenc.o] Fehler 1
make[3]: Verlasse Verzeichnis '/root/Builds/libva/test/encode'
make[2]: *** [all-recursive] Fehler 1
make[2]: Verlasse Verzeichnis '/root/Builds/libva/test'
make[1]: *** [all-recursive] Fehler 1
make[1]: Verlasse Verzeichnis '/root/Builds/libva'
make: *** [all] Fehler 2
root@htpc:~/Builds/libva#

ideas?
find quote
Post Reply