Live data from Hacker News

Linux latency measurements and compositor tuning

farnoy.dev

41–47 of 47 posts

Re: Linux latency measurements and compositor tuning

#41
post #39
post #15

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…

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.

Just throwing this out there but do you happen to have dual monitors where 1 of them is a 4k monitor and the other is not?

Re: Linux latency measurements and compositor tuning

#42
post #16

I think this is only the top of the iceberg. I say that because I play some timing tight action games natively on elf(glibc)/linux. Let's take an example with one of the toughest: Silksong. I was trying to beat lost lace, her timings were too tight and nearly at each try I was locked in some hardly humanly dodge-able pattern combination. I knew all of her patterns by heart after zillions of tries. Then, I started to…

> I am running a Zen2, 12 cores at ~4GHz... and native x11 with xorg, sooo... the main culprit seems to lie in game engine programming and then would not completely tied to wayland programming (don't worry, I am coding my own wayland compositor, so, I am going to move to wayland, well actually designing a 'binary layout' for a wayland compositor to be accurate). FWIW, I have similar frame pacing issues with Gnome/Mut…

In the end, I have strong suspicions on the unity game engine, some weird 'timing' stuff would be happening here, which would disrupt the boss pattern 'timings'. In your case, it seems it is "amplified" by the wayland compositor you are using (I guess you tested various compositor libraries, because many are based on the same libs... where could be hidding some latency, like is xorg but a bit more accute).

But as I said, in my personal case, I have to account for my stress intolerance which is significant, which does not help narrowing down those type of issues. Then, I am probably not one of the right guys to figure out that, but I'll do tests here and there to see if I can get some pertinent info.

I suggest you do the same than me anyway: shutdown all apps, and disconnect your network cable.

Re: Linux latency measurements and compositor tuning

#43
post #38

Earlier quoted context omitted.

Would you mind elaborating why? What makes it more important than other inputs?

Executing other actions isn't a feedback loop like moving the mouse pointer; for the mouse pointer you need the feedback from the system before you even get to an actual action. You can press keys on a keyboard blindly, if it doesn't matter where you can even click blindly, but you can't position the pointer blindly. It's closed loop vs. open loop.

Of course you can position the pointer blindly, it's not moving in an unpredictable way.

Re: Linux latency measurements and compositor tuning

#44
post #31

Earlier quoted context omitted.

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 poo…

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.

Take this as a sign that you're out of the loop and your bubble is smaller than you thought. niri is the current hot tiling compositor, and I've switched my laptop over to it recently - away from Plasma - because it's so incredibly slick. It's gathered enough mindshare to have several desktop environments explicitly target it (Dank Material Shell, Noctalia).

In fact there's a whole new cultural wave within open source - tiling Wayland compositors, shockingly featureful DEs based on QuickShell, brand new TUI tools with no CLI or GUI equivalents, and most of it written in Rust.

Re: Linux latency measurements and compositor tuning

#45
post #38

Earlier quoted context omitted.

Executing other actions isn't a feedback loop like moving the mouse pointer; for the mouse pointer you need the feedback from the system before you even get to an actual action. You can press keys on a keyboard blindly, if it doesn't matter where you can even click blindly, but you can't position the pointer blindly. It's closed loop vs. open loop.

Of course you can position the pointer blindly, it's not moving in an unpredictable way.

If you genuinely believe that, I invite you to look up the linearity specification on a few mice and trackpoints and post them here.

Re: Linux latency measurements and compositor tuning

#46
post #45

Earlier quoted context omitted.

Of course you can position the pointer blindly, it's not moving in an unpredictable way.

If you genuinely believe that, I invite you to look up the linearity specification on a few mice and trackpoints and post them here.

And if you look at your motor neurons under a microscope it all looks like chaos too.

Re: Linux latency measurements and compositor tuning

#47
post #6

> There it was, something about my desktop profile was introducing at least 3 ms of latency [as compared to creating a fresh account]! From here, I tried a bunch of things: plasma-manager to diff my existing profile against a clean one, removing all virtual desktops and disabling all KWin effects and any display scaling. While randomly closing apps, I found the culprit: the Zed editor. Apparently, an open Zed window…

Welcome to Wayland. Every frame is perfect, so if we can't make the frame perfect right now, we'll wait until we can. It constitutes a denial of reality.
Post reply on HN