ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.3k stars 2.27k forks source link

Beatmap desync / fluctuating offset after changes to filesystem (e.g. downloading/deleting beatmaps) #29974

Closed xSilverriderx closed 4 weeks ago

xSilverriderx commented 1 month ago

Type

Performance

Bug description

After downloading or deleting multiple beatmaps, elements in osu mode start to spawn later and later. Starts almost unnoticable, but gets worse over time. Restarting the game or changing the used audio device fixes the behaviour, but problem reappears after again downloading/deleting beatmaps. All changes to filesystem are done the official way, in-client.

Steps to reproduce:

  1. Download or delete multiple beatmaps (~10 for me)
  2. Keep the game open, don't change settings, keep playing beatmaps. For me, the issue started really getting noticeable after ~15 Beatmaps, with the offset needed to correct it being between -50ms to -60ms, although I've seen it get as high as -85ms. Values meaning, offset to force the Beatmap elements to spawn earlier (audio ahead of beatmap).

Steps to workaround found:

Video included is of the state the bug got me to after about 30min past deletion operations. I've included me restarting the client to show offset is not static and/or directly system related.

PC specs: AMD Ryzen 9 7950X3D Asus ROG STRIX B650E-F GAMING WIFI 64GB RAM (Kingston KF560C36-32) NVIDIA GeForce RTX 3080 Samsung 990 PRO SSD (.m2 slot) Windows 10 Home 22H2 - 19045.4894

Screenshots or videos

https://youtu.be/KnrtqnRYXZA

Version

2024.906.2-lazer

Logs

compressed-logs.zip

peppy commented 1 month ago

This has been reported in various fashions multiple times. I don't think it can be related to "changes to filesystem". If anything, it would more likely be "after changing audio tracks many times". Can you reproduce by changing tracks many times without downloading or importing? ie. just playing the game normally.

xSilverriderx commented 1 month ago

Retested: You're right. The issue happens regardless of changes to filesystem. It seems to take about 1-1.5h of gameplay or around 10-15 maps for it to become easily and clearly noticeable for me. Now I'm curious why it's happening now. Not too long ago, I played 3h+ of multiplayer without any issue whatsoever on lazer. Right now, I'd have to restart the client every 3-5 maps for my accuracy to not completely go down the drain.

EDIT: Did some additional tests.

So, seems the problem is not just the number of audio track changes, but rather something about runtime.

peppy commented 1 month ago

We've had countless reports of this over the years, including in stable.

I just got another via email:

Another observation, there seems to be "offset drift" the longer I'm playing the game, there is more delay accumulating over time. When quickly changing audio output device and back, it seems like the offset is reset again.

We're either doing something very wrong (leaking bass handles? i dunno) or bass is borked.

peppy commented 1 month ago

@xSilverriderx could you also try at the main menu and see if it's the same as being at song select? also do you think it's 100% relative to time the game was open? ie. does playing many maps result in roughly the same offset as sitting at song select for the equivalent time period?

peppy commented 1 month ago

Also if you only found this happening on recent releases, it would be invaluable to have you test older releases to check whether it broke in a specific release.

You can download older releases from https://github.com/ppy/osu/releases (grab install.exe) but note that after one run they will update to the latest version, so don't restart after running the installer.

xSilverriderx commented 1 month ago

@xSilverriderx could you also try at the main menu and see if it's the same as being at song select? also do you think it's 100% relative to time the game was open? ie. does playing many maps result in roughly the same offset as sitting at song select for the equivalent time period?

Main menu definitely is the same as being at song select. Also, I feel like offset should be relative to the time the game was open, but I'll see if I can find a way to more accurately test this than based on my hearing. Lots of potential for human error right now. But just going from what I recorded/noted the past two days: sitting in song select/menu for an hour results in about 50ms-60ms offset and I first start feeling like maps are off at about 35 minutes, with an offset of about 30ms. This is more or less consistent with my findings from the "starting maps for 30s" test. I'd need to find some sort of test automation for better numbers. I can definitely say that playing 10 maps with duration of an hour or playing none at all and sitting in menu/song select for an hour results in the same offset of ~50-60ms.

Also, will check out old versions, although this might take me some days, due to a minimum of 30 minutes needed per version. Will report back with any new findings.

