• 1
  • 14
  • 15
  • 16(current)
  • 17
  • 18
  • 19
[LINUX] HOW-TO use VAAPI HW Acceleration in Intel Core i3 / i5 / i7 integrated GPU
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.
Reply
Great Thanks, I ended up using a version of OpenElec, it worked just like a live cd but with VAAPI already included.
Reply
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?
Reply
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 ?
Reply
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?
Reply
Krautmaster Wrote:hmi cannot build libva with my clarkdale any more...

ideas?

Code:
sudo apt-get install libpciaccess-dev libpciaccess0
Reply
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.
Reply
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?
Reply
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
Reply
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.
Reply
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.
Reply
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.
Reply
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.
Reply
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.
Reply
Any idea? Huh
Reply
  • 1
  • 14
  • 15
  • 16(current)
  • 17
  • 18
  • 19

Logout Mark Read Team Forum Stats Members Help
[LINUX] HOW-TO use VAAPI HW Acceleration in Intel Core i3 / i5 / i7 integrated GPU4