Solve video tearing on Intel + Ubuntu (XFCE 4)

For the Unity and GNOME Shell version, check this out.

Having tried out a bunch of DE’s in the past, I find myself moving towards minimalism and speed, and IMO nothing is better suited than XFCE to fulfill those requirements. But just when I thought everything was fine and dandy on my shiny new Xubuntu 13.10 install, video tearing reared its ugly head again. Compositing and tear-free playback just don’t play nice, but Docky (yeah I don’t like the default XFCE panels) requires compositing for all its fancy effects! There is a workaround for this though, and it’s easier than you might think, at least on Intel chipsets. I’ve tested the following fix on an HP laptop running an i5-3210M (with the HD 4000) and 8 gigs of RAM, and used VLC for playback. Before we move any further, let’s get this out of the way – this fix isn’t guaranteed to work, and there’s always a small chance that you might end up breaking your install. If you’re fine with that, read on!

STEP I – Editing VLC’s video output

To make sure our video playback is tear-free, we’ll need to edit VLC’s preferences (Tools > Preferences > Video) and change the Output from its default value to “OpenGL GLX video output (XCB)”. Optionally, you can also check “Accelerated video output (Overlay)”.

STEP II – Forcing VSync in Intel’s settings

To the best of my knowledge, Intel doesn’t have a GUI for its graphical settings, something along the lines of nvidia-settings. But who doesn’t like messing around with Xorg on the command line? Open up a terminal window with root privileges, and create the following file –

/etc/X11/xorg.conf.d/20-intel.conf

Create the requisite folders if they don’t exist. Enter the following in the newly created file and save it –
Section "Device"

Identifier "Intel Graphics"
Driver     "intel"
Option     "AccelMethod"    "sna"
Option     "TearFree"       "true"

EndSection

The SNA (SandyBridge’s New Acceleration) method is the (faster but more unstable) successor to the UXA (Unified Acceleration Architecture) backend, while the TearFree option fixes video tearing occasionally caused by SNA. In case you’re experiencing freezes/crashes, revert to UXA by setting the value of AccelMethod to uxa instead of sna.

Reboot for the settings to take effect, and you should be good to go. Movie library backlog, here I come!

Credit for this thread goes to the fine folks who maintain the Arch Wiki. The specific sections used can be found here.

5 thoughts on “Solve video tearing on Intel + Ubuntu (XFCE 4)

  1. >/etc/X11/xorg.conf.d/20-intel.conf

    Thank You Very Much! It’s Working.

    * edit /etc/environment is deprecated for Cinnamon 2.2

  2. Pingback: Un mediacenter DIY avec du vieux matériel | Mossroy

  3. I’m running Xubuntu 14.10 beta1 on very cheap installation (i.e Acer aspire e1-510). This setup is using Intel Pentium N3520 @ 2.16GHz with build-in Intel HD graphics. Creating this .config file solves the tearing of video files, even if playing very high resolution vids like bluray 1080p. I’ve had the same tearing problem with youtube videos but this fixes it too.
    The interesting thing is that I used the VLC and tube without changing any setups in the machine or program itself and everything was running smoothly. Then all the sudden this tearing (bug with no documentation yet?) started.
    Well of course I installed new Intel drivers like new VA-API and tried that Vsync resetup that people are recommending but those didn’t help at all. Well, this is the only thing working at the moment and i’m pleased with that.

    I have no idea what went wrong and why so if someone can explain this id’ll be nice. And of course if someone is asking in any other forum or blog how to solve the tearing please forward them here. There is really a lot of confused intel hd users out there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s