'unredirect fullscreen windows' causes tearing

Bug #1307144 reported by nastys on 2014-04-13
286
This bug affects 67 people
Affects Status Importance Assigned to Milestone
compiz (Ubuntu)
Undecided
Unassigned

Bug Description

Ubuntu release: 14.04
Installed compiz version: 1:0.9.11+14.04.20140409-0ubuntu1

The option 'unredirect fullscreen windows', which is enabled by default in Compiz, causes tearing in games and other fullscreen OpenGL applications, even with 'sync to vblank' options enabled in ccsm, in the GPU settings and in the game.

With this option disabled, VSync works as fine as should with 'unredirected fullscreen windows' enabled and there is no tearing (but this causes performance issues and the Unity panel shadow on top of the application).

Tested with:
- ASUS NVIDIA GTX 650-E-1GD5 with NVIDIA proprietary driver 331.38 (tested) (nvidia-331)
- the same graphics card with NVIDIA proprietary driver 331.38 (nvidia-331-updates)
- the same graphics card with Nouveau open source driver (xserver-xorg-video-nouveau)
- Intel HD 4000 iGPU with default open source drivers

*** NOTE TO PEOPLE REPORTING "SIMILAR" BUGS ***

This bug is about unredirected fullscreen windows. If you see menu bars, the Unity Panel, Indicators, a menu bar, a window title, or any other decorations you are not running in unredirected fullscreen mode and you are not experiencing this bug.

A fullscreen window has content that occupies the entire screen, no borders, no menu bars, no Unity elements. An unredirected window is a situation in which the application renders directly to the screen, without going through a compositor (such as Compiz).

If you are seeing anything at all except your application content on the screen, this bug does not apply to you.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed
Fabron (fabronfretwell) wrote :

screen is constantly flickering. I'm is triple monitor with dual ATI 7250 Radeon cards all threee monitors are counterclockwise and a wghost of the screen is flickering 90 degrees across the left and right monitors but not the center screen.

Sam_ (and-sam) wrote :

An example with mulitple monitors may need a separate bug report.
Here notebook and pc, each single monitor and ati card, sync to vblank und unredirect on, no tearing.

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV710 [Radeon HD 4350/4550] [1002:954f]
 Subsystem: PC Partner Limited / Sapphire Technology Device [174b:174b]
 Kernel driver in use: radeon

compiz:
  Installed: 1:0.9.11.2+14.04.20140714-0ubuntu1
  Candidate: 1:0.9.11.2+14.04.20140714-0ubuntu1
  Version table:
 *** 1:0.9.11.2+14.04.20140714-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.9.11+14.04.20140409-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

hans (hansaka-perera) on 2014-09-25
no longer affects: compiz
ib (igor-bujanovic) wrote :

Ubuntu 14.04, latest updates, latest Nvidia driver, MSI Gaming G45 MB, i7 4470k CPU, Nvidia GTX770, most annoying flickering in terminal, some other applications also affected. VLC runs w/o problems.

System is almost unusable for any serious work :-(

Minqiang (ptpt52) wrote :

I am here to report that same problem as ib (igor-bujanovic)

CPU i7 4770k Nvidia GTX 770 same most annoying flickering in terminal!

anyone can resolve the problem?

ib (igor-bujanovic) wrote :

I had to switch permanently to Intel GPU. Nvidia driver makes the system unusable for daily use. Such a shame.

Sadly, Ubuntu 12.04 (in early phase using Bumblebee) was smooth. With each Ubuntu upgrade my problems gets bigger and bigger using the same HW base.

Maybe time to improve testing & acceptance procedures before major releases ??

Bensos (gestione) wrote :

I have annoying flickering after upgrading to 14.04 with the following graphic card:
Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series] 8prog-if 00 [VGA controller])

Hronom (hronom) wrote :

Ubuntu 14.10, nvidia 770m, nvidia driver 343.22 xorg-egders

Hi, I installed linux mint 17 and the default xorg amd wrapper driver works flawlessly. I highly recommend. No issues whatsoever on my system.

On Friday, October 17, 2014 5:25 AM, Minqiang <email address hidden> wrote:

I am here to report that same problem as ib (igor-bujanovic)

CPU i7 4770k Nvidia GTX 770 same most annoying flickering in terminal!

anyone can resolve the problem?

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1307144

Title:
  'unredirect fullscreen windows' causes tearing

Status in “compiz” package in Ubuntu:
  Confirmed

Bug description:
  Ubuntu release: 14.04
  Installed compiz version: 1:0.9.11+14.04.20140409-0ubuntu1

  The option 'unredirect fullscreen windows', which is enabled by
  default in Compiz, causes tearing in games and other fullscreen OpenGL
  applications, even with 'sync to vblank' options enabled in ccsm, in
  the GPU settings and in the game.

  With this option disabled, VSync works as fine as should with
  'unredirected fullscreen windows' enabled and there is no tearing (but
  this causes performance issues and the Unity panel shadow on top of
  the application).

  Tested with:
  - ASUS NVIDIA GTX 650-E-1GD5 with NVIDIA proprietary driver 331.38 (tested) (nvidia-331)
  - the same graphics card with NVIDIA proprietary driver 331.38 (nvidia-331-updates)
  - the same graphics card with Nouveau open source driver (xserver-xorg-video-nouveau)
  - Intel HD 4000 iGPU with default open source drivers

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1307144/+subscriptions

ib (igor-bujanovic) wrote :

Moved to Mint 17 (xfce4). Still, the Nvidia driver is not perfect on my ASUS V3-771G (GeForce GT 650M), but works great with my main workstation using Nvidia GTX770.

I'm not using Nvidia on my laptop but the primary Intel GPU.

Lost my hopes Ubuntu will ever fix this long lasting problems with Nvidia drivers...

