← Back to team overview

compiz team mailing list archive

[Bug 1307144] Re: 'unredirect fullscreen windows' causes tearing


I am experiencing this bug on Ubuntu 15.10 Wily, using Nvidia drivers
and Gnome (not Unity, if that's the name of the touchscreen-based

It appears that vlc must be spelled lowercase in order to be matched,
but the default for Unredirect Match spells it Vlc. Totem works. firefox
must also not be capitalized for it to match, but the default is for it
to be capitalized.

Using this video, linked in the previous bug +1051802


It's possible to test whether a video is full-screen by enabling compiz
effects, like Opacity (in which case the behaviour seems to be that if
you try to initiate transparency while a window is fullscreen
unredirected, it won't take effect until compositing turns on again,
such as by moving the mouse to activate the menu in vlc) or, much
easier, the Benchmark plugin, which shows a frames/sec overlay that
disappears when a window goes fullscreen-unredirected.

When playing the test video in Firefox, occasionally when pausing, it
actually shows a frame mid-tear, with the middle out of synch with the
top and bottom. This is a completely unrelated issue though, since it
still happens when pixels are being redirected (benchmark is displayed)
and no tearing is occurring during playback.

Adding video players to the default matchings to exclude (! = not, for
people like me who don't know programming languages) may have been the
"fix" referenced in the previous bug report. The "impossible to fix"
comment in that report seems accurate, it's probably an Nvidia bug.

It is still a little mystifying whether some Compiz options have any
effect, like the vsync-related ones in Workarounds, but vlc and firefox
being capitalized is a bug. The description of Composite > Unredirect
Match suggests that "you might want to exclude video players, for
example, to avoid tearing", but is this only because of a bug in Nvidia
(or other graphics providers' configuration options)?

Not sure what the bug report submitter is using, but nvidia-settings has
the option "Sync to Vblank", and "Allow Flipping". I found that turning
off Allow Flipping leads to occasional tearing when recording video
using  the x11grab device in ffmpeg, and 'Sync to Vblank' limits the
framerate of the glxgears test program, but the description of Sync to
Vblank is this:

"When enabled, OpenGL applications will swap buffers during the vertical
retrace; this option is applied to OpenGL applications that are started
after this option is set."

I'm not sure if this is supposed to apply to video playback. When a
video player is being unredirected, I find that there is tearing and no
other options will prevent it.

When output is not being unredirected, I find that the only option that
affects tearing is "Allow Flipping" in nvidia-settings. When it's on,
there is no tearing. When it's off, there is always tearing. The
following options seem to have no effect:

OpenGL plugin:
Sync to VBlank
Framebuffer object
Vertex buffer object (this might just be a games thing, and I'm just testing video)
Always use buffer swapping

Workarounds plugin
Legacy Fullscreen Support (not completed tested with all other options combinations though)
Fix screen updates in XGL with fglrx
Force synchronization between X and GLX
Don't wait for video sync

I didn't completely test these:
Force complete redraw on initial damage
Force full screen redraws (buffer swap) on repaint

But they don't seem to prevent or cause tearing. They do show up when
using the 'Show Repaint' plugin but require 'Vertex Buffer Object'
option to be enabled.

in nvidia-settings, "Sync to Vblank" has no effect on tearing during
video playback regardless of any other settings, even after the video
player is restarted.

Ok, I guess maybe the answer to the question is that "vertical synch
only works with buffers"?  I have no idea what other ways exist to swap
buffers other than flipping, but that may be the issue here. Turning on
Allow Flipping might prevent tearing in fullscreen applications like
games, when Compiz isn't getting involved.

HOWEVER, I did most of that testing using totem. Tearing when
unredirecting totem seems to be slightly worse than when it's
redirected, and then swapped in by Compiz. With the nvidia-settings
option "Allow Flipping" enabled, there is no tearing in totem with the
default Compiz settings (where Totem is correctly capitalized), but
there is tearing in vlc, which is incorrectly capitalized when it should
be uncapitalized, as well as firefox with html5.

But when compiz is handling vlc's output, there's no tearing even with
"Allow Flipping" disabled. It appears no combination of options will
cause tearing in vlc, other than unredirecting output (by incorrectly
spelling vlc as Vlc, which also requires "Unredirect Fullscreen Windows"
to be enabled, both of which are the default settings).

** Changed in: compiz (Ubuntu)
       Status: Invalid => Confirmed

You received this bug notification because you are a member of compiz
packagers, which is subscribed to compiz in Ubuntu.

  'unredirect fullscreen windows' causes tearing

To manage notifications about this bug go to: