Comment by nickjj
2 days ago
Thanks, I have tried gamescope but it kills the performance of games for me. All games have a lot of stuttering when I use it. It also didn't reduce the input latency. Same hardware is liquid smooth on Windows.
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.
Are you perhaps being bit by Linux's default 2s USB-autosuspend? I bump that to 30s (60s?) in my kernel command line arguments
It is set to 2 seconds based on `cat /sys/module/usbcore/parameters/autosuspend` but the input latency only happens in games. Outside of games it's fine. Also in game, if I continue to press keys faster than waiting 2 seconds, it still lags.
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.