Xubuntu and Compton for tearing-free XBMC

Thu, Apr 24, 2014

I had some difficulties with XBMC and Xubuntu, since with the default Window ompositor I had a lot of tearing during Video Playback in XBMC, the following steps fixed the issue for me.

Setup: Ubuntu (using xubuntu-desktop) and an NVIDIA GeForce GTX 660 using the proprietary driver, Linux Display Driver 331.38, since the Open-Source Xorg driver doesn’t work with XBMC at all and caused it to crash when trying to play a video.

Using the NVIDIA driver everything worked fine, expect that during video playback there was a very annoying tearing, making it nearly impossible to enjoy a movie. I’ve tried a lot of things, that should fix it, none worked.

Fortunately I stumbled upon this guide and this forum post. Since it was very hard to find (and mostly for me not to forget how I did it) I want to publish the steps I did to fix tearing issues here:

  1. Disable the default window compositor
    Go to Settings, Window Manager Tweaks and disable the Compositor completely. Screenshot
  2. Enable VBlank Sync in NVIDIA Settings
    Go to the NVIDIA X Server Settings to the OpenGL section and enable the option “Sync to VBlank” and “Allow Flipping” Screenshot
  3. Install Compton
    You can do this either by compiling it (see Github Repo) or by adding the ppa and installing it with apt-get:

    sudo add-apt-repository ppa:richardgv/compton
    sudo apt-get update
    sudo apt-get install compton
  4. Configure Compton
    Create the config file, ~/.compton.conf, configure as you wish. The important options to fix tearing issues I used are:

    backend = "glx"
    refresh-rate = 60;
    vsync = "opengl-swc";
    unredir-if-possible = false;
  5. Add Compton to the startup
    Add a new startup item with the name Compton (or whatever you like to remember what it does) and the command

    compton -b

    Click OK and restart. Now you should be able to enjoy tearing-free videos in XBMC!