Skip to content

Fix setting flushing for DISTRHO-based VST plugins - #11895

Merged
saintmatthieu merged 1 commit into
audacity:masterfrom
saintmatthieu:11892-fix-unwarranted-plugin-setting-resets
Sep 16, 2026
Merged

saintmatthieu merged 1 commit into
audacity:masterfrom
saintmatthieu:11892-fix-unwarranted-plugin-setting-resets

Conversation

@saintmatthieu

@saintmatthieu saintmatthieu commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #11892

See the ticket for an introduction.

For devs: in our VST3 implementation we use a Process call to flush our setting changes to the plugin. If done during playback, no problem, but when we're idle, we're making this call with null input and output pointers and zero frame size.
While the VST3 standard allows this, the DISTRHO plugin framework (used by many plugins on Linux) early returns when that's the case:
https://github.com/DISTRHO/DPF/blob/4238e1c7f0351bbe488d79f0899c540543ac7583/distrho/src/DistrhoPluginVST3.cpp#L1458
Meanwhile, the code that evaluates the input parameters is further down: https://github.com/DISTRHO/DPF/blob/4238e1c7f0351bbe488d79f0899c540543ac7583/distrho/src/DistrhoPluginVST3.cpp#L1558

Provided that it's approved, this fix may be cherry-picked to AU3.

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Beside the particular bug, please test the same thing on Windows and Mac with one VST plugin each

@saintmatthieu saintmatthieu self-assigned this Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The VST3 integration adds a shared VST3Utils::CountChannels helper for filtered bus channel totals. VST3Instance uses this helper for audio input and output counts. VST3Wrapper replaces zero-sample processing calls with ProcessSilentBlock, which sends a short silent block to the processor during initialization, finalization, and parameter flushing.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VST3Wrapper
  participant VST3Utils
  participant VST3Processor
  VST3Wrapper->>VST3Wrapper: ConsumeChanges(settings)
  VST3Wrapper->>VST3Utils: CountChannels(main input and output buses)
  VST3Utils-->>VST3Wrapper: Input and output channel counts
  VST3Wrapper->>VST3Processor: Process(silent buffers, limited sample block)
  VST3Processor-->>VST3Wrapper: Process completed
Loading

Merge Risk: 🟡 Moderate · up to e8498

The PR changes idle parameter delivery to use silent audio processing, but initialization and finalization can also process and save plugin state when no changes are pending, and processing failures may be ignored. This could cause unintended plug-in state changes or inconsistent lifecycle behavior, so merge should wait for the guard and explicit handling of processing failures.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #11892 by processing a short silent block instead of using a zero-sample Process call. This allows DISTRHO-based plugins to apply parameter changes during playback, reopening…
Out of Scope Changes check ✅ Passed The changes are limited to VST3 parameter flushing and the shared channel-count helper required to process silent audio buffers. No unrelated changes are evident.
Title check ✅ Passed The title clearly describes the main change: fixing setting flushing for DISTRHO-based VST plugins.
Description check ✅ Passed The description identifies issue #11892, explains the DISTRHO zero-sample processing problem, describes the motivation, and completes the required checklist. The QA test request remains unchecked, but…
Full details: Linked Issues check

Explanation

The changes address issue #11892 by processing a short silent block instead of using a zero-sample Process call. This allows DISTRHO-based plugins to apply parameter changes during playback, reopening, and project save/reload workflows.

Full details: Description check

Explanation

The description identifies issue #11892, explains the DISTRHO zero-sample processing problem, describes the motivation, and completes the required checklist. The QA test request remains unchecked, but the description is otherwise complete and relevant.

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 661bc379-c259-48dc-936b-e3d8183012ec

📥 Commits

Reviewing files that changed from the base of the PR and between 9c89deb and e849820.

📒 Files selected for processing (5)
  • au3/libraries/au3-vst3/VST3Instance.cpp
  • au3/libraries/au3-vst3/VST3Utils.cpp
  • au3/libraries/au3-vst3/VST3Utils.h
  • au3/libraries/au3-vst3/VST3Wrapper.cpp
  • au3/libraries/au3-vst3/VST3Wrapper.h

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread au3/libraries/au3-vst3/VST3Wrapper.cpp Resolved
@luapmartin

Copy link
Copy Markdown
Contributor

I guess those issues aren't surfacing when any of those is true:

  • monitoring is enable
  • metering is enable
  • in pause state

it only happen if the stream is actually closed
correct?

@saintmatthieu

Copy link
Copy Markdown
Contributor Author

No, I don't see that it has a relation to the stream being open or not when idle. What makes you think this?

@luapmartin

Copy link
Copy Markdown
Contributor

the fact that we constantly create and destroy a stream is in my understanding a bad design as if the current project has the engine active then the stream should be open until the project is not the one holding the engine active then we could close the stream when de-activating the engine on that project
but it should sustain no matter what we do play/pause/stop
I would have guess that those plugins expect and "active" stream in the same way as I see the engine active on a project

@saintmatthieu

Copy link
Copy Markdown
Contributor Author

The VST3 instances and our settings don't even have a idea of the audio traffic we open and close for monitoring, AFAICS.

@luapmartin

luapmartin commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Didn’t you said that the parameter were restored on playback if changed while stopped but were correctly changed if changed during playback?

@saintmatthieu

Copy link
Copy Markdown
Contributor Author

Yes, because during playback, we don't pass null input and output pointers but real data.
I think I might know where the confusion comes from. Monitoring isn't playback in this context: our monitoring doesn't (yet) go through the processing pipeline. The VST is only instantiated during playback.

@luapmartin

Copy link
Copy Markdown
Contributor

outch then it's not monitoring but input checking :( that's a P0 bug to my ears

@saintmatthieu

Copy link
Copy Markdown
Contributor Author

Yeah. Basically we can only flush setting changes during playback. I'm also amazed that it's always been in AU3.

@saintmatthieu
saintmatthieu force-pushed the 11892-fix-unwarranted-plugin-setting-resets branch from e849820 to 96414b7 Compare September 16, 2026 15:08
@saintmatthieu
saintmatthieu merged commit 891c2dd into audacity:master Sep 16, 2026
7 of 10 checks passed
@saintmatthieu
saintmatthieu deleted the 11892-fix-unwarranted-plugin-setting-resets branch September 16, 2026 15:08
kryksyh added a commit that referenced this pull request Sep 22, 2026
Fix setting flushing for DISTRHO-based VST plugins (#11895)
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.

VST3 setting changes get reverted on playback start and other actions

2 participants