Ubuntu: Have tearing (no Vsync) in movies (Nvidia proprietary driver)



Question:

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.


Solution:1

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)


Solution:2

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.


Solution:3

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.


Solution:4

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 }"  


Solution:5

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


Solution:6

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.


Solution:7

The settings that worked best for me in this situation on Nvidia 970m closed drivers in 14.04 Kubuntu.

Go to Settings -> Desktop Effects -> Advanced Tab    Change -> compositing type -> Open GL 3.1  Change -> Qt Graphics System -> native  Change -> Scale Method -> Accurate  Change -> Tearing Prevention(VSync) -> Full Scene repaints  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »