Wayland & Latency / Gaming

I had high hopes for wayland/kwin when the plasma 6 upgrade finally landed! But… No! I will stay on X11, and - unfortunately - i think it will be for quite some time :confused:

I play competitive games - Quake Live and CSGO/cs2. The 2 most important things for my display manager are this: 1. Latency 2. Framerate (insofar, the dm is actually displaying a proper picture!). So far, the framerates have been quite good, and I’ve been surprised at how good the Proton-/WINE-layer has been at making windows games play in linux

Since i jumped from win10 to Linux, i have tried Wayland, on and off regularly, and its always the same: Running Wayland seems to add tons of latency, feeling like 200+ ms of inputlag, but randomly fluctuating.

Since this is very hard to test properly, I am only able to convey the immidiate experince im having, like how I almost rage-destroy mouse/keyboard and monitor, when playing using wayland :slight_smile: :face_with_open_eyes_and_hand_over_mouth:

It was the same thing on my old system (i3-3220+amd7870) as it is on my new system (7800X3D+6700XT). Though it seems sligthly more input-laggy on linux, than in windows 10 (its very subtle, like in the 10-20 ms range, again this is VERY subjective).
I’ve tried popOs, Garuda and now settled on this exquisite EOS as my daily driver.
I will NOT go back to windows, but will stay on EOS+X11.

I remember 1+ year ago reading about some problems with input lag on wayland, and how this was related to developers forcing vsync, and i have been scouring the net for info on how to lower latency on wayland, but it always comes down to this: vsync-related/similar lag or inputlag is persistent in Wayland, this is an absolute killer for gamers relying on low latencies to be competitive!

Has anyone else experienced similar wayland behaviour? And is this only related to the DM / Implementation of Wayland, or wayland itself?

FWIW,
/MadGabZ

2 Likes

Not really, by most accounts wayland performs better in games than x11.
My apologies, but I don’t understand what you actually tried. Are you saying you disabled vsync and it didn’t work or something?

Edit: Just wanted to add that I haven’t noticed any difference myself with the exception of the nvidia xwayland flicker, but that’s nvidia so…

They appear to be talking about competitive gaming and milliseconds of lag. Not something I have ever had to worry about with the sorts of games I play.

1 Like

I’ve had some issues with mouse movement in both Plasma 5 and 6 under Wayland. What solved it for me was running the games under gamescope, using the --force-grab-cursor option. - Also making sure I was using vulkan-radeon and not amdvlk. That mattered way more than I realized.

Worth a try. - I have literally the same exact hardware you listed there and Wayland has been great for me. I never got X11 to work well with my multi-monitor setup, so I kind of gave up on it.

I bet, u cant really tell the difference between 60 hz and 120+ hz, then? except, oh its a little smoother on your eyes?

Pretty much. About the only 2 things I really want for my PC at the moment is a slightly better screen and maybe one day get a proper GPU for gaming so I can experience the games in a bit better quality but they’re not really my top priorties. Can’t miss what I’ve never had.

1 Like

Does Journalctl log show a specific message about latency issue?

Have you allowed screen tearing in fullscreen mode to reduce latency?
Screenshot_20240311_143917

I will try gamescope…havent had luck with it before, but yes, i already got vulkan-radeon installed

I remember a mouse bug affecting amd users. I believe it was this one https://gitlab.freedesktop.org/drm/amd/-/issues/2186. Not sure if yours is related though.

Yes! But, thanks for reminding me! :slight_smile:

Interesting! I’ll take a look… thanks!

1 Like

What i tried was periodically logging in to my wayland KDE plsama session ( i only have 2 login sessions: X11 and Wayland) and trying to play games. Starting steam and playing cs2 / Quakelive with various types of proton (TKG/GE/…), and setting vsync off, tweaking mouse settings, setting screen to 120 hz etc etc…
I’ve tried proprietary drivers as well as opensource. Different versions of mesa and vulkan!
It’s all resulting in the same crap, frustrating inputlagged experience!

I haven’t tried using gnome yet (Brrr… :confused: ), but maybe mutter or other DM will be better!

Logging out and back in to X11, and lag is gone!

Did you manage to fix this meanwhile? Experiencing the same thing, CS2 mouse movement feels delayed under wayland only.

Nope! I’ve tried several distros and several kernels, atm on CachyOS with custom kernel: Still the same

Did you try gnome?

Nope, never got around to it!
As another peculiar thing i’ve noticed: The delay/inputlag i’m getting is very clear, when playing a quakelive server (used one close to me, 12 ms ping) and trying to USE an item or use gauntlet/pummel! at least 50-80 ms of delay from pressing mousebutton, until the action is registered on screen/as sound feedback! This is on KDE with custom CachyOS kernel, gamescope, affinity fixed to only use 2 threads on 1 core, and compositing forced off w ALT+SHIFT+F12

You need to enable wayland in CS2 itself for early try CS2 in wayland.

I had the same input lag problem in Hell Divers 2. Switching back to X11 fixed it. But this env variable fixed it in Wayland! set KWIN_DRM_NO_AMS=1 in /etc/environment

References

https://www.reddit.com/r/linux/comments/19fepjf/tip_how_to_enable_tearingdisable_vsync_on_kde/

I’ve had to go back to X11 for Steam, the latest Wayland release has turned it into a stuttery mess for most games. X11 - butter smooth. I’ll try again in a few more months. While Wayland’s definitely improving, - basic functionality like gamma control isn’t quite there yet sadly.