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

Enforce minimum gameplay sample volume of 5% #25185

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Oct 20, 2023

RFC. Addresses #25165 (comment)

As per my comment there, stable's sample volume floor is actually 8%, but it is enforced in what seem to be completely stupid ways (in the UI it's 5%, but actual playback takes place at minimum 8%). Since that seems weird and bad, and basically nobody seems to know about it (source: a brief discussion I had with the NAT today), and it seems there should be no harm in actually having the cap be 5% without weird gymnastics or lying to the users, that's what I ended up doing.

Testing resources

VolumeTesting.zip contains 3 beatmaps:

  • HitCircleVolume contains 25 hitcircles with 1 sec spacing, with volume ranging from 0 to 24
  • HitCircleSlider contains 15 sliders with 3 sec spacing, with volume ranging from 0 to 14
  • HitCircleSpinner contains 15 spinners with 3 sec spacing, with volume ranging from 0 to 14

taiko was also tested on HitCircleVolume to cover the GameplaySampleTriggerSource part of this diff.

Test results

Recordings obtained from playing back the beatmaps as WAV files are available here:

Recordings were captured via 'stereo mix' input on my windows box. Visual waveform comparison, for convenience:

test case result
circles circles_comparison
sliders sliders_comparison
spinners spinners_comparison
taiko taiko_comparison

Please disregard the weird tick spam on the spinners case. I'm not sure where that's coming from but it's pretty clearly not broken by this PR. I'll investigate the cause of this in more detail later. This is fixed by #25216.

@bdach bdach self-assigned this Oct 20, 2023
bdach added a commit to bdach/osu that referenced this pull request Oct 23, 2023
Noticed this during work on ppy#25185.

In some circumstances, it seemed that spinner bonus ticks (and mostly
them specifically) would not always play with the correct volume.
Hours of debugging later pointed at a trace at
`DrawableAudioWrapper.refreshLayoutFromParent()` not firing sometimes.

Initially I thought it to be some sort of framework bug, but after
preparing a diff and running final checks, I noticed that sometimes
the sample was being played *by a `PoolableSkinnableSample` that wasn't
loaded*. And determining why *that* is the case turned out with this
diff.

As it happens, spinner ticks get assigned a start time proportionally,
i.e. the 1st of 10 ticks is placed at 10% of the duration, the 2nd
at 20%, and so on. The start time generally shouldn't matter,
because the spinner is manually judging the ticks. *However*, the ticks
*still* receive a lifetime start / end in the same way normal objects
do, which means that in some cases they can *not be alive* when they're
hit, which means that the `DrawableAudioWrapper` flow *hasn't had
a chance to run*, and rightly so.

To fix, ensure that all spinner ticks are alive throughout the entirety
of the spinner's duration.
@peppy peppy self-requested a review October 24, 2023 13:01
Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think this will do for now!

@peppy peppy merged commit 34505b3 into ppy:master Oct 24, 2023
@bdach bdach deleted the minimum-sample-volume branch October 24, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants