Tearing and/or flickering when using i3wm

Bug #1811808 reported by ash
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
i3-wm (Ubuntu)
New
Undecided
Unassigned
totem (Ubuntu)
New
Low
Unassigned

Bug Description

When using Intel graphics on my hybrid Nvidia laptop, videos in Totem have awful tearing/flickering which makes them essentially unwatchable.

With default X settings, I get tearing across the top of the screen (but I also get very noticeable tearing in other applications); if I enable TearFree (which eliminates tearing in Chrome), the tearing turns into jagged black flickers which extend from the top of the screen right down to near the bottom of the screen on some frames.

The flickers are visible in screenshots, so I have attached one.

Ubuntu version: Ubuntu 18.04.1
Totem version: 3.26.0-0ubuntu6.1

Revision history for this message
ash (sersorrel) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the detailed bug report. That jagged black tearing is the result of unsynchronized nonlinear buffers being used on screen.

Can you please try these in order?

1. Run 'lscpu' and send us the output.

2. Run: sudo apt install vainfo

3. Run 'vainfo' and send us the output.

4. Try this as a workaround:
   sudo apt remove gstreamer1.0-vaapi

tags: added: bionic visual-quality
Changed in totem (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

5. Please also run 'lspci -k' and send us the output.

Revision history for this message
ash (sersorrel) wrote :
Revision history for this message
ash (sersorrel) wrote :
Revision history for this message
ash (sersorrel) wrote :
Revision history for this message
ash (sersorrel) wrote :

Removing gstreamer1.0-vaapi doesn't appear to help.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

I wonder if this bug is directly related to "using Intel graphics on my hybrid Nvidia laptop". Since regular Intel GPU users never seem to see such problems. Although this is also one of the first bug reports about a Coffee Lake GPU I have seen too, so it might be an Intel problem...

1. Can you please try disabling the Nvidia ("discrete") GPU in the system BIOS and tell us if that fixes it?

2. Can you please also run 'dpkg -l > allpackages.txt' and send us the resulting file 'allpackages.txt'?

3. If the problem persists (and only if) then please also attach copies of your Xorg log files (/var/log/Xorg*log). Please also attach a copy of your Xorg configuration file if you have one (find /etc -name xorg.conf).

Revision history for this message
ash (sersorrel) wrote :

Unfortunately, the BIOS doesn't have an option to disable the Nvidia GPU.

Revision history for this message
ash (sersorrel) wrote :

I don't have an /etc/X11/xorg.conf, but I do have (along with the various distribution-provided files) a /usr/share/X11/xorg.conf.d/99-custom.conf.

Revision history for this message
ash (sersorrel) wrote :
Revision history for this message
ash (sersorrel) wrote :

This Xorg.1.log was last modified in November, so I'm unsure if it's relevant.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for those files. I can see two possible problems (which may not be problems but should be checked):

1. You are configured to use both the Nvidia driver version 410, and are asking Xorg to configure the old Intel driver. In theory this should be possible but OpenGL is really a very simple beast so it might be confused in the Totem window with both drivers being present. :(

2. The intel Xorg driver doesn't recognise your new Intel GPU:

[ 19.882] (WW) intel(0): Unknown chipset

So it might be a better idea to stick with the default 'modesetting' Xorg driver instead of selecting 'intel'. When you use the former you only need kernel+Mesa support for your new Intel GPU. When you use the latter you need kernel+Mesa support AND user space support (which clearly doesn't exist) in the intel Xorg driver. So I think you should remove this:

# Makes tearing in totem worse.
Section "Device"
  Identifier "Intel Graphics"
  Driver "intel"
  Option "TearFree" "true"
EndSection

and continue investigating using the 'modesetting' driver only.

P.S. How many monitors are you using?

Revision history for this message
ash (sersorrel) wrote :

I'm using only one monitor (the one built-in to the laptop), at times I use an external monitor as well, but this problem persists without it plugged in.

After removing that block (i.e. using the modesetting driver), I get jagged tearing almost everywhere. Both Chrome and Totem tear very noticeably, but in slightly different ways (I'll attach some pictures). However, when Chrome is in fullscreen mode, there's no tearing at all, but Totem continues to tear when fullscreened.

Revision history for this message
ash (sersorrel) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

Next I would like to confirm if this is really a pure Intel bug. Just for testing, can you please try uninstalling the Nvidia driver, reboot and then log into "Ubuntu on Wayland"?

Does using a Wayland session avoid the bug?

Please also run 'xrandr' in the Wayland session and send us the output.

tags: added: hybrid
Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, what shell are you using?

Revision history for this message
ash (sersorrel) wrote :

> Does using a Wayland session avoid the bug?

Yes, I see no tearing in Totem (or Chrome) when using Wayland. (Note: after uninstalling the Nvidia drivers (`apt purge nvidia-driver-410 && apt autoremove --purge`), I have to boot with `nouveau.modeset=0`, otherwise boot hangs at Plymouth after entering my disk encryption password.)

In Wayland, xrandr prints the following:

$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
XWAYLAND0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1920x1080 59.96*+

> Also, what shell are you using?

If you mean shell-as-in-graphical, and I understand correctly what that means, then I'm using i3wm. If you mean shell-as-in-CLI, then bash.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks Josh.

I *think* that there are two issues you are facing:

1. The nouveau kernel driver doesn't support your Nvidia GPU properly, which is why "I have to boot with `nouveau.modeset=0`, otherwise boot hangs at Plymouth after entering my disk encryption password.". But that doesn't matter too much here since the desktop will be rendered using the Intel GPU instead.

2. i3wm doesn't seem to be using compositing, so tearing and flickering is expected. Maybe you can configure i3wm to enable compositing, or maybe it doesn't support it at all. Either way that is a problem with i3wm only.

Only #2 is the real problem here. If you would like to avoid tearing then I suggest you will need to use a different window manager or desktop environment. Not i3wm.

affects: totem (Ubuntu) → ubuntu
Changed in ubuntu:
status: Incomplete → Invalid
no longer affects: gnome-shell (Ubuntu)
summary: - Tearing and/or flickering when using Intel graphics
+ Tearing and/or flickering when using i3wm
affects: ubuntu → i3-wm (Ubuntu)
Changed in i3-wm (Ubuntu):
status: Invalid → New
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Come to think of it, one probably could modify some combination totem/cogl/clutter to avoid tearing in old-style non-compositing window managers. But that's unlikely to ever get done considering Ubuntu has been defaulting to compositing window managers for some years now (Unity/Compiz, Gnome Shell).

Changed in totem (Ubuntu):
importance: Undecided → Low
Revision history for this message
ash (sersorrel) wrote :

Ok, thanks; I guess I'll live with the tearing for now, then. I agree that it seems a bit pointless/unlikely to spend time fixing this given most people won't run into it now that compositors are so common.

Maybe I'll get around to configuring one at some point :)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It doesn't take any effort if you use the default Gnome Shell, which is a compositing window manager already.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.