Repository navigation
Activate hosted plugins before restoring their saved state - #472
Open
ItsAlphaNeon wants to merge 2 commits into
Open
ItsAlphaNeon wants to merge 2 commits into
ItsAlphaNeon wants to merge 2 commits into
Conversation
Plugins::instantiate / instantiate_effect, which every path that starts an instance from a saved state goes through (project open, FLP import, undo, container members, sampler/recreation sync, native hosting), gave the plugin its state before activating it. A plugin that works its state out at the sample rate (VASTvaporizer2 divided by it) failed. They now share one start step: activate at the device rate (VST2 effSetSampleRate / effSetBlockSize / effMainsChanged, VST3 setupProcessing / setActive, CLAP activate), then load the state. Tests: a call-order probe plugin (os_session::order_probe, test builds only) that refuses a state before a rate; os-session checks every creation path in CLAP, VST3 and VST2 format, os-app checks a saved project reopened through FLP open + sync_wrapped and native hosting. Both failed before the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A state now reaches an already active instance, so the latency (and VST2 channel counts) read at activation can be stale. After a state loads on an active instance the host re-reads them; if they moved without the plugin signalling it (audioMasterIOChanged / restartComponent), the next idle sets the instance up again, as for a signalled change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plugins::instantiateandinstantiate_effectnow share one start step: activate at the device rate, then load the state. Activation covers VST2 effSetSampleRate / effSetBlockSize / effMainsChanged, VST3 setupProcessing / setActive and CLAP activate, and all three formats take a state while active.Fixes #458 (the load-order part; process isolation is still open)
Test plan
os_session::order_probetest plugin: it logs the order of host calls and refuses a state that arrives before a rate.saved_states_reach_plugins_after_activation(os-session): every creation path in CLAP, VST3 and VST2. It fails before the fix.reopened_projects_activate_plugins_before_their_state(os-app): FLP save → open → sync_wrapped, plus native hosting. It fails before the fix.cargo test --workspace --lockedon Windows: 2711 passed, 0 failed.🤖 Generated with Claude Code