sway: Adaptive sync doesn't work in fullscreen mode with some apps in XWayland
-
Sway Version:
- sway version 1.5-5c67d997 (Aug 1 2020, branch ‘HEAD’)
- Also tested sway-1.5, with no change
-
Debug Log: sway-adaptive-sync.log
-
Configuration File: sway_minimal_config.txt
-
Other system information:
- Radeon RX 5700 XT
- mesa git
- xserver git
- wlroots git
- Kernel: amd-staging-drm-next (also tested older versions from a few months ago)
-
Description: Adaptive sync doesn’t work in fullscreen mode with XWayland with some applications.
Steps to reproduce:
- Launch sway
- Run glxgears with
strangle 60 glxgearsto limit framerate below maximum (pick a lower value if you have a 60hz monitor) - When first launched, glxgears will be in windowed mode and will show 60 hz (or 120 hz with LFC) on monitor display.
- Press Win + f to toggle fullscreen, and refresh rate on monitor OSD will jump to 144hz.
- Press Win + f to go back to windowed mode, and refresh rate on monitor OSD drops to the correct 120hz.
It’s likely a regression somewhere since this has worked correctly in the past. It’s possibly an XWayland issue since it seems to be limited to X programs (I tested Retroarch which is Wayland native, and it doesn’t exhibit the issue). However, it doesn’t seem to affect all XWayland programs (e.g. Subnautica + DXVK doesn’t have the issue, but Wonder Boy: The Dragon's Trap + DXVK, does.)
- Other notes
- It affects GL and Vulkan (RADV).
- The issue doesn’t occur with XMonad.
- Sometimes, adaptive_sync breaks completely requiring a Sway restart and possibly a reboot, although I’m not sure if this is a Sway issue or not.
- I also get a million
[glfw error 65544]: Wayland: fatal display error: Broken pipemessages when exiting Sway, and I have edited out most of them from the log since the log would be multiple GBs otherwise.
EDIT: RPCS3 compiled with Wayland support is another app that doesn’t seem to exhibit the issue, so more evidence that it’s XWayland limited.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 4
- Comments: 41 (7 by maintainers)
@GrabbenD I see the same behavior when moving the mouse - stuttering occurs. May also be related to this issue: https://github.com/swaywm/sway/issues/6832
EDIT: The only scenario where I do not get stuttering moving the mouse with VRR enabled is on an X11 session with one monitor attached.
Thanks for the idea @abigrock
I had it disabled while individually testing each environment variable mentioned in this thread. Vsync is off in game and my VRR is set to fullscreen only. Seems like stuttering only happens when I move the mouse (meaning not the keyboard).
I’m not sure but it sounds like this could be the issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2186
Launching sway with
-Dnoscanoutworks for me too. But what are the drawbacks?Edit: Ok, I understood what the drawbacks are: direct scan-out is about avoiding an unnecessary copy of the screen contents by the compositor when there is a game/application running full-screen. Avoiding that unnecessary work by the compositor with direct scan-out can help with performance and also lower latency. (Phoronix)
That won’t work, try running Sway with
-Dnoscanoutinstead.Found something interesting today while trying different wlroots variables. Setting
WLR_DRM_NO_MODIFIERS=1when launching sway resolves the issue for me.Elden Ring, Soul Calibur IV, and vrrtest now have my monitor syncing to the application framerate while fullscreen. I don’t know if there are any drawbacks to setting this variable, but all seems to work well so far.
Worth noting that I upgraded to
sway 1.8andwlroots 0.16.1prior to testing this out, but doubt it’s related to the fix.Can confirm that I’m seeing this with my RX 6800 XT and dual freesync monitors. Reproduced with Elden Ring, Soul Calibur VI, and vrrtest. In every case adaptive sync works when the application is in windowed mode. As soon as the application is fullscreened my monitor OSD reports max refresh rate.
System info:
Also tried sway-git, wlroots-git, and mesa-git with no change in behavior. Setting
WLR_NO_HARDWARE_CURSORS=1and/orWLR_DRM_NO_ATOMIC=1when launching sway does not fix the issue.