Hacker News new | ask | show | jobs
by nickjj 16 hours ago
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.

3 comments

I abandoned Windows for a variety of reasons and while I find Linux better in many ways, the graphics and compositing situation is a bummer. To add another example, I was trying to do a screen recording the other day and it was dropping frames like crazy. I don't know who to blame, whether it's Gnome, or Wayland, or OBS, or Nvidia. But the point is my confidence in the entire ecosystem is low. I have plenty of bad things to say about Microsoft, but I think their track record is quite good when it comes to making low latency input and graphics "just work."
I know what you mean about "just works".

With OBS recordings (not streaming) on Linux I occasionally get situations where short but heavy disk or network I/O will cause my webcam's video to get out of sync with my microphone (separate mic from the webcam). This makes it look like my lips are way out of sync with the video. It's something I haven't been able to track down as there's no errors or side effects posted in journald logs.

This is using vanilla Arch with niri. It happens pretty often and I fix it by splitting the audio and video in my editing tool and then shifting the audio track over half a second or so.

I recorded over 1,000 videos on Windows with the same hardware and the above never happened once.

Still on X11. OBS just works.
I've been using OBS on wayland, they got captures working really well a few years ago.

But for VR stuff I've been going back to X11, and I was just last night trying to finish a screen capture program on wayland (w/ kde plasma) and idk I just have to do repeated screenshots ana analyze those > horrible fps, but at least I think I got that working finally after many attempts last year.

Gaming is not really an issue now with DEs that help ppl disable compositions and wine/proton.

fwiw I’ve been running lots of stuff under niri with proton Wayland mode for the last ~6 months on nvidia with a vrr display and it’s been fine.

Can’t diagnose here, and not meaning any descent to your experience, just a different user experience for me.

This is endemic with open source. Nobody owns the hard bugs, nobody does the systems spelunking, and there is little power to make cross-cutting changes. This is why I use a Mac. Not perfect, but better than that no-accountability midden-heap that is Linux.

Maybe AI coding agents will make the situation better, but because open source maintainers are too dim to understand the complex changes the AI makes, and too poor to have their own AIs to help them, they won't take the changes. I make improvements to open source but am forced to keep them to myself.

Except GP said it works fine with all configurations with KDE, which is what most people should be using. I've been using Linux for 15+ years and have never heard of niri.
>which is what most people should be using

Most people should be running hundreds of megabytes of bloat?

KDE is unuseable on the brand new i3/8gb I run purchased last year.

I mean, the desktop renders, but god forbid I'd like to run more than three firefox tabs...