peppy commented 4 weeks ago

Also you may be able to just leave the game running overnight for easy "automated" testing?

xSilverriderx commented 4 weeks ago

Tried out several old versions today (last known good: 2024.718.1, first used altogether: 2023.1026.0, multiple other versions inbetween) only to find out that even the first lazer build I used personally still had the same issue, although taking some more time to ramp up (2h vs 1h). This led me to believe that it had to be something else than just Osu lazer, even though Osu!Std and also every other game work just fine. For context, I swapped some parts of my hardware (mainboard, CPU, RAM) earlier this year in may. As this hardware swap didn't immediately trigger the issue, I started suspecting some driver or windows update might be at fault. I tried several different driver versions, but sadly, still without finding a culprit. I'll try and install a dedicated soundcard tomorrow to completely rule out my current sound driver/chip.

Are there any programs known to cause problems with lazer, that don't interfere with Osu!Std? I didn't have anything opened apart from some driver controls (Nvidia control center etc.) while testing, but since I can't currently rule out something else causing the issue, I guess it wouldn't hurt to check. The only other program I installed between my last known good and today would be LogMeIn Hamachi, if the soundcard swap doesn't fix the issue, I guess I'll uninstall that one for my next test.

peppy commented 4 weeks ago

See https://github.com/ppy/osu-stable-issues/issues/306 lol

xSilverriderx commented 4 weeks ago

Can report this fixed for me (gameplay for 3h- no offset). Lots of thanks for helping me figure this out peppy! I'll mark this closed, but if you want me to test anything else, I'll gladly do that.

Turns out my hunch in suspecting some "driver" update was right. I installed a PCIe soundcard today I still had, tested Osu - the issue persisted. So I had a look at what drivers were loaded while playing Osu using latencymon, and noticed that my system still had all mainboard soundchip drivers active, even while using the soundcard. Additionally, I noticed some strange drivers related to a software named "Sonic Studio III" or "Sonic Studio Mixer" loaded. I didn't recognize that, so it immediately stood out for me. After some google I found out it's some kind of bloatware Asus likes to install with their Realtek audio drivers, and that's also known to mess with games or cause problems with audio in general. It must have installed itself with some driver update, without me noticing, and I'm pretty sure that's what messed up Osu lazer. Also, it's an absolute hell to try and uninstall. I ended up having to boot in Windows savemode and manually delete all installed audio drivers with driver store explorer, then disable my mainboard soundchip in BIOS and only install the drivers for my PCIe soundcard to completely get rid of it. So if anyone comes upon this trying to fix it here's what helped for me:

I guess if someone were to find a way to prevent Asus from being able to force install Sonic Studio with every audio driver update, that would work too. I just didn't want to deal with it, as I found numerous people complaining about Sonic Studio messing up their system even after they uninstalled the software, and I had that soundcard anyway. So, here's hoping the problem doesn't come back every single driver update this way.

peppy commented 3 weeks ago

Great to hear you resolved the issue.

Would be interested to know precisely which part of your fix process actually fixed it (I doubt all those steps are required).

xSilverriderx commented 3 weeks ago

Great to hear you resolved the issue.

Would be interested to know precisely which part of your fix process actually fixed it (I doubt all those steps are required).

Force deleting all drivers related to Sonic Studio (A-Volute, Nahimic, Sonic Studio) from my system is what actually fixed it.

Sonic Studio installs a bunch of virtual audio devices to offer "sound improvements". Even if you disable all of these improvements and don't use the virtual audio devices, there seems to be an equalizer device bundled with the software that grabs all sound on your system before passing it on to the actual driver, that you can't uninstall via the Asus-provided uninstallers but only in device management, that auto-reinstalls after each system reboot if uninstalled this way, and that severely cripples your entire system audio if you instead deactivate it in device management. The only way to permanently get rid of that device is deleting the associated drivers. At that point the problem is fixed, until the Realtek driver control redownloads and reinstalls the entire thing, starting the process all over again.

I'm fairly certain there's another way to go about stopping the cycle, basically one would have to find basic Realtek drivers for the soundchip that don't come from Asus and then possibly disable automatic driver download from Windows Update. If you read into Sonic Studio you find numerous people struggling with exactly that, this being the reason I decided to go the harsh way and disable that soundchip altogether.