SUMMARY The new kwin version (5.21.0) is unusable for me, I'm running a dual monitor setup, one monitor with 144hz the other 60hz. In the old kwin version there was an option to disable tearing prevention which is now missing. Without disabling tearing prevention moving windows feels very sluggish and seems like it's capped to 60hz. I have tried numerous workarounds (such as adding "MaxFPS=144" to the kwinrc, setting the environment variable "__GL_SYNC_DISPLAY_DEVICE" to my 144hz monitor, playing around with NVIDIA Settings (also tried Force(Full)CompositionPipeline, trying out all of the new vsync options, basically everything there is) but nothing helps. Would it be possible to bring back an option to disable tearing prevention? STEPS TO REPRODUCE 1. Update to new kwin version OBSERVED RESULT No way to disable tearing prevention. Moving windows and other compositor related things seems to be capped to 60FPS. EXPECTED RESULT An option to disable tearing prevention like on the old version SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux, Kernel 5.10.10, KDE 5.21.0 (available in About System) KDE Plasma Version: 5.21.0 KDE Frameworks Version: 5.79.0 Qt Version: 5.15.2
Is a Wayland session affected ?
It is completely irrelevant whether Wayland session is affected or not. I know you guys promote Wayland and would be inclined to answer "hey, if Wayland session isn't affected, switch to Wayland", but the reality for many nVidia users is that Wayland Does Not Work And Never Has.
This option was removed in 5.21 because now compositing is synchronized to hardware vblank events and the screens are repainted as close as possible to the next vblank. It is up to Xorg and drivers what display buffer swaps are synchronized to. If you have an NVIDIA video card, setting __GL_SYNC_DISPLAY_DEVICE to a 144hz monitor should still work though. > Is a Wayland session affected ? On Wayland we have proper support for mixed refresh rate setups.
__GL_SYNC_DISPLAY_DEVICE=DVI-D-0 VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DVI-D-0 I have this in /etc/environment, it does not help at all. It didn't help on 5.20.5 nor does it help on 5.21.0. I understand that you want to stick to your new method of synchronizing but why can't there be an option to not really synchronize at all? Also wayland is not an option for me since I have an nvidia card
It seems like it's a driver bug. __GL_SYNC_DISPLAY_DEVICE has no any effect. If it's set to the fastest monitor, buffer swaps are still capped to the slowest monitor. (In reply to fynnbwdt from comment #4) > I understand that you want to stick to your new method of synchronizing but > why can't there be an option to not really synchronize at all? Because compositing is no longer driven by a timer as it was in previous versions. Also, on Wayland, vsync is always on. Not sure, maybe we just need to introduce an X11-specific environment variable to disable vsync and force kwin to use software vblank events instead. > Also wayland is not an option for me since I have an nvidia card
> Not sure, maybe we just need to introduce an X11-specific environment variable to disable > vsync and force kwin to use software vblank events instead. This would be a nice solution
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/707
With !707, it will be possible to disable syncing to vblanks and make kwin not use hardware vblanks. env KWIN_X11_REFRESH_RATE=144000 KWIN_X11_NO_SYNC_TO_VBLANK=1 KWIN_X11_FORCE_SOFTWARE_VSYNC=1 kwin_x11
Just tested it, works like a charm! Thank you so much :D
Git commit fb93037ca7c0d634d3cd38ae52c957f11cc39297 by Vlad Zahorodnii. Committed on 19/02/2021 at 14:59. Pushed by vladz into branch 'master'. x11: Introduce an envvar to prevent sync'ing to vblanks This can be useful if you want to ensure that the buffer swap operation won't block. M +8 -3 src/plugins/platforms/x11/standalone/glxbackend.cpp https://invent.kde.org/plasma/kwin/commit/fb93037ca7c0d634d3cd38ae52c957f11cc39297
Git commit 45979ed46013999da781d912f93e0e644d19ff1f by Vlad Zahorodnii. Committed on 19/02/2021 at 14:59. Pushed by vladz into branch 'master'. x11: Introduce an envvar to force software vsync This can be useful for debugging purposes and for people wishing to ramp up the refresh rate on their setups with different refresh rates. M +9 -6 src/plugins/platforms/x11/standalone/glxbackend.cpp https://invent.kde.org/plasma/kwin/commit/45979ed46013999da781d912f93e0e644d19ff1f
Git commit 70965e96ca459f18bbf08b3879ce599a68fa6ac5 by Vlad Zahorodnii. Committed on 19/02/2021 at 15:01. Pushed by vladz into branch 'Plasma/5.21'. x11: Introduce an envvar to prevent sync'ing to vblanks This can be useful if you want to ensure that the buffer swap operation won't block. (cherry picked from commit fb93037ca7c0d634d3cd38ae52c957f11cc39297) M +8 -3 plugins/platforms/x11/standalone/glxbackend.cpp https://invent.kde.org/plasma/kwin/commit/70965e96ca459f18bbf08b3879ce599a68fa6ac5
Git commit ea932230d94c72bd24b364bce5ccb4944a94342c by Vlad Zahorodnii. Committed on 19/02/2021 at 15:01. Pushed by vladz into branch 'Plasma/5.21'. x11: Introduce an envvar to force software vsync This can be useful for debugging purposes and for people wishing to ramp up the refresh rate on their setups with different refresh rates. (cherry picked from commit 45979ed46013999da781d912f93e0e644d19ff1f) M +9 -6 plugins/platforms/x11/standalone/glxbackend.cpp https://invent.kde.org/plasma/kwin/commit/ea932230d94c72bd24b364bce5ccb4944a94342c
How do we use this env vars. Previously I had disabled vsync because screen sharing through Zoom caused terrible screen flickering for people watching my screen. No I can't turn it off and thus I cannot use screen sharing with Zoom.
Put this in your /etc/environment KWIN_X11_REFRESH_RATE=144000 KWIN_X11_NO_SYNC_TO_VBLANK=1 KWIN_X11_FORCE_SOFTWARE_VSYNC=1
If you have two monitors at different refresh rates and an NVIDIA graphics card, I have found the following to result in buttery smooth, tear-free perfection: 1. In NVIDIA XServer Settings, disable OpenGL flipping, then set ForceCompositionPipeline=On for both displays (Display Configuration -> Advanced... will need to save to X.org configuration file). 2. Put the following in /etc/environment (144000 = 144 Hz, adjust accordingly to the highest refresh rate between your monitors): KWIN_X11_REFRESH_RATE=144000 KWIN_X11_NO_SYNC_TO_VBLANK=1 This results in perfectly smooth, tear-free animation on the high refresh rate display, and lower framerate, still tear-free animation on the other display. Note that I am leaving out the "KWIN_X11_FORCE_SOFTWARE_VSYNC=1" setting, as adding it results in dropped frames. Thanks to the kwin developers for making these options available!
(In reply to S. Christian Collins from comment #16) > This results in perfectly smooth, tear-free animation on the high refresh > rate display, and lower framerate, still tear-free animation on the other > display. Note that I am leaving out the "KWIN_X11_FORCE_SOFTWARE_VSYNC=1" > setting, as adding it results in dropped frames. Can you tell me how you monitored for the dropped frames, or was it just an observation? Also, how are you monitoring the FPS for kwin? With the built in compositor 'effect'? That shows me topped at 100fps, which is an improvement, but not the 144 I was expecting.
``` export KWIN_X11_REFRESH_RATE=144000 export KWIN_X11_NO_SYNC_TO_VBLANK=1 export KWIN_X11_FORCE_SOFTWARE_VSYNC=1 ``` I have this in my environment, I have not monitored the kwin-fps but am pretty sure that it's 144fps
I just tested it with the built in effect and can confirm that it indeed just shows 100fps, however I'm pretty sure that it's 144fps in reality
...just why? This is a downgrade. Bring back that essential function. This is similar to Windows 8 FORCING desktop composition, and the resulting backlash. It doesn't matter how well you implement VSync, it introduces latency and not everyone wants it. It's known to cause stutters in many programs. It actively stifles high Hz refresh rate users. This change also made the quick and useful KWin "Suspend Compositing" shortcut completely useless, a dead function.
Re-opening the bug report doesn't revert the change or even encourage anyone to do so (it generally has the opposite effect). I would recommend that you start a conversation about this in on the plasma-devel@kde.org mailing list.
(In reply to fynnbwdt from comment #18) > ``` > export KWIN_X11_REFRESH_RATE=144000 > export KWIN_X11_NO_SYNC_TO_VBLANK=1 > export KWIN_X11_FORCE_SOFTWARE_VSYNC=1 > ``` > > I have this in my environment, I have not monitored the kwin-fps but am > pretty sure that it's 144fps export KWIN_X11_NO_SYNC_TO_VBLANK=1 export KWIN_X11_FORCE_SOFTWARE_VSYNC=0 worked for me. I even had to force disable software vsync & then go with nvidia's pipelining to fix double vsync issue.
(In reply to S. Christian Collins from comment #16) > If you have two monitors at different refresh rates and an NVIDIA graphics > card, I have found the following to result in buttery smooth, tear-free > perfection: > > 1. In NVIDIA XServer Settings, disable OpenGL flipping, then set > ForceCompositionPipeline=On for both displays (Display Configuration -> > Advanced... will need to save to X.org configuration file). > 2. Put the following in /etc/environment (144000 = 144 Hz, adjust > accordingly to the highest refresh rate between your monitors): > > KWIN_X11_REFRESH_RATE=144000 > KWIN_X11_NO_SYNC_TO_VBLANK=1 > > This results in perfectly smooth, tear-free animation on the high refresh > rate display, and lower framerate, still tear-free animation on the other > display. Note that I am leaving out the "KWIN_X11_FORCE_SOFTWARE_VSYNC=1" > setting, as adding it results in dropped frames. > > Thanks to the kwin developers for making these options available! Thanks this fixes it for me, finally it is same responsiveness as in Windows