by prhn · 4mo ago · 0 comments
I switched my daily driver / gaming rig to Fedora a few months back.
Everything seems snappier compared to Windows, but not sure if it’s in my head, and I’ve been very curious about gaming input latency. This helps answer some questions.
I recently switched to hyprland and I’m very interested how that fits in these results. hyprland uses Wayland so I hope the author might revisit now that hyprland is gaining in popularity.
I’ve considered using gamescope to hopefully get in front of some of these concerns, but I’m on nvidia and there is some discussion about it not working well there.
Now the author's got me thinking about gaming-optimized kernels, which I did not realize was a thing.
I play competitive fighting games so input latency is a huge concern. Would love to hear from anyone else who’s been down this path.
The difference could be much larger on a slower monitor. However the differences between Wayland and X11 as protocols is negligible. XWayland as an implementation looks to have a limitation.
And the non-xwayland numbers are all within a single ms of each other.
---
Not to undermine the measurements of the author (agree with you, it's a cool effort), but my read is that this was basically proof that it doesn't matter.
Imagine a game that's just a pistol duel. When the kerchief hits the ground, players press a button, first person to press the button wins.
In an ideal world, with no delay whatsover, the probability P(A) of player A shooting no later than player B is 100 (because both players shoot at exactly the same time). If we add 5 ms of delay to player A, then P(A) = 0 (he will always lose). If then we add 50 ms of network latency to both players, P(A) = 0 still, because 55 > 50. If we instead make that 50ms delay 50ms +- 10ms (ignoring normal distribution for the moment, pretending every value in that range is equally likely), there's a 25% chance of player A experiencing an unwinnable delay (any network delay value > 55ms results in a value greater than player B's max of 60ms), resulting in a probability of P(A) = 75% * 50* = 38%.
If we make the network delay 50ms +- 5ms, then P(A) drops to 25%.
The saying we have in bike racing marginal gains is "leave no stone unturned, but turn over the big ones first"
So sure, first make sure your internet connection is solid. Then make sure your hardware and game settings are optimizing FPS to a reasonable point of diminishing returns.
Then make sure you don't use XWayland
There are weird consequences of this, someone can shoot you after you duck behind a wall because you hadn't yet in their version of the game. An enemy moving left right repeatedly is likely vibrating in your version of the game faster than the rules of the game would otherwise allow. Etc. Ping matters, but it's not comparable to input latency. Input latency really does mean that you can click at the right time and miss your enemy. It really does delay how fast your camera spins when you move your mouse. Etc.
The visual latency on gaming could be different but I suspect not, I think it is more an issue that some people fixate on the latency, others just accept and adapt to it. Games do have more possible sources of latency, visual, audio and io, and if these can all be different that can be difficult; years ago I had an issue with this and midi, that one really threw me off. Games may also not model the physics of sound? does sound travel slower than light in games? That could worsen the problem since sound does travel slower in real life and we are used to that, we expect it.
Consider also that people neither run the latest thing nor the fastest software and remember potholes long after they are filled. EG it wasn't that long ago that wine was running on xwayland almost exclusively for instance and the majority of popular titles run via wine.
It’s possible that Gnome/KDE/whatever has wildly different latencies on X11 vs Wayland.
I’d be interested in seeing that test.
But it’s great to know the difference is so small here, which is what I’d expect.
Of course, the brain adapts. I played an online shooter at >100 FPS using my 144 Hz monitor (when that was the best). I visited a buddy who's PC could only muster 30-40 FPS, and he asked me to show me how I played, since he struggled.
I sucked so bad due to the extra input lag. Felt like my character was running in a pool of molasses. But after about 15-20 minutes my body adapted, and my performance started increasing and my hits started connecting more reliably. I got to about 90% of my regular performance after 30 or so minutes.
So while one could tell back to back, one could also compensate. But at some point the extra input lag will matter, and will get you killed or make you miss that shot. Hence why I could only get up to ~90% of my normal performance on my buddy's PC.
[1]: https://jov.arvojournals.org/article.aspx?articleid=2213289
Adapting is doable, but after years of rhythm games, yeah, no.
I've been a fan of Hyprland for gaming so far. Much more configurable for things like VRR/tearing and other precise tweaks via Gamescope than when I was on AwesomeWM with X11. Been especially nice having Lua for configuration, which finally feels very familiar with my AwesomeWM roots.
I have very fast internet on both sides, both fiber to the home, with only the tablet running moonlight being on WiFi.
if [ -z "$DISPLAY" ]; then
/usr/bin/startx /usr/bin/dbus-launch "$(readlink -f $0)" "$1" -- -layout singleLayout
fi
pw-cli i || (pipewire & sleep .5 ;\
pipewire-media-session &\
pipewire-pulse &)
cd "$DIR"
exec unshare -rcn $ENGINE "$IMAGE" $ARGS
and the rest of the script is about setting up the environment for the game: setting all the parameters used above, exporting the correct WINEPREFIX, mounting .iso's if required, etc.Gamescope replaces X or Wayland so you just run it and then the app you want it to open