Skip to content

Fix #35454: Do not activate a VST before its processing is set up - #401

Open
manolo wants to merge 1 commit into
musescore:mainfrom
manolo:fix/vst-activate-before-setup
Open

manolo wants to merge 1 commit into
musescore:mainfrom
manolo:fix/vst-activate-before-setup

Conversation

@manolo

@manolo manolo commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Resolves: musescore/MuseScore#35454

VstAudioClient::ensureActivity() no longer activates the component until setupProcessing() has succeeded. A plugin that finishes loading after its track was switched on is activated by updateProcessSetup() once it is set up, as before. Exporting all parts of the score from the issue went from 4 complete exports out of 8 to 8 out of 8.

The parallel part export in #320 touches vstaudioclient.h next to this change but does not overlap with it.

  • I signed the CLA.
  • The title of the PR describes the problem it addresses.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code in the PR follows the coding rules.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.

Complete only if applicable:

  • I created a unit test or vtest to verify the changes I made.
  • This PR was created using AI assistance; I have read, understood and complied following the guidelines for AI-assisted contributions. The AI tool(s) I used are listed below.
    • Claude Code 2.1.306 (Claude Opus 5.5)

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

An instrument that finishes loading after its track was switched on, as
happens when exporting parts, was activated without setupProcessing() and
then processed with no output buffers.

Assisted-by: Claude Code 2.1.306 (Claude Opus 5.5)
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7a27874 and 62fb6f6.

Files selected for processing: 2
  • framework/vst/internal/vstaudioclient.cpp
  • framework/vst/internal/vstaudioclient.h

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

VstAudioClient now tracks whether processing setup has completed. It clears the flag when setupProcessing fails and sets it after process data is set up and buffers are flushed. ensureActivity now returns without activating the component or starting processing when the flag is false.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 62fb6

The change prevents VST activation before processing setup succeeds. No actionable merge-blocking regression remains established; the existing setup-retry and buffer-resize limitations are separate follow-up work.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the issue and the main change: preventing VST activation before processing setup completes.
Description check Passed The description includes the issue reference, motivation, implementation summary, test results, checklist, AI disclosure, and build configuration. The optional unit-test checkbox is correctly left unc…
Linked Issues check Passed The changes address #35454. updateProcessSetup() clears m_isProcessingSetUp when setupProcessing() fails and sets it only after process data and buffers are prepared. ensureActivity() now bloc…
Out of Scope Changes check Passed The PR changes only VstAudioClient setup state and activation gating in framework/vst/internal/vstaudioclient.cpp and .h. These changes directly support #35454. No unrelated behavior or files ar…
Full details: Description check

Explanation

The description includes the issue reference, motivation, implementation summary, test results, checklist, AI disclosure, and build configuration. The optional unit-test checkbox is correctly left unchecked because no unit test or vtest was reported.

Full details: Linked Issues check

Explanation

The changes address #35454. updateProcessSetup() clears m_isProcessingSetUp when setupProcessing() fails and sets it only after process data and buffers are prepared. ensureActivity() now blocks activation until that state is true. This prevents the reported pre-setup processing path. The reported export result also improved from 4/8 complete exports to 8/8. Issue #35454 does not require a specific automated test, and no test addition is reported.

Full details: Out of Scope Changes check

Explanation

The PR changes only VstAudioClient setup state and activation gating in framework/vst/internal/vstaudioclient.cpp and .h. These changes directly support #35454. No unrelated behavior or files are present in the reviewed diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash exporting parts to audio when a VST instrument finishes loading after playback was switched on

1 participant