Linux Gamers May Soon See Less Mouse Lag in KDE Plasma
Gamers using KDE’s Plasma desktop have been suffering from a slight input delay in mouse movement that could lead to getting fragged.
Four milliseconds. Count them: one, two, three, four. That's the lag KDE Plasma gamers have been experiencing in comparison to Windows with mouse input. It might not sound like much, but when your game is on the line, those four milliseconds count.
Turns out (as reported by XDA Developers) a curious developer, Jakub Okoński, discovered this lag on KDE Plasma and decided to do something about it. Using a very small microcontroller attached to a light sensor to send input to his test PC, Okoński then configured the setup such that the test "mouse" would perform an in-game action (such as shooting a gun in a low-light location within the game and then grabbing the light created by the flash).
Using this test, Okoński discovered that mouse movement in KDE Plasma was 4ms slower than it is on Windows and that the lag was due to three different sources: an imprecise timer, a safety margin, and a GPU expectation.
After some work, Okoński was able to shave off nearly 1.2ms from the lag. It's not much, but it's certainly a start. Hopefully, this discovery will launch a broader effort in the KDE Plasma community to get that lag down to zero. With Linux on the rise for gamers, anything that can be done to improve the experience should be considered a must.
You can read more details about this deep dive into the KDE Plasma lag where Okoński concludes, "These improvements go some of the way to closing the gap between Linux and Windows. There’s about 1.1-1.2ms gained in the minimums, while the gap between platforms in their best measurements with VRR was somewhere around 4ms."