18

This is more of KDE than Ubuntu question, but...
I have visible tearing on screen. KDE composition, flash video in Firefox, and simple games like kpat are vsynced, but in steam games and in movies there is a distinct constant tearing. If I turn off vsync everywhere, the tearing is double as noticeable, so it is not just GPU ignoring the settings.
What bugs me most it that I'm having the same problem on many different setups. Does everybody have this problem and nobody cares?
My setup

  • Kubuntu (last few versions) or OpenSuse or Gentoo.
  • KDE 4.12 - 4.13
  • Nvidia GTX 260, 570, TITAN, different driver versions.
  • I watch movies in SMplayer with mplayer2 backend. VLC has the same problem.

What did I try (and it didn't help)

  • Switching on and off in different configurations the Vsync settings in nvidia-settings and KDE Desktop effects.
  • Switching Mplayer output and direct rendering settings.
  • Turning off Adaptive power mode in nvidia-settings.
  • Turning off compositing
  • Changing monitor Hz
  • Running mplayer from CLI
  • Performing rituals and sacrifices

What did work (but is not and acceptable solution)

  • Disabling KDE, and running Mplayer in pure X session
  • Switching to nouveau AND turning off composition AND opening video in fullscreen - without any part it is still tearing.

Please advice.

UPDATE 1 I found out that if I go to Desktop Effects -- Advanced and change there anything valuable (OpenGL version, scaling algorythm) and push Apply, the tearing is gone until reboot. However, no setting solves this once and for all. After reboot I have to go and change something again.I guess it is enough to blame this on a bug, not my mistakes, so I will file out bug report.

8

Simple guide to solve this annoying problem :)

  1. Create file:

    /etc/profile.d/Tearing.sh
    
  2. Insert this code:

    export __GL_YIELD="USLEEP"
    
  3. Then make it executable with:

    chmod +x /etc/profile.d/Tearing.sh
    
  4. Once that's done, reboot or press ctrl + alt + F2, login and run sudo service lightdm restart Or restart what ever your display manager is.

The GL_YIELD worked for me, and now vertical sync appears to be working as it should.

(https://www.kubuntuforums.net/showthread.php?63946-No-vertical-sync-with-NVIDIA&highlight=tearing)

  • This worked great, thanks! No more tearing after a reboot – user1003916 Oct 8 '15 at 18:03
  • 1
    Did the trick for me as well, nVidia GeForce 210 over HDMI to a TV – K0D4 Feb 13 '16 at 18:50
8

The source of problem was (of course) faulty nvidia drivers. The solution is simple. Add environmental variables:

export __GL_YIELD="USLEEP"
export __GL_THREADED_OPTIMIZATIONS=1

somewhere before X starts. System-wide /etc/profile/ works fine.

  • 2
    This didn't help in 14.04 nor 16.04 – Giovanni Toraldo Jul 20 '16 at 6:31
5

I had it nailed...

So - first of all be sure to check if the problem persists after you switch the Desktop Effects off (Alt+Shift+F10). I can guarantee that the problem might already be gone.

Go to System Settings and open Desktop Effects:

  • Scaling Method to something else than set currently <-- actual fix

I know the options might not be named exactly as above. Sorry about that, but I am using the Polish version of Kubuntu.

The steps above fixed the problem for me. But only after a fresh install. :)

EDIT: In the current 14.04 Kubuntu version the problem is connected with the Scaling Method. Changing it to anything else than currently selected, helps to resolve the problem TEMPORARILY.

  • I have tried setting "Scaling Method to Smooth" alone and it seemed to solve the problem! But I will wait the weekend before closing the answer. Tearing disappeared for sometime already and appeared again, and what's more, that "smooth" thing should have no effect on when movie plays. Weird. Even spooky, you know. – Barafu Albino Apr 28 '14 at 18:55
  • So it seems to be this: When I change scale method to anything, tearing disappears. But after reboot, it is back, and I have to change it again to something different. – Barafu Albino Apr 29 '14 at 19:26
  • This fixed the issue for me. I think not all of the steps were necessary, but together they seem to have it covered and I'm getting beautiful hd video performance (in VLC) in both window and maximized mode. The combination of the nvidia settings plus disabling desktop effects also fixed it, but this way I can leave desktop effects enabled. Also I installed the ubuntu restricted extras package previously - not sure if this came into play or not. – gregtzar Aug 9 '14 at 1:11
  • And I can "guarantee" that if you turn your monitor off the problem "might" be gone as well :) No offense man but if the problem just "might" be gone there is no guaranty at all. Anyways my point is that this is not acceptable resolution for me and probably many others however it may help if one wants just to watch one movie and not to spend much time on it. – tomasb Mar 1 '16 at 12:51
