Linux Graphics – Understanding Video Tearing Issues

compositegraphicslinuxmonitors

I've used many variants of Linux(mostly Debian derivatives) for over a decade now. One problem that I haven't seen solved satisfactorily is the issue of horizontal tearing, or Vsync not being properly implemented.

I say this because I use used 5 different distros on 4 different computers with various monitors and Nvidia/AMD/ATI/Intel graphics cards; every time, there has been an issue with video tearing with even slight motion.

This is a big problem, especially since even Windows XP doesn't have these issues on modern hardware. If anyone is going to use Linux for anything, why would they want constant defects to show up when doing anything non-CLI?

I'm guessing that either few developers know about this problem or care enough to fix it. I've tried just about every compositor out there, and usually the best they can do is minimize the issue but not eliminate it. Shouldn't it be as simple as synchronizing with the refresh rate of the monitor? Is there some politics among the OSS community that's preventing anyone from committing code that fixes this?

Every time I've asked for help on this issue in the past, it either gets treated as an edge case(which I find difficult to believe it is given the amount of times I've replicated the problem) or I get potential solutions that at most minimize the tearing.

Best Answer

This is all due to the fact that the X server is out-dated, ill-suitable for today's graphics hardware and basically all the direct video card communication is done as an extension ("patch") over the ancient bloated core. The X server provides no builtin means of synchronization between user rendering the window and the screen displaying a window, so the content changes in the middle of rendering. This is one of the well-known issues of the X server (it has many, the entire model of what the server does and is outdated - event handling in subwindows, metadata about windows, graphical primitives for direct drawing...). Widget toolkits mostly want to gloss over all this, but tearing is still a problem because there is no mechanism to handle that. Additional problems arise when you have multiple cards that require different drivers, and on top of all this, opengl library has a hard-wired dependency on xlib, so you can't really use it independently without going through X.

Wayland, which is somewhat unenthusiastically trying to replace X, supports a pedantic vsync synchronization in its core, and is advertised to have every frame exactly perfect.

If you quickly google "wayland video tearing" you'll find more information on everything.

Related Question