Skip to content

Entries tagged "intel".

Hardware accelerated video playback on EL6 (RHEL, Centos, SL) and Intel SandyBridge

Recently I got to play with a linux laptop that had an NVidia card and was impressed by how well and efficient mplayer is when using VDPAU.
My personal laptop however is an all-Intel one with a 2nd generation i5 SandyBridge CPU and no NVidia GPU, but an Intel HD 3000. This is quite a popular setup nowadays and this is actually great because it turns out we can have hardware accelerated playback using entirely open source software, no binary blob required. Linus will be happy. :-)

Don't get me wrong, this is a great machine and mplayer uses around 30% of one core when playing 1080p video, however this is no match for the under 10% when using NVidia's VDPAU.

So let's start. What we need is LibVA from splitted-desktop.com and gstreamer-vaapi (to enable acceleration in Totem) or/and a version of mplayer with VAAPI patches. I'll assume you are using Stella or EL6 with my repo nux-dextop.

yum install libva-freeworld gstreamer-vaapi
And that's it, open some HD content in Totem (aka Movie Player) and behold low CPU usage.

Thanks to Tux99 at SL forum for packaging gstreamer-vaapi.

If you want to use mplayer though we need to work a bit more and build it from source (until I'll make a package of it).
We need to install some development packages first:
yum install gcc make freetype-devel alsa-lib-devel pulseaudio-libs-devel yasm-devel patch subversion libva-freeworld-devel

Next we need to get mplayer-vaapi and build it:
cd ~/Downloads
wget http://www.splitted-desktop.com/static/libva/mplayer-vaapi/mplayer-vaapi-20110127.tar.bz2
tar xjf mplayer-vaapi-20110127.tar.bz2
cd mplayer-vaapi-20110127
./checkout-patch-build.sh
...wait for the build process to finish then you can merely copy the mplayer binary to somewhere in the path and that's it - we do this not to overwrite or mess up other pre-existing mplayer installatons in the system.
cd mplayer-vaapi
mkdir -p ~/bin
cp mplayer ~/bin/mplayer-vaapi

At this point we're pretty much done, try testing it by playing some HD mp4 file with the following parameters: -vo vaapi -va vaapi.
mplayer-vaapi -vo vaapi -va vaapi /path/to/HDvideo.mp4
and enjoy low CPU usage. :-)

If you want to skip inputing these parameters each time you want to use VA-API then simply add the following to ~/.mplayer/config :
vo=vaapi,xv,
va=vaapi


Here's the difference on my system:

Stock MPlayer, no acceleration:


VA-API enabled MPlayer:


This should work across all i3/i5/i7 chipsets (Intel HD 2000 & 3000), feedback welcome.

EL6 power usage optimisation on Intel Sandy & Ivy Bridge

So you finally bought that fancy new laptop with a SandyBridge or IvyBridge chip, but the power usage goes through the roof when you use it on Linux? Well, there are a couple of things you could do:

1. Enable some nice features such as a lower power usage state capability of the Intel GPU (if you use the integrated Intel 3000/4000), frame buffer compression and optionally down-clock the LVDS refresh rate. Also, you can force PCI-Express to enable "ActiveState Power Management" which can save further power - just append the following to the kernel command line (in /boot/grub/grub.conf):
i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 pcie_aspm=force


2. Install and tweak tuned. Tuned is a Fedora utility responsible for tuning your system's power settings.
yum install tuned
service tuned start
service ktune start
tuned-adm profile laptop-battery-powersave


If you want to get even more serious about power saving, then the powertop program is very useful, too. For a graphical tool focused on power management have a look at Jupiter.
Feel free to play around with the settings and read the man pages for more information.
Be careful as some of these settings may cause some issues or instabilities. Use at your own risk.