Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circles progressively get more offset from the audio #12056

Closed
Tracked by #24811
smoogipoo opened this issue Mar 18, 2021 · 20 comments
Closed
Tracked by #24811

Circles progressively get more offset from the audio #12056

smoogipoo opened this issue Mar 18, 2021 · 20 comments
Labels
audio osu!framework issue Can't resolve this without changes to osu!framework. priority:2 Moderately important. Relied on by some users or impeding the usability of the game

Comments

@smoogipoo
Copy link
Contributor

smoogipoo commented Mar 18, 2021

Originally reported in ppy/osu-stable-issues#306

It looks like users also experience this in osu!lazer, but neither me nor @peppy can reproduce it. It's likely a BASS fix or a config setting for it that o!f can set, but we need someone that can replicate this and is able to debug, report to BASS (if required), and fix the issue.

I'm putting a minimum $150 bounty on this, because it's something that will hold back osu!lazer from replacing osu!stable for a worryingly large number of users.

@smoogipoo smoogipoo added osu!framework issue Can't resolve this without changes to osu!framework. audio priority:1 Very important. Feels bad without fix. Affects the majority of users. labels Mar 18, 2021
@harshavb
Copy link

Probably should add a bounty label.

@peppy
Copy link
Member

peppy commented Mar 18, 2021

We can offer a bounty of up to $500 on this depending on difficulty of solution and implementation quality, for sure.

@vernonlim
Copy link

it's not directly relevant to this issue, but I wonder if this is related to the latency issues I experience detailed in #11763. I'll check on it if someone finds a solution.

@AlexCatDev

This comment has been minimized.

@shaneMenzies
Copy link

I believe I have been able to recreate this bug, which seems to be caused by Windows' Audio management keeping BASS from being able to set certain device properties itself, and instead using whatever the system chooses to, specifically on Device update period and buffer length ( sources here and here ). This also lines up with previous statements of reinstalling Windows or moving to the 2016 BASS dll, since the functionality to change the device update period only came to BASS in January 2019 (source), so I suspect that some change in how BASS interacts with that was significantly changed at that point.

Luckily there is BASSWasapi, which allows these settings to be controlled through requests to the windows audio session, and with implementing Wasapi.Init(), it is possible to specify these values as shown in this video, where I first set both values to a massive 1000ms to exaggerate the offset more, but I found lower combinations here to be fairly similar to what was originally reported.

I have placed a pull request in osu-framework to address this issue by including ManagedBass.Wasapi and adding a little bit of logic in InitBass to try to Initialize through Wasapi first on Windows systems, with set values that seem to be known to work (10ms Device buffer and 5ms Device Update Period), before falling back to the same method currently used if Wasapi fails. It can be found here. I'm not particularly experienced with C# myself, so feel free to let me know if there are better ways of implementing this, but I hope my investigation was useful nonetheless.

@peppy
Copy link
Member

peppy commented Mar 27, 2021

Thanks for your investigation. This sounds like something we'd want to report to bass, in addition to (or instead of) working around. If you feel confident, i'd suggest also opening a bug report thread on the un4seen forums stating what you've found so far. The dev will likely be able to use only the information you've given here to figure something out.

@shaneMenzies
Copy link

Done. I will update here when we get a conclusion.

@peppy
Copy link
Member

peppy commented Mar 29, 2021

I'm not sure the report you've made at bass is going to be easy to comprehend. You might want to mention the actual issue, which is desync of the clock or whatever it turns out to be.

Or put differently: the update period / buffer length changes potentially not propagating still should not lead to desynchronisation. You might find that the values not propagating is not the cause but a side effect of whatever is going wrong for your hardware/software.

@peppy
Copy link
Member

peppy commented Mar 30, 2021

@shaneMenzies are you 100% sure what you are seeing is the same issue as the opening post? Can you make a video showing the audio offset getting worse over time?

@shaneMenzies
Copy link

Hmmm, looking back at some of the original videos of the issue do seem to very clearly have it start out fine and get worse over time, were as from what I was looking at it's more of a flat delay on all sounds, so I'm starting to feel more like I was wrong in saying that I was able to replicate the issue. Sorry about that.

@smoogipoo smoogipoo added priority:2 Moderately important. Relied on by some users or impeding the usability of the game and removed priority:1 Very important. Feels bad without fix. Affects the majority of users. labels Sep 13, 2021
@peppy
Copy link
Member

peppy commented Jul 1, 2022

@OniCado
Copy link

OniCado commented Aug 12, 2022

Today i was testing if multithreading affects this issue after looking at #10885 and noticed that (for me) the issue gets progressively worse over the entire session, when just starting lazer a short map may be completely playable, but after trying again the offset will already be significant at the start of the map. Pausing the map does not seem to help/reset the issue. Using Audio Compatability Mode in Stable for similar reasons. Multithreading does not seem to have any influence on it.
Windows 10 Pro N 21H2 Build 19044.1826

@peppy
Copy link
Member

peppy commented Aug 12, 2022

Thanks for the information, but this unfortunately brings nothing new to the table in terms of figuring what causes this.

@yoyyoy
Copy link

yoyyoy commented Jan 21, 2023

This may be related but I'm not sure. for me, the longer osu!lazer runs, the more positive offset I need. Here's an example of what can happen. The first part is after letting lazer idle on the main screen for about an hour, second part is immediately after restarting lazer, third is both played at the same time.

https://youtu.be/KNELkUuuDoM

It seems to be caused by the first circle being stuck on something, While the song plays without any delay, thus offsetting the circles. The actual audio isn't delayed like I can still hear all the hit sounds instantly. Note that in the example, when both clips are playing I had the audio play in each ear and the song synced up perfectly in both.

Side note, this didn't happen the first time I launched osu!lazer after a windows update even after 3 hours of playing, but the second time I played it happened. So it looks like that the first time launching lazer after a reboot everything works fine but something isn't cleaned up and messes things up after launching again

@peppy
Copy link
Member

peppy commented Jan 23, 2023

This is definitely going to be something low-level in bass that we're going to have to first isolate, then report to Ian.

It may also lead to a solution (or better understanding) for ppy/osu-stable-issues#306, although those cases look to be over the span of one beatmap play, rather than a long game session.

If what you claim is happening is actually happening, the only possibilities are:

  • Bass is reporting incorrect time to us
  • Your audio driver is reporting incorrect time to bass

@peppy
Copy link
Member

peppy commented Oct 13, 2023

Is anyone subscribed to this thread still experiencing this issue actively? Have things gotten any better as of recent releases? We've made some large changes in how time interpolation handles on our end, and while I doubt it will solve this issue, I'm interested to hear back from anyone still dealing with this.

@yoyyoy
Copy link

yoyyoy commented Oct 14, 2023

personally, the issue I've been having has been resolved. been exclusively playing lazer ever since that august patch and it hasn't happened since

@peppy
Copy link
Member

peppy commented Oct 16, 2023

That's great to hear. @yoyyoy do you remember which patch particularly fixed this?

@yoyyoy
Copy link

yoyyoy commented Oct 16, 2023

it was right after watching the lazer updates video on august 11th. I was a day late to that so 2023.812.0 is the patch I played on. but if I had to guess it was probably 2023.803.0 that actually fixed it

@peppy
Copy link
Member

peppy commented Oct 17, 2023

Thanks for the info. I'll tentatively close this as resolved.

@peppy peppy closed this as completed Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio osu!framework issue Can't resolve this without changes to osu!framework. priority:2 Moderately important. Relied on by some users or impeding the usability of the game
Projects
None yet
Development

No branches or pull requests

8 participants