Replies: 1 comment 1 reply
-
|
There are two ways discord could cause osu! to lag: delaying input or delaying rendering to the display. osu-framework has a multi-threaded design, so lag spikes on the draw (render) thread won't cause lag spikes on the input thread and vice-versa. If there is substantial lag, you should be able to tell whether it's input or draw lag by listening to audio feedback. The hypothesis is that misbehaving keyboard hooks cause input latency, and screen overlays draw latency. I've personally never had problems with input latency, even though I have a few programs with global hotkeys (including discord). I always disable the discord overlay, so can't have problem there. Input lagOn SDL3, we are using relative mouse mode which enables raw input, so input delay shouldn't happen there. Input delay can still happen with keyboards, as we're not yet using SDL_HINT_WINDOWS_RAW_KEYBOARD. We have very recently moved away from SDL2, so I won't focus on it (but it's worth mentioning that reported issues likely happened on SDL2). When a input lag spike happens, it's usually a call to SDL_PumpEvents taking a lot longer than usual, this can be detected in-game by looking at the input thread frame statistics overlay, specifically, white bars (for I assume discord is using Draw lagI know much less about this one, but we've had reports of users having bad latency, and disabling screen overlays usually fixes it. Not just with discord's, but also nvidia, overwolf, etc. Same idea goes here as well, try wasting CPU or GPU time when drawing the overlay to see if that makes osu! lag. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! I'm a software engineer at Discord.
Yesterday, we saw https://www.reddit.com/r/discordapp/comments/1tk4mut/discord_may_causes_systemwide_input_lag/ on Reddit about how Discord is causing input lag for games. Our desktop team is investigating and we thought it might be a good idea to engage here.
First of all, we're gonna work on making sure our hooks are not active if Overlay/Keybinds/whatever is not used. This should hopefully alleviate problems at the root.
But furthermore, we're also wondering if you have a pretty good reproduction of the issue? Or if you can share more details/hypothesis in your own investigation? We've been trying out SDL2 vs SDL3 in toy apps and we're not able to see much difference w.r.t input lag. We're wondering if this is some specific corner case (hardware? setup? load?) where this issue arises.
It would be really helpful if someone can point us at the specific APIs that were used before and after. It could be that the devil is in the implementation details and it can really help us narrow down what's happening on our side.
Beta Was this translation helpful? Give feedback.
All reactions