Confirm the tearing with "unredirect fullscreen Windows" enabled. Linux mint 17 Cinnamon 64 bit, Nvidia GT 530, driver 331.38 (i tested the 340 also with the same result).
This workaround ( http://forums.linuxmint.com/viewtopic.php?f=208&t=155365 ) allow to disable "unredirect fullscreen windows" and, thus, "fix" tearing.

Deluxo (deluxo64) wrote :

I do have the same issue (mostly). Fullscreen unredirected windows flicker when I change volume or screen birghtness (notify-osd overlay). After notification disappears, tearing goes away. Sometimes artifacts stick to window shadows or the cursors for while (few minutes), then go away. Havent installed no fancy drivers. Vannilla ubuntu 14.10, intel i5 sandy.

@Deluxo: I think it's a different bug. Our tearing concern the unredirect fullscreen windows mode.

Shahar Roth (rothshahar) wrote :

Same problem while watching netflix in firefox + pipelight.
Unchecking "unredirected fullscreen windows" solves it.

$ vainfo
libva info: VA-API version 0.35.1
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.35 (libva 1.3.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2

Ubuntu 14.04 on system76's Galago UltraPro. Fully up-to-date.

Arie Pshedezki (pshedezki2) wrote :

I saw in some computers in my lab with graphic card geforce gtx 660 of nvidia
and ubuntu 14.04 a weird bug and i'm not sure if that's what that this thread is about.
After some minutes of working all or many of the letters in the screen begin to blink or being replaced.
I attach a photo of the problem.?

The problem was solved, probably by changing the driver to

Nvidia binary driver- version 331.38 from nvidia-331 (proprietary, tested)

It seems that changing definitions in compiz did not help

Stephen M. Webb (bregma) on 2014-12-17
description: updated
Alex (axfelix) wrote :

If anyone's brave enough to try to revert to an older version of compiz, it seems like this was fixed at one point: https://bugs.launchpad.net/compiz/+bug/1051802

Alex (axfelix) wrote :

Well, I tried that, and I got as far resolving dependencies as the forked Unity Control Center, and got afraid of going any further. Oh well.

Michael MacEachern (maceach-b) wrote :

Can confirm this issue. For example, if I keep "unredirected fullscreen windows" turned on, and play Netflix in Google Chrome, for the most part the movies do play without tearing, but as soon as I hit the volume button and the OSD fades away, tearing happens and doesn't go away unless the OSD is up.

But, turning off "unredirected fullscreen windows" fixes the issue. Also switched to play the new Unreal Tournament engine, and saw no performance issue by turning this off, so I am going to personally just leave it off.

Alex (axfelix) wrote :

Performance issues usually won't be noticeable, more on the order of 5-10%. It's still one of those things that you'd expect to be fixed at some point, since the compositor can eat a fair amount of CPU from unredirected windows on non-super-powerful machines.

fcole90 (fcole90) wrote :

Thank you for taking the time to report this bug. We have tried to recreate this on the latest release of Ubuntu and cannot reproduce it. This bug is being marked as Invalid. If you believe the problem to still exist in the latest version of Ubuntu please comment on why that is the case and change the bug status to NEW.

Changed in compiz (Ubuntu):
status: Confirmed → Invalid
fcole90 (fcole90) on 2015-10-03
tags: added: desktop-bugscrub-invalid
Misaki (myjunkmail311006) wrote :
Download full text (4.8 KiB)

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 interface).

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

https://www.youtube.com/watch?v=ZCPkOpMHB7g

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:

compiz:
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 t...

Read more...

Changed in compiz (Ubuntu):
status: Invalid → Confirmed
Misaki (myjunkmail311006) wrote :

When I first started testing, one way to confirm that a window was being unredirected was that Alt-Tab would not show a window switcher (I use Static Application Switcher). However, after I had tested different options and video players (particularly ones in Workarounds), this stopped being accurate and always worked. I tried changing all options back but could not replicate this behaviour.

I had left Unredirect Fullscreen Windows to disabled for a long time, at random, when I was testing how options affected video playback in ways unrelated to tearing. In the past I experienced issues where eog, or eye of gnome, the image display program, would not display the application switcher when in fullscreen. This doesn't seem to be an issue for me but it seems like it might be related this particular option, unredirect fullscreen windows.

I don't know why I had this issue with application switcher not showing up while in fullscreen video, after I had enabled Unredirect Fullscreen Windows but before I started messing with other settings, but if other people experience, or can replicate the same issue maybe they could comment on it or create a new bug report.

At the moment, I have no strong reason to turn the option off, even though it causes tearing. In marginal cases, it seems it can be the difference between a video player dropping frames and being able to continue (when these players aren't excluded through matching). But if other programs or drivers are bugged to the point where they have tearing, and people dislike tearing, it may be better to have this option off by default.

So: does "Allow Flipping" in nvidia-settings prevent tearing in games when this compiz option is at its default setting of on?

*My testing result is that with both totem and vlc, when the fullscreen output isn't being redirected, even Allow Flipping doesn't prevent tearing. But when I changed vlc's video output method from XVideo, which works the best, to OpenGL, which is slightly slower, the tearing is almost, but not completely, eliminated. Sync to VBlank in nvidia-settings still doesn't seem to do anything, but turning Allow Flipping back on does bring tearing back to zero. The other output methods also don't eliminate tearing by themselves.

Misaki (myjunkmail311006) wrote :

I'm sorry for triple-posting, but to summarize the end of my previous comment: "Allow Flipping" in nvidia-settings > OpenGL Settings does completely eliminate tearing for fullscreen, unredirected output for OpenGL GLX output in vlc. It does eliminate, or affect tearing for the XVideo output method. So it will probably help for OpenGL games.

There is still a minor amount of tearing, maybe one frame in 30~100, even with OpenGL output and flipping enabled, when redirected by compiz (not fullscreen). It seems the only thing that prevents this is the "Force full screen redraws (buffer swap) on repaint" option... ok but actually, as shown by the "Show Repaint" plugin, that was because there was another vlc instance behind several other windows, that was paused and therefore causing repaints.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers