-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Bail from score submission if audio playback rate is too far from reality #26138
Conversation
if (playbackRateValid.Value) | ||
{ | ||
playbackRateValid.Value = false; | ||
Logger.Log("System audio playback is not working as expected. Some online functionality will not work.\n\nPlease check your audio drivers.", level: LogLevel.Important); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be a localizable notification, as this is a user-facing string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i argue this is not important for now
https://github.com/search?q=repo%3Appy%2Fosu%20LogLevel.Important&type=code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an edge case that only 1 in 10000000 will see, but sure, at some opint. the main goal is just to ensure some validity before score submit to stop bugged drivers from submitting.
elapsedValidationTime ??= elapsedGameplayClockTime; | ||
elapsedValidationTime += GameplayClock.Rate * Time.Elapsed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work? If elapsedValidationTime
is null in a frame, doesn't this cause said frame to be double-counted?
I'd expect something closer to
if (elapsedValidationTime == null)
elapsedValidationTime = elapsedGameplayClockTime;
else
elapsedValidationTime += GameplayClock.Rate * Time.Elapsed;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that looks better. Good catch.
One other way to test this is to use my broken ass wasapi device switching patch and rapidly switch output devices until it breaks (it'll usually speed up when broken). And this does catch it, for whatever that's worth. So aside from the one doubt I have above, this appears to be doing the right thing as far as my somewhat limited testing shows. |
Closes #23149.
Values are ballparked (will trigger with ~1% rate difference over a 2.5 minute beatmap, ie.
300 * 5
total discrepancy). The count is added to avoid once-off discrepancies to not immediately cancel submission, ie. a large lag spike. This mostly matches how stable handles this.Can be tested using:
Dunno how to make automated testing for this. Probably not required?