logoalt Hacker News

nickjjtoday at 12:40 PM0 repliesview on HN

When I switched to Linux from Windows last year I noticed I had a lot of keyboard input latency only when gaming. It was like I had ~100ms of input latency and it felt exactly the same as playing old school Quake I on a dial up connection without client side prediction turned on. It's like you're skating on ice with a delay when seeing the output vs when you performed the input. This was despite having a solid 60 FPS.

Turns out it was due to a combination of things.

I was using niri (Wayland window compositor) and this input latency was present with or without v-sync turned on. It happened when I was using a 60hz 4k monitor with an NVIDIA GPU.

Then I tried playing the same game on a laptop (same distro and dotfiles) with an AMD GPU and no external monitor. The delay disappeared.

Then I played the same game on that laptop but hooked it up to the 4k monitor and I had the same keyboard input latency only when v-sync was enabled. When I turned off v-sync and capped my FPS then the input latency was reduced by an amount that I could no longer perceive the delay.

Then I put an AMD GPU in the original desktop I was testing and reproduced the same results as the laptop.

However, when I switched to using KDE Plasma with X or Wayland, the keyboard input latency disappeared. This was with the 4k monitor and both NVIDIA and AMD GPUs.

I reported it to niri but it hasn't gotten traction, I just know I can reproduce it on 2 completely different systems with different GPU vendors and hardware when the common ground is having a 4k 60hz monitor hooked up.