• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 11
[LINUX] HOW-TO use VAAPI HW Acceleration on new Intel Sandy Bridge platform
#76
Updated to the latest xorg-video-intel today, looks like it is broken:

Code:
[  3602.793] (II) intel(0): [DRI2] Setup complete
[  3602.793] (II) intel(0): [DRI2]   DRI driver: i965
[  3602.793] (II) intel(0): Allocated new frame buffer 1920x1080 stride 7680, tiled
[  3602.798]
Backtrace:
[  3602.798] 0: X (xorg_backtrace+0x26) [0x45d436]
[  3602.799] 1: X (0x400000+0x60e09) [0x460e09]
[  3602.799] 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7f1d84282000+0xfc60) [0x7f1d84291c60]
[  3602.799] 3: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f1d813da000+0xdd4d) [0x7f1d813e7d4d]
[  3602.799] 4: X (AddScreen+0x1a8) [0x42d9b8]
[  3602.799] 5: X (InitOutput+0x294) [0x46ebd4]
[  3602.799] 6: X (0x400000+0x213c3) [0x4213c3]
[  3602.799] 7: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xff) [0x7f1d831c3eff]
[  3602.799] 8: X (0x400000+0x21129) [0x421129]
[  3602.799] Segmentation fault at address 0xfffffffffff1cecc
[  3602.799]
Fatal server error:
[  3602.799] Caught signal 11 (Segmentation fault). Server aborting
[  3602.799]
[  3602.799]
Please consult the The X.Org Foundation support
     at http://wiki.x.org
for help.
[  3602.799] Please also check the log file at "/usr/var/log/Xorg.0.log" for additional information.
[  3602.799]

Still looking to find what causes it.

I also noticed that the libva patch is no longer needed.
Reply
#77
I got XBMC working again, but I am experiencing problems with video "lags". Once every 10 seconds or so, the video lags. This results in ~10 dropped frames, and out of sync audio.
The lags also occur in the menu, even without video playback.

However, when I display XBMC in windowed mode, rather then full screen, it runs perfectly. It played a 1080p movie completely with 0 dropped frames.

I don't use an xorg.conf file, and I removed the guisettings.xml just to be sure it wasn't some configuration error. I run XBMC with 1920x1080@60Hz and VAAPI enabled.

I searched google, but found mostly old forum posts about this problem, almost all concerning Nvidia drivers. Some suggested to use the "safefull" option, but that did not help.

Does anyone have any idea what could cause this, and what I should try to fix it?

edit:
Typical, you struggle for a whole day without success, and 5 minutes after you post a message on a forum you find the solution Tongue

Turning off Vertical Blanc Sync completely solved it. Full HD playback with 0 dropped frames and audio in sync Smile
Reply
#78
hm running XBMC with VAAPI enabled on my zacate system is strange. I make my own xbmc 11pre installation and i think its this "smooth playback feature" which made my video stuttering (low cpu load, massiv drop of frames). Playing around with sync and other options make the additional information behind CPU Load (during playback pressing "o") disappear and then it works fine with vaapi enabled.
(strange thing is that the setting is default then, so no changed option but the problem is away)

This Sync information is new in 11pre, in 10.0 Dharma release, i got this information only if i turn this a/v sync in video settings on.

Robotca mentiond here that i need to patch my xbmc ...

http://forum.xbmc.org/showthread.php?tid=99154

with these patches:

http://trac.xbmc.org/ticket/10928

how do i do this? I patched xbmc like alan does in page one but thats different from these patches or and the same method doesnt work with this VAAPI Surface patches.

Thx


Edit:

Deleted .xbmc folder and rebuild the Dharma release. 10.0 ... VAAPI is ok so far. But some movies show tp this stutter problem. So i need to patch... before building xbmc


Quote:root@htpc:/usr/src/xbmc/xbmc/cores/dvdplayer/DVDCodecs/Video# patch -p0 < vaapi_surface_reuse.patch patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.
Reply
#79
Thank you for the guide!
After installing additional libxt and python-dev it all works fine!
I saw some improvements in using the 2.6.39 kernel...

And install acpid for my powerbutton... Smile

The downside is projectm, which after 6 minutes of leaving the system alone when playing music with projectm in fullscreen will hang for a few seconds and the music also stops for a second or so...

But I am very happy to see that playing a blueray is uses far less cpu compared to pausing it... Smile
Reply
#80
I'm a total noob.
Is there a way for installing all the stuff with a "normal" natty release?
Reply
#81
Can I use this guide on a non sandy bridge? like say for a H55 chipset>?
Reply
#82
Just wish to say thanks for this guide. I had been pulling my hair out trying to get 1080p24 output working on my Gigabyte H67M-UD2H-B3.

Had to use a slightly different modeline to get my Sony KDL40EX720 TV to accept the 1080p24 signal:
Code:
Modeline "1920x1080@24p" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +HSync +VSync
Reply
#83
Got hung-up trying to compile xbmc:

Code:
~/Builds/xbmc$ make -j4
make: *** No targets specified and no makefile found.  Stop.

I ran the tutorial to the letter, obviously I overlooked something (probably obvious :o
Reply
#84
tstack77 Wrote:Got hung-up trying to compile xbmc:

Code:
~/Builds/xbmc$ make -j4
make: *** No targets specified and no makefile found.  Stop.

I ran the tutorial to the letter, obviously I overlooked something (probably obvious :o

Probably missing this:

./configure --prefix=/usr
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.
Reply
#85
I replaced my Debian system with Arch Linux to get a few more bleeding edge packages (Newer kernel, newer xorg-server) and rebuilt XBMC from git and 'lo and behold the ReferenceClockHang patch is no longer needed. In fact, with that patch XBMC breaks horribly when you try to exit it. Guessing either the newer kernel, or the newer xorg-server fixed it.
Reply
#86
@alanwww1, I have the same problem with you with problem with autodetect of the audio capabilities over HDMI. I saw a post from you where you said:

"Manually triggering the settings make the unavailable sound modes work.", how do you manually trigger the settings and have you found any other work around?

Thanks for the nice how to!

/sprawl
Reply
#87
sprawl Wrote:@alanwww1, I have the same problem with you with problem with autodetect of the audio capabilities over HDMI. I saw a post from you where you said:

"Manually triggering the settings make the unavailable sound modes work.", how do you manually trigger the settings and have you found any other work around?

Thanks for the nice how to!

/sprawl

Sorry i had no time to update the guide but here are the lines that triggers the available soundmodes. Just insert this into the /etc/init/xbmc.conf upstart script at the end of the "pre-start script" section.

Code:
echo sad0_rates 0x1ee0  > /proc/asound/card0/eld#3.0
    echo speakers 0x4f  > /proc/asound/card0/eld#3.0
    echo sad0_channels 8  > /proc/asound/card0/eld#3.0
    echo sad0_bits 0xe0000  > /proc/asound/card0/eld#3.0

You can verify the modes before and after with

Code:
cat /proc/asound/card0/eld#3.0

I will add this to the guide whan i have time.
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.
Reply
#88
As the machine I am using is used for other purposes, I am not able to compile and install stuff so I have been trying these things out as new updates arrive that are close to what people have done here. If anyone has some insights on why things are not working yet, please do let me know.

The system is a i7-2600k running OpenSuse 11.4 64 bit

Kernel: 2.6.37
xbmc: 10.1-2.13
Mesa: 7.10.2

xbmc has the enable vaapi acceleration option in video playback settings. So I assume it is compiled to provide VAAPI acceleration.

output of vainfo
Quote: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 0vainfo: 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
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD

With VAAPI tuned off in XBMC everything plays fine with no problems.

When I turned on VAAPI, xbmc tries to start the video and then it stops with a blank screen. The left hand corner has the timer which stays at 0:00 played.

At this point it is possible to use the menus to exit XBMC. But if I try running a video again, XBMC hangs in a deadlock (looks like the video thread is in a deadlock because of the previous attempt) and so it cannot exit and has to be killed.

When I look at xbmc.log for with and without the VAAPI tuned on, there is no difference in the output until it stops trying to play. With VAAPI turned on, it hangs before it gets to the following line and there is no further output:

Quote:20:06:33 T:140514050787072 M:5018001408 NOTICE: fps: 30.000000, pwidth: 480, pheight: 360, dwidth: 480, dheight: 360

Before that there are a bunch of lines like
Quote:20:06:33 T:140514050787072 M:5019779072 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 1305, consumed: 298

that are common to both cases (with or without VAAPI).

Looks to me like all of the required libraries are up to the versions compiled in this thread from the standard repositories, so I am not sure what I am missing still.

Any enlightenment or insight would be appreciated. If there is some data I can provide that is needed for the context, please do ask.

Thanks

Edited to add: I tried if VAAPI works with VLC player on this system. Not sure but there is some change when I enable it in VLC and it plays with and without. VLC has two switches - one for direct rendering which gives the maximum benefits in reducing CPU time - otherwise both Xorg and VLC take a lot of CPU. The second switch is labeled experimental for hardware decoding support. I am assuming that this is VAAPI support. When I turn it on, the CPU usage for VLC actually increases (but still much less than what XBMC uses for the same video). VLC uses the hardware decoding and gets it back to do post-processing, so that may explain the increase in CPU time. I still have no idea if it is really doing hardware decoding although its CPU consumption is several times smaller than XBMC for the same video. I noticed from the output of VLC that it calls vainfo when hardware decoding is enabled, so clearly it is trying to use it. Just additional info for what it is worth to determine if the problem is with XBMC or with the graphics stack.
Reply
#89
just did a clean ubuntu 11.04 mini install (on i3 2100T & ASUS P8H67-I) and this howto worked well, but i had to install some additional packages to get everything worked without errors:

libva
Code:
sudo apt-get install libpciaccess-dev libpciaccess0

mesa
Code:
sudo apt-get install libxt-dev

xbmc
Code:
apt-get install python-all-dev
Reply
#90
gven Wrote:As the machine I am using is used for other purposes, I am not able to compile and install stuff so I have been trying these things out as new updates arrive that are close to what people have done here. If anyone has some insights on why things are not working yet, please do let me know.

The system is a i7-2600k running OpenSuse 11.4 64 bit

Kernel: 2.6.37
xbmc: 10.1-2.13
Mesa: 7.10.2

xbmc has the enable vaapi acceleration option in video playback settings. So I assume it is compiled to provide VAAPI acceleration.

The good news is that the rolling updates in current distros (at least OpenSuse) has caught up with the latest video rendering and driver libraries so it is no longer necessary to compile your own or use third-party libva, etc. I was able to cleanly compile the latest git clone for xbmc 11 and run it with HW VAAPI with stock updated software from the distro for everything else.

I am not able to compile xbmc 10 cleanly to try it (the configure script doesn't work for opensuse and has been changed for the 11 configure) but the packman repo xbmc 10.1 with VAAPI enabled doesn't work (dark screen lockup).

xbmc 11 is not stable enough for me in other things and so I am not able to play with it much (crashes with projectM enabled as well) but I am glad to see that VAAPI HW acceleration on the SandyBridge has become a reality without having to hack a lot of stuff.

Side noteTongueeople who want to try 11 out should be aware that if they are using a mysql database for the library, the 11 use of the db is not backward compatible with 10 because of the version table update, so xbmc 10 will not be able to use the mysqldb without some hacking/restore after you have tried 11. Just remove the mysql settings from advancedsettings.xml for trying out 11.

When xbmc 11 is released, there should be no issues (at least for the common need of playing a 720P or 1080P video source with HW decoding). Getting audio right through HDMI, etc., isn't a problem and in any case, the issues are not anything specific to SNB CPUs. The same issues exist for NVIDIA graphics as well and requires similar configurations

Unless one is into gaming, there should be no reason to get a discrete graphics card with the SandyBridge cpus especially if media consumption is the primary use. This makes it easier for slimmer and quieter HTPC builds when Atom or Fusion based systems are not enough for your needs.

Cheers to the XBMC team and good luck on the progress with 11.
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 11

Logout Mark Read Team Forum Stats Members Help
[LINUX] HOW-TO use VAAPI HW Acceleration on new Intel Sandy Bridge platform3