linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.51k stars 733 forks source link

Tearing/Vsync issues in Cinnamon/Clutter #3423

Open ghost opened 10 years ago

ghost commented 10 years ago

Running nVidia hardware on multiple machines, and along with other nVidia users I have bad screen tearing in Cinnamon/Clutter unless the game has a VSYNC option which forces it on, then things work fine. For some reason VLC doesn't have tearing that I can notice, but Totem always has horrible tearing.

The solution being done by several users right now is to switch to the Compton compositor instead and forcing on VSYNC for everything through that, but can't we get an option to force it on for Cinnamon instead? For some reason the usual Cluttter options do NOT force on VSYNC. See the following threads on the Linux Mint forums and Reddit:

http://forums.linuxmint.com/viewtopic.php?f=59&t=171020 http://www.reddit.com/r/linux_gaming/comments/28skqt/psa_do_you_have_screen_tearing_issues_only_in/

Also found this suggestion to add a VSYNC option to Cinnamon options, but if that option doesn't work anyway then that won't fix the problem.

https://github.com/linuxmint/Cinnamon/issues/1773

Using nVidia closed driver.

mainmachine commented 6 years ago

@kvnxiao - Yes, the Intel GPU should be doing this, but check on the "X Server XVideo Settings" tab. I'm typing this from a Optimus laptop and I don't have tearing, so there's hope. :)

I am using modesetting driver as well, looking through my Xorg.0.log...

Can you post your Xorg.0.log somewhere?

nick-s-b commented 6 years ago

I've been trying for years and I've never been able to eliminate Vsync/tearing issues on my machine. It's not as bad as it used to, but I still occasionally notice it when I play some high-bitrate videos. I use Nvidia graphics only.

If you guys go to https://www.vsynctester.com and run the test, can you see the red or cyan vsync in the right corner? I haven't been able to eliminate that no matter what "fix" or browser I tried.

kvnxiao commented 6 years ago

@mainmachine Here is my Xorg.0.log file: xorg.0.log

In the X Server XVideo Settings tab, it says Currently synced to display: Unknown image

mainmachine commented 6 years ago

@echuber2 - that looks like a good resource for that specific hardware; here's another that I've found invaluable (it is specific to Ubuntu, though):

http://danielteichman.blogspot.com/2017/03/how-to-install-bumblebee-on-ubuntu-1604.html

@kvnxiao - it's probably worth looking over your config versus these two links.

I'm also using the latest stable Mesa (17.3.2) - what are you using?

kvnxiao commented 6 years ago

@mainmachine @echuber2

Good news! It seems like after some tinkering I actually got it to work! No more diagonal screen tearing visible system wide.

I'm not sure if this applies to other optimus users with older integrated intel GPUs, but for Skylake users with Intel HD 530, this is what I found that helped me fixed the problem. I followed danalec's post in this thread here: https://bbs.archlinux.org/viewtopic.php?id=208299 Reinstalled xf86-video-intel and added a 20-intel.conf to my xorg configurations to use intel over modesetting (for the TearFree=true setting, which only works in AccelMethod=sna):

Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "DRI" "3"
    Option      "AccelMethod"  "sna"
    Option      "TearFree" "true"
EndSection

Since I use GRUB, I then added these kernel parameters to /etc/default/grub in the GRUB_CMDLINE_LINUX_DEFAULT line:

modprobe.blacklist=nouveau i915.enable_rc6=0 i915.enable_psr=0 i915.preliminary_hw_support=1 i915.enable_hd_vgaarb=1 intel_idle.max_cstate=1

And regenerated my grub configuration file, then rebooted.

All that, and bumblebee is still working:

$ optirun glxgears -info | grep GL_RENDERER
GL_RENDERER   = GeForce GTX 960M/PCIe/SSE2
mainmachine commented 6 years ago

@kvnxiao - the only difference I've seen that looks notable is that your Xorg is this: [ 2.393] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so ...I have this xorg module, but it does not get loaded. AFAIK with Bumblebee you should not have a /etc/X11/xorg.conf, this is handled by Bumblebee for the Nvidia GPU with /etc/bumblebee/*.conf

Do you have an xorg.conf in /etc/X11/ and if so, what's in it? If you have any lines specifying or loading the "intel" module, then I'd comment and restart...

mainmachine commented 6 years ago

@kvnxiao - that's great! 👍

As far as this issue goes globally, it seems as if more and more vsync is getting solved at the driver level. This has certainly been my experience with Nvidia, AMD and Intel, on both Nvidia proprietary and Mesa... maybe this isn't an issue for Cinnamon (or any other DE) specifically anymore...?

kvnxiao commented 6 years ago

@mainmachine Well... the reason I asked for help originally was because while on the modesetting driver for the integrated intel GPU, there didn't appear to be any screen tearing when I was testing in KDE. Going back to Cinnamon, there's horrible screen tearing unless I use the intel driver and apply the changes I listed in the above post.

To me that seemed like a DE issue. If while keeping the system configuration constant, swapping to a different DE showed no screen tearing, but swapping back and screen tearing shows up again.

mainmachine commented 6 years ago

@kvnxiao - sure, could be Kwin was doing something different at the compositor level, versus what muffin does. With regard to DE's, tearing is usually solved by compositing in the window manager. I think currently Cinnamon does this by default, but there is an option to disable compositing for full screen applications (like games, for example). This is in Settings > General > Disable compositing for full-screen windows, if you're curious.

zor1984qq commented 6 years ago

These doesn't help me out on my radeon r5 230 1Gb VRAM caicos GPU. I have no such things with couple of others DE's to be honest the only DE which has these issue is Cinnamon.

cppcooper commented 4 years ago

This problem is still quite alive and well. Must be some complicated for it to have a 6+ year span.

echuber2 commented 4 years ago

@cppcooper

Can you be more specific about what symptoms you're seeing and what configuration you have, now?

cppcooper commented 4 years ago

I see vsync-issues & tearing in cinnamon, the issue subsides if I start the session with xfce instead. I am running Archlinux, I do not recall what the kernel version is. I can say I cloned the repo and built it this last weekend. I have tried numerous potential remedies, but the only one that works is using xfce which is unfortunate because I prefer the panels and default hotkeys in Cinnamon. Switching the vsync method, nouvea/nvidia drivers were both tried, tried the different composition pipeline options in the nvidia settings, etc.

I only consider it a problem inside firefox when watching videos. I even tried some firefox specific fixes, which I figured might work since VLC doesn't seem to suffer as badly from it. In fact any time I think I've seen tearing I'm not sure if it was or not, so it might as well be considered tear-free at that point (VLC that is).

Nvidia GT 710

AlpakaSiedler commented 4 years ago

I have tearing in Linux Mint 19.3 (Cinnamon, 64-bit) with Nvidia GTX 1060 (3GB) (driver: 440.48.02), using desktop applications such as firefox, as well as in games (i recently tried CounterStrike:CZ, Torchlight 2, No Man's Sky and various different Unity3d Games, also self made Unity3d Games).

To solve this, i tried what they said here: https://github.com/linuxmint/Cinnamon/issues/3355 also added "ForceFullCompositionPipeline" to both of my monitors.

I've read that it should be less issue on MATE, but i would prefer to stay with Cinnamon.

leigh123linux commented 4 years ago

I have tearing in Linux Mint 19.3 (Cinnamon, 64-bit) with Nvidia GTX 1060 (3GB) (driver: 440.48.02), using desktop applications such as firefox, as well as in games (i recently tried CounterStrike:CZ, Torchlight 2, No Man's Sky and various different Unity3d Games, also self made Unity3d Games).

Why do you need the nvidia beta vulkan driver?, ubuntu vulkan packages aren't new enough to benefit from the new extensions.

To solve this, i tried what they said here: #3355 also added "ForceFullCompositionPipeline" to both of my monitors.

I doubt adding that option will help with the newer nvidia drivers

I've read that it should be less issue on MATE, but i would prefer to stay with Cinnamon.

AlpakaSiedler commented 4 years ago

@leigh123linux the newest driver was recommended in a forum cause i had problems with Unity3d using Vulkan and No Man's Sky using also only vulkan.

ForceFullCompositionPipeline helped a bit for desktop application, its way better for me with enabled, but didn't get rid of it completly

genachka commented 4 years ago

Seeing the same problem with Nvidia RTX 2070 on Ubuntu 19.10 and Cinnamon 4.2.4 (though same was with previous versions for the past year+) and as others have tried ForceFullCompositionPipeline and other settings to no avail. Beyond it be annoying for me, apparently it's pretty bad on web meettngs - I need to be on zoom often and share my screen which makes the attendees see the desktop or window or I'm sharing disappear and show my background and then reappear periodically. After months of trying to resolve this, regrettably I'd had to switch to the default GNOME (3.34.2) and everything has been fine but I do miss my Cinnamon. Would love to see a fix for this.

echuber2 commented 4 years ago

Have you tried the various Vsync modes in the control panel?

https://www.reddit.com/r/CinnamonDE/comments/dx4lyk/vsync_method/

cppcooper commented 4 years ago

Honestly I am skeptical the vsync modes do anything, there is no discernible difference between any of them for me. After rebooting between changing the modes.

echuber2 commented 4 years ago

Check the source if you're skeptical. They do something; I saw it make a difference on one of my machines instantly after changing the setting. (That did not have an nvidia GPU though.) If anything I bet this all comes down the drivers you have installed. Although, if there is something distinctively wrong with Cinnamon's vsync then I'd also like to know about it.

AlpakaSiedler commented 4 years ago

I also tried different vsync modes but it did not make a noticeable difference. I also tried different driver versions, the recommended one, the newest, older stable drivers that were recommended by community users, nothing helped.

genachka commented 4 years ago

@echuber2 I too have tried those various Vsync modes and followed the steps in the link. No change. I'm on an Nvidia. And I don't think it's the drivers as I don't have this issue anymore with GNOME :( Open to trying other things as would love to switch back.