5

I have tried all the tricks and nothing solved on Ubuntu 15.04 (along with xorg-edgers and nvidia-355) , until I came on nvidia archlinux page.

Test with:

nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

In order to make the change permanent, you need to add the following line to the "Screen" section of your Xorg configuration file, for example in /etc/X11/xorg.conf.d/20-nvidia.conf

Option  "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
  • Copying and pasting the same answer to many questions is not very good. You should have marked as duplicate, the fact that these questions have answers already. Thanks :) – Mitch Aug 14 '15 at 11:49
  • Thanks, I was experiencing tearing, and the other solutions (like setting the __GL_YIELD variable) did not work. Also, I had previously experienced trouble with setting the Xorg file, but the above command line worked successfully. I will try adding the command line to my ~/.xprofile. It's a hack, but it should work. – Chris Sep 6 '15 at 23:31
  • 1
    Can't give you enough points :-) For reference, I'm on Xubuntu 15.10 with nvidia-355. – Marcus Oct 31 '15 at 14:28
  • 1
    This worked for me and im on 14.04 :) – Neil Nov 19 '15 at 6:44
  • 1
    This worked for me on KDE Neon User LTE. – tejzpr Sep 29 '17 at 2:44
0

Removing NVIDIA driver solved for me. For XFCE, the only thing that helped was replacing the window manager.

  • 1
    For XFCE it is. For other WMs, however, removing the driver is both unnecessary and my or may not solve the problems. – Barafu Albino Jun 15 '15 at 17:14
  • It seems pretty necessary to me, because the driver is glitchy and nouveau gives the vsync that I need. – Waterscroll Jun 16 '15 at 0:32
  • What window manager you used instead? – jarno Nov 22 '15 at 13:04
  • Compton, but I figured the source of my problem. There is a problem with nvidia optimus and xorg that causes tearing when you use your nvidia card. – Waterscroll Nov 22 '15 at 20:07
  • As for vsync, building Xfwm4 from Git helped; instructions are here). However, the current Git version seems to have some other drawing issues. – jarno Nov 24 '15 at 13:51
0

I tried every suggestion to try and fix the screen tearing while watching videos in Unity, Gnome, and Gnome Classic on two computers (one with Nvidia Titan X and the other with an old Radeon card). Nothing worked.

Then I noticed that when I switched the video output in my VLC setting from OpenGL to X11, the tearing went away but I started getting a lot of random black/white squares or "noise".

To get video playback to work, I installed Lubuntu Desktop which uses OpenBox instead of OpenGL. Lubuntu is a Ubuntu derivative that has LXDE installed by default. It is extremely lightweight and perfect for running in the background while you use Kodi and Steam, or just watch videos.

Window tearing may occur while dragging windows quickly, but this doesn't matter to me in this situation since I solely use Kodi and Steam in full screen mode on this computer.

Run the following command to install both Lubuntu’s customized LXDE and vanilla LXDE on Ubuntu:

sudo apt-get install lubuntu-desktop

Use this command instead to install only vanilla LXDE:

sudo apt-get install lxde

You can also give LXDE a spin by downloading a Lubuntu live CD.

Each environment differs only in its default settings. They come with different themes, wallpapers and panel layouts. For example, the Chromium browser is the default on Lubuntu, while Mozilla Firefox is the default on vanilla LXDE. Of course, you can use any browser you like with either. They both use the PCManFM file manager, a lightweight replacement for the Nautilus file manager found in GNOME.

After installing either package, log out and select either the Lubuntu or LXDE session from the login screen.

My videos never looked better than in Lubuntu. I was able to bump my frequency up to 120Hz to match my TV. The playback was remarkably smooth for 1920x1080p.

  • OpenBox instead of OpenGL? Are they for the same task? – jarno Oct 6 '15 at 6:15
  • No, I'm suggesting you use a compositing window manager, like Openbox, that doesn't use OpenGL. en.m.wikipedia.org/wiki/Compositing_window_manager – guttermonk Oct 6 '15 at 10:10
  • Xfce4 uses Thunar as file manager by default, not PCManFM. – jarno Oct 9 '15 at 20:43
  • Running LXDE did not stop video tearing in Chromium browser when playing YouTube. I have Intel graphics, and ubuntu 14.04. – jarno Oct 9 '15 at 20:45
  • @Jarno, XFCE was a typo. I've edited it and replaced it with LXDE. Regarding the screen tearing, did you try a different browser? Do you have screen tearing when you play video files off your hard drive? – guttermonk Oct 13 '15 at 21:53

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.