Skip to content

Implement fast FMOD bank loading#1079

Merged
maddie480 merged 3 commits intoEverestAPI:devfrom
DashingCat:fast-fmod-bank-loading
Mar 8, 2026
Merged

Implement fast FMOD bank loading#1079
maddie480 merged 3 commits intoEverestAPI:devfrom
DashingCat:fast-fmod-bank-loading

Conversation

@DashingCat
Copy link
Copy Markdown
Contributor

@DashingCat DashingCat commented Jan 21, 2026

This PR implements "Fast FMOD Bank Loading" (like Fast Texture Loading, but for FMOD banks).

It relies on a non blocking bank loading API in FMOD.

The implementations loads all banks in parallel using the non blocking API, pool until all banks are loaded, and then do the same post processing of banks.

This implementation was tested against duplicated GUIDs (with duplicated bank files), which logs a warning; and with invalid bank data (with a truncated bank file), which logs an error (previously throwing an exception).

Right now, the non blocking implementation is enabled by default, and loading state is pooled every 100ms.

On my end, this reduced audio loading time when loading the "Strawberry Jam Collab", from about 6 seconds when using blocking loading, to less than 1 second when using non blocking loading.

@DashingCat DashingCat force-pushed the fast-fmod-bank-loading branch from 46152f0 to afa827d Compare January 21, 2026 19:13
@DashingCat DashingCat marked this pull request as ready for review January 21, 2026 19:46
@maddie480-bot maddie480-bot added the 1: review needed This PR needs 2 approvals to be merged (bot-managed) label Jan 21, 2026
Copy link
Copy Markdown
Member

@JaThePlayer JaThePlayer left a comment

Choose a reason for hiding this comment

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

From the remarks at https://documentation.help/fmod-studio-api/FMOD_Studio_System_LoadBankFile.html

Failed asynchronous banks should be released by calling Studio::Bank::unload.

Comment thread Celeste.Mod.mm/Patches/Audio.cs Outdated
Comment thread Celeste.Mod.mm/Patches/Audio.cs Outdated
Comment thread Celeste.Mod.mm/Patches/Audio.cs Outdated
Comment thread Celeste.Mod.mm/Patches/Audio.cs Outdated
@maddie480-bot maddie480-bot added 2: changes requested This PR cannot be merged because changes were requested (bot-managed) and removed 1: review needed This PR needs 2 approvals to be merged (bot-managed) labels Jan 21, 2026
@DashingCat
Copy link
Copy Markdown
Contributor Author

Thanks @JaThePlayer for the feedback, I addressed it in the latest commit.

Copy link
Copy Markdown
Member

@JaThePlayer JaThePlayer left a comment

Choose a reason for hiding this comment

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

I've noticed that the IngestNewBanks method in this class has an exact copy-paste of the last bit of Init() that's being changed in this PR, so it would be good to move those changes to IngestNewBanks and make Init call that method instead.

Comment thread Celeste.Mod.mm/Patches/Audio.cs Outdated
Comment thread Celeste.Mod.mm/Patches/Audio.cs Outdated
Comment thread Celeste.Mod.mm/Patches/Audio.cs Outdated
Comment thread Celeste.Mod.mm/Patches/Audio.cs
@DashingCat
Copy link
Copy Markdown
Contributor Author

Thanks again for the feedback, I addressed it in the latest commit.

This PR now introduces a behavioral change: failing to load a bank no longer throws an exception, but logs an error instead.

Copy link
Copy Markdown
Member

@JaThePlayer JaThePlayer left a comment

Choose a reason for hiding this comment

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

My testing in SJ, seems to work fine, including with invalid banks:
Pre-PR: - AUDIO LOAD: 6903ms
Post-PR: - AUDIO LOAD: 1014ms

@maddie480-bot maddie480-bot added 1: review needed This PR needs 2 approvals to be merged (bot-managed) and removed 2: changes requested This PR cannot be merged because changes were requested (bot-managed) labels Jan 23, 2026
@maddie480-bot
Copy link
Copy Markdown
Member

The pull request was approved and entered the 3-day last-call window. Since no PR should be merged within 3 days of the next rolling release, the last-call window is extended further.
If no further reviews happen, it will end on Mar 8, 2026, 12:00 AM UTC, after which the pull request will be able to be merged.

@maddie480-bot maddie480-bot added 3: last call window This PR was approved, and is in the 5-day last-call window before getting merged (bot-managed) and removed 1: review needed This PR needs 2 approvals to be merged (bot-managed) labels Mar 1, 2026
@maddie480-bot
Copy link
Copy Markdown
Member

The last-call window for this pull request ended. It can now be merged if no blockers were brought up.

@maddie480-bot maddie480-bot added 4: ready to merge This PR was approved and the last-call window is over (bot-managed) and removed 3: last call window This PR was approved, and is in the 5-day last-call window before getting merged (bot-managed) labels Mar 8, 2026
@maddie480 maddie480 merged commit 0672396 into EverestAPI:dev Mar 8, 2026
3 checks passed
maddie480 added a commit that referenced this pull request Apr 5, 2026
maddie480 added a commit that referenced this pull request Apr 5, 2026
maddie480 added a commit that referenced this pull request Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4: ready to merge This PR was approved and the last-call window is over (bot-managed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants