BASS_Mixer_ChannelGetPosition reporting incorrect time at a single moment

Started by Salman Ahmed,

ppy

We've deployed this to our testing branch and results are very positive so far!

One issue we've noticed is that iOS is no longer playing audio. Will continue investigating from our end but just letting you know ahead of time.

BASS faulted with error code 20: Parameter.

Update: It seems this is on us for expecting a singular "default" device to exist which is not the bass "Default". Previously on iOS, a "Voice" device would be returned which satisfied this check, but this device is no longer appearing in the list, causing things to fall over. We can fix this from our end, but are curious if there's a reason for this change or a paper trail we can follow.

Ian @ un4seen

Yeah, the separate "Voice" output device option on iOS has been removed for BASS 2.4.18, and replaced with a new BASS_DEVICE_APPLEVOICE flag that can be used with the "Default" device. The "Voice" device was never actually a documented feature, just something that was added on request for testing.

It'll usually be fine to simply swap in a new BASS version without any code changes, but there may be things that need attention in some cases, which are noted in the "Upgrading" section of the documentation. If you would like to check it, the latest documentation is available here:

    www.un4seen.com/stuff/bass.chm

Let me know if you have any questions.

ppy

Thanks, I usually read the changelog but must have missed this one.

Also unfortunately users have found another very weird issue which reflects very closely the first issue reported in this thread: reported track time seems to be jumping *forward* out of nowhere now.

track time: 20,000ms

# gameplay enter, pause via mixer pause flag, seek via SetPosition to zero

track time: 0ms

# unpause
# seek to gameplay start point. audibly this is correctly playing in the user's video.
track time: 2000ms

# audio is still correct up to this point.
# but out of the blue, our logging reports a time elapsed in a single frame of over 10 seconds
track time: 20428ms

# then it recovers
track time: 2200ms

I haven't been able to reproduce this in an isolated test. It is reportedly only happening for certain audio files (a few samples here: https://github.com/ppy/osu/issues/26879#issuecomment-3187856724).

Given it's very similar to the original issue, I'm kind of hoping you have some ideas on how it could occur since we're drawing a blank so far 😅

Ian @ un4seen

That problem doesn't seem like it would be something file-specific. One possible issue I see is the order of the "unpause" and "seek to gameplay start point" steps - they should probably be the other way round, ie. seek before unpausing. If the problem still happens, please confirm the exact sequence of function calls involved, and the BASS_GetVersion and BASS_Mixer_GetVersion values (BASS_FX_GetVersion too if BASS_FX is involved).

ppy

Thanks for the response Ian.

The "seek to gameplay" happens as the result of a user pressing a "skip intro" button, so it's not immediate.

I'll continue to attempt to figure a reproduction case.

Ian @ un4seen

Oh, I see. Are you able to reproduce the problem yourself in the game but not in a separate test, or not at all? If you can reproduce it then I could send you debug BASS/BASSmix versions to get more info. To narrow it down a bit first, please try excluding BASS_FX (if it is currently involved).

ppy

Unfortunately I haven't been able to reproduce yet ☹️ it's a very rare one.