If you’d like to know more about this bug, I’ve had it before, here’s another post of mine showing it: https://lemm.ee/post/63660749
If you’d like to know more about this bug, I’ve had it before, here’s another post of mine showing it: https://lemm.ee/post/63660749
This particular bug (from the OP) only affects games that use a lot of rapid mouse and keyboard inputs over the period of an hour or two.
And it only happens (weirdly) when you launch from steam, but have Steam Overlay turned off.
When launching from Steam, there is a layer that captures all keyboard and mouse inputs before they get to the game (for example, for capturing hotkeys to show the steam overlay). A separate layer called vulkan-steam-overlay (that is responsible for rendering the overlay over the game) periodically clears the input buffer so it doesn’t get too big. If steam overlay is disabled in settings, the input-capture layer is still used, but the vulkan-steam-overlay layer is not used. So the input buffer captures all inputs and never gets cleared, it gets so big it needs to start paging to disk. That is what introduces the lag spikes after an hour or two.
Launching from Lutris doesn’t use that input-capture layer, so that’s why it’s not affected.
I play Cult Of The Lamb with mouse and keyboard and the Crusades (basically sequences of fighting arenas) tend to be kinda insane in terms of the intensity with which you have to use them, so it makes total sense.
By the way, thanks for the very complete explanation.
My gut feeling told me it was some kind of memory leak (because those things tend to manifest themselves after some time of using the software, with some randomness on how long it takes for it to happen) but when I looked around I couldn’t find an explanation of its mechanism.
By the way the suggested workaround of adding LD_PRELOAD=“” in the Launch Options for the game seems to work.
Maybe the way those input capture layers work is by putting their input handling methods ahead of the default ones via LD_PRELOAD and forcing LD_PRELOAD to be empty means they’re not in the input processing pathway anymore?! (In all fairness, I can’t be arsed to dive into that codebase ;))