Top
Best
New

Posted by hoechst 5 hours ago

Measuring Input Latency on Linux: X11 vs. Wayland, VRR, and DXVK(marco-nett.de)
300 points | 170 commentspage 2
coldblues 2 hours ago|
Addressing all the people here talking about latency of under 10ms, I direct you towards these:

https://www.youtube.com/watch?v=vOvQCPLkPt4

https://www.youtube.com/watch?v=fE-P_7-YiVM

https://news.ycombinator.com/item?id=42832155

criddell 3 hours ago||
These results are way better than what Dan Luu measured almost a decade ago:

https://danluu.com/input-lag/

Even if everything else is perfect, display latency on modern panels is 1-3 ms. So all of the input processing and display pipeline can't be taking more than a millisecond or two and that's remarkable.

abc42 2 hours ago||
Huh. I turned on PROTON_ENABLE_WAYLAND=1 when it became available and didn't notice any change in input lag. Probably one of the many reasons why I'm not a competitive player.

I also don't like to play above 60Hz.

maltelau 1 hour ago|
At 60 Hz, there are 16.6 ms between frames, so the ~3 ms improvement from not using XWayland would be very hard to notice visually. Where it can make a difference is that some competitive FPS games have some kind of client side hitscan or lag compensation and often play at high refresh rates, so there it can actually matter that their system reports to the multiplayer server that you clicked in the right place a couple of milliseconds earlier.
bsimpson 4 hours ago||
The Rock Band guitars have a photoresistor for precisely this purpose: the screen flashes and the guitar responds when the light hits it. It helps make the otherwise very painful calibration process transparent.

It would be so cool to get that to work in Linux. I know the instrument code is in hid-sony. Here are some open tabs I've got in case anyone's curious:

- https://pascal.giard.info/techreports/nguyen-daniel-autocali...

- https://www.niangames.com/articles/reverse-engineering-rockb...

- https://github.com/torvalds/linux/blob/master/drivers/hid/hi...

somehnguy 2 hours ago||
Well written article with a lot of interesting info. I do wish there was a comparison to Windows as well though, as a frame of reference.
sellmesoap 3 hours ago||
I appreciate the article, it's cool to see such small differences across all those settings! It says they learned to solder, if you see solder joins that look like those in the first picture, keep learning! Those are some dry joins, which can easily lead to failure, or intermittant signal loss. Soldering can be a touchy sport!
hoechst 3 minutes ago|
OP here, thank you for the feedback. I will keep it in mind for the next time I'm soldering something.
saltcured 3 hours ago||
The input latency that has been driving me crazy lately is the screen unblank latency to allow input to a program.

E.g. I have an old laptop running a browser playing some internet radio stream. Eventually the screen blanker (without locking) activates.

Some real life event makes me want to hit the space bar to pause music. But the modern screen blank has decided that it should eat/ignore key presses while blank. So hitting the key doesn't pause music. I have to wait for the screen to light up before it will be possible to trigger the pause, and this delay feels interminable!

I seem to recall that in the old days the input remained active to the focused window even if the screen was in a power saving state. This power saving was not conflated with screen-lock security etc. I much prefer that. I think this was because DPMS power saving was an underlying X server behavior, not delegated to a screensaver/lock application?

I'd also be partially satisfied with the async behavior of old terminal programs. My inputs should be buffered and processed even if the effects haven't returned to the screen yet. Then I could at least hit keys twice and be trained to know that one would unblank, the other would pause, and all would be well (eventually).

The current behavior is like having a temporarily numb hand, and being frustrated waiting for sensation to return before I can operate anything!

wing-_-nuts 3 hours ago|
Question, does your monitor have a KVM? Cause I definitely notice this behavior, even on windows and os x with my monitor. I believe it was the same way on linux as well but it's been a minute since I used linux on my desktop
saltcured 2 hours ago||
This is actually a laptop with its builtin display.

Edit to add: I don't think it has too much to do with display latency.

It is some convolution of the desktop environment and display server deciding that keyboard input doesn't go to the focused window while it is in this nominal screen blank state. This Fedora 43 on a boring generic Thinkpad.

stusmall 4 hours ago||
Great article! Thank you. Also in case others walked away with the same question I had, I'll save you the googling: use the utility vrrtest to help validate if VRR is properly configured on your machine.
teodorlu 3 hours ago||
Very interesting!

Latency numbers are written with three significant digits (4.21 ms). I'm curious about the accuracy of the measurement device. If it can measure tens of microseconds, I'm impressed. If it can't, the conclusions in this article should be taken more coarsely.

zaik 2 hours ago|
> it starts collecting samples from the photodiode (every ~24 µs).

They also have repeated measurements which improves the precision.

haunter 4 hours ago|
SteamOS and Bazzite both use Xwayland through gamescope which is the worst option as it seems https://github.com/ValveSoftware/gamescope

>Avoid XWayland. It added 3.13 ms of latency, more than all other effects combined.

wao0uuno 1 hour ago||
Whole 3.13ms? Man idk shit’s unplayable now.

When rendering 60fps on a 60Hz display every frame takes approximately 16ms to render. Then you have to add TV latency that’a probably around 20ms unless you have a very nice OLED TV. Wireless controller latency is around 8ms I think? Then your imperfect human brain adds even more latency especially when you’re tired after work. That 3ms is not perceivable. Make that 5ms even. Nobody would be able to tell a difference in a blind test.

upboundspiral 3 hours ago|||
gamescope is a custom wayland compositor that Valve built for gaming... In steam big picture mode there is no xwayland or anything, just gamescope.

What you are reading from the readme notes that it calls into xwayland only when gamescope (wayland compositor) is nested within another compositor (say kwin or mutter).

gamescope itself is wayland only, and when run on SteamOS is has no xwayland latency...

seba_dos1 2 hours ago|||
What you're saying doesn't make any sense. Gamescope is essentially a XWayland-only compositor (with some basic xdg-shell support that's disabled by default). All games on SteamOS go through XWayland.

It doesn't yet mean that it suffers from the latency measured in the article, as the problem could very well be in something else, such as how KWin integrates with XWayland or how GPU drivers interact with it (especially that Nvidia drivers have a history of making XWayland suffer).

bionade24 2 hours ago|||
gamescope absolutely can have Xwayland child panes & this is currently the default on SteamOS running games with Proton, unless PROTON_ENABLE_WAYLAND=1 is set in the game options.
AlienRobot 3 hours ago||
I'm not sure I understand. If X11 software requires a X11 server and you have a Wayland compositor, how do you "avoid" XWayland?
More comments...