My favorite trick, which I’ve used frequently (including in scientific publications on lag!) is to use the slo-mo cam on a smartphone. Phones will usually do anywhere from 120-240Hz. Set up the camera so it can see both your input (e.g. a side view of you pushing a button) and the display, record a video, and then pull it into a media player that supports frame-by-frame playback. You can then measure the number of frames elapsed from you pushing the button (pressing it down far enough to electrically activate it) and the corresponding reaction on screen. This gives you a cheap and easy setup capable of measuring latency down to ~4ms granularity, and doing a few repeated measurements can give you a very accurate picture of latency. Keep in mind that latency is a range (statistical distribution), not a single number, so you need repeated measurements to understand the shape of the distribution.
If you’re developing a game, you can add a prominent frame counter on screen to be captured on the video, and add the frame counter to your log output. Then you can match up the video with your game’s events, after accounting for display latency.
I am aware that admitting to using Windows in these hallowed halls is a terrible sin, but the anecdote was too relevant to pass up and that's an important detail for anybody looking to repro.
I don't see any pro gamers carrying in any kind of PS/2 device, they even moved to wireless so the differences are likely meaningless these days.
When I switched from Windows to Linux on the same hardware I noticed a lot of keyboard input latency when playing games, at least 150ms. This only happens to me with niri, KDE Plasma (Wayland) feels identical to Windows. So did Hyprland. I'm able to reproduce it on multiple systems when I have a 4k display running at 1:1 native scaling. On AMD cards, turning off v-sync helped reduce it but it didn't remove it. With an NVIDIA card, turning off v-sync made no difference. I believe it's semi-related to that 4k display because when I unplug that display and use my 2560x1440 monitor, it's much less noticeable despite getting a solid 60 FPS with both monitors. All that to say, there's certainly a lot more than your input device, GPU and display playing a role.
If anyone played Quake on a dial-up connection with client side prediction turned off, that is the exact same feeling. It's pressing a key and then seeing the screen update X ms afterwards.
You can try Gamescope [1] from Valve, that's what Steam Deck uses - i think its a compositor designed to minimize latency but support the few things games need. Some compositors like KDE Plasma KWin support a direct scanout mode which is the same idea as windows' exclusive fullscreen. You might need to look for support for something similar in niri.
As far as I know niri enables direct scanout by default. It's an option you can disable if you want https://niri-wm.github.io/niri/Configuration%3A-Debug-Option.... I do not have this set which indicates direct scanout is enabled.
It's interesting because the latency is only when pressing keys on the keyboard. Mouse movement and button press latency feels as good as Windows, I can't perceive any delay. I tried 3 keyboards, it's all the same. I'm also not running anything like keyd or anything that intercepts keys. It's a vanilla Arch Linux system on both of the systems I tested.
That makes it unlikely it's related to this auto suspend, especially since it only appears to happen when I use my 4k monitor, but I did set it to 30s just to rule it out and it made no difference. I brought it back to 2s afterwards.
Windows's desktop compositor DWM is actually very advanced, and I don't believe any Linux desktop compositor is anywhere close. It's one of the things I miss when leaving Windows.
One day I pop up a practice map in cs:go where one of the challenges is shooting a fixed target after it turns green. If you don’t do it within 250ms or something (nothing crazy in terms of human reaction time), then you don’t score.
I was flabbergasted to see myself miss every single time. My friend even told me “dude, are you pretending? How are you so slow?”
So the next day I got a new mouse and what do you know, I’m actually responding in time, and scored most of the time when the rectangle went green. Just the mouse was not registering it fast enough.
Of course, that didn’t translate into such a huge boost in actual gameplay, but it’s impressive how that made me consistently miss. Likely it had some crazy 50ms+ lag.
As you say, I hadn't noticed anything when I just had the 60Hz monitor.
To some extent, responsiveness is a perception based on expectations derived from the visual and acoustical elements of a game. So on top of engine-level optimizations, there are artistic tricks that can further improve the sense of responsiveness.
Think Kiki and Bouba, and how each one would move, race and fight.
The engine section is the part most developers seem to ignore. A locked 60fps doesn't mean 16ms latency, and that gap make me surprise
I think most people get their information from help blurbs in settings menus for PC games, which are often hilariously vague or incorrect.
Vulkan's presentation API makes this distinction explicit: VK_PRESENT_MODE_MAILBOX_KHR is the "replace if already queued" mode that actually reduces latency, while VK_PRESENT_MODE_FIFO_KHR is the pipeline-queue variant that adds frames ahead of time. OpenGL never standardized the difference,
so "triple buffering" meant whatever the driver implemented -- usually vendor-specific extension behavior that varied between hardware. The naming confusion outlived OpenGL's dominance because the concepts got established before any cross-platform API gave them precise semantics.2. Triple buffering does not reduce latency compared to unsynced tearing. It’s a spatial vs temporal tradeoff between whether to let frequency mismatches manifest as tearing or jitter. For passive consumption of motion, losing temporal consistency in exchange for spatial cohesion is the better tradeoff and so triple buffering is appropriate. For active controls of motion and its feedback, temporal consistency is absolutely critical whereas spatial cohesion while in motion is far, far less important, so triple buffering is unacceptable in this use case.
If you wanna minimize latency, you'd want always the most recent information available, which vsyc or buffering does not provide. You trade that for tearing with those schemes.
I've come to accept input lag, but mostly play games where it doesn't matter (simple platformers, turn-based games, etc). I know steam link from my home desktop to my ~5 year smart TV is adding latency to my inputs – though I can't tell if it's from my router, desktop, or TV – but I've come to accept it for the convenience of playing on the couch (usually with someone watching next to me).
I know some blame is on the TV, as often if I just hard-reset the worst of the lag spikes go away (clearly some background task is hogging CPU). And sometimes the sound system glitches and repeats the same tone until I reset that. Still worth putting up with for the couch.
Platformers tend to be a-ok, although anything with mouselook aiming tends to be really rough, since you rely so much harder on a tighter visual feedback loop for constant adjustments to aim.
Many moons ago (over 25 years) I was an EE hobbyist working with an inventor, working adjacent to a major game controller manufacturer. The controllers I was prototyping weren't getting polled by the OS. I was just using the USB HID Class and sending "Button Up" and "Button Down" messages using Interrupt Transfers. Are game controllers using Isochronous transfer now or is there some other method that's developed in the last quarter century?
This would be easier to do now that LLMs can learn to navigate web sites. Less custom code.
Also useful - measure it for point of sale systems.
My group has been looking into that topic, too¹. One of our most interesting findings (IMHO) was that for many USB devices, input latency does not follow a normal distribution but that each device has its own distribution of latencies for input events, including funny gaps².
However, with gaming hardware supporting 1000+ Hz polling, the effect of input latency should be negligible nowadays.
¹) https://hci.ur.de/projects/latency
²) https://epub.uni-regensburg.de/40182/1/On_the_Latency_of_USB...
I recall reading about a study years ago that showed while response times are limited to around 150ms between stimulus and say moving a finger, the participants could consistently time movements with an accuracy of less than 10 ms or so (I forgot the exact number).
Which I assume explains why consistent input lag is much better than variable input lag.