vst3: maxSamplesPerBlock is a maximum, not a fixed block size - #567
Merged
defiantnerd merged 1 commit intoSep 15, 2026
Merged
Conversation
Passing it as min_frames_count too tells a CLAP plugin every process() call carries exactly that many frames. Hosts that declare a large block and render on a smaller one (Cubase ASIO Guard, anticipative FX) then make a plugin with a fixed render quantum read and write past the buffers it was given.
defiantnerd
force-pushed
the
fix/vst3-block-size-is-a-maximum
branch
from
September 15, 2026 09:34
d184fdf to
db6c3c8
Compare
Collaborator
Author
|
Updated: the declared minimum is 32 rather than 1, clamped so it can never exceed VST3 specifies no minimum, so neither value is something the spec backs — 32 is the smallest block hosts actually render. The property that fixes the bug is min != max either way; 32 just states the practical floor instead of a value no host produces, and lines up with the AUv2 wrapper declaring 16. |
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.
setupProcessing passed
newSetup.maxSamplesPerBlockas both bounds ofsetBlockSizes. In CLAP,min_frames_count == max_frames_countmeans everyprocess()call carries exactly that many frames; in VST3,maxSamplesPerBlockis only an upper bound andProcessData::numSamplesmay be anything up to it.ProcessAdapter::process()passesnumSamplesstraight through asframes_count.A plugin with a fixed internal render quantum uses that declaration to skip its input FIFO and run with zero added latency. Given a host that declares 1024 and then renders monitored tracks on 32 — Cubase/Nuendo with ASIO Guard, and anticipative-FX schemes elsewhere — it renders a whole quantum for a call carrying less than one, reading and writing past both the input and the output buffers the host owns.
Found from a user report of a wrapped guitar-amp plugin sounding wrong at 32 and 64 sample buffers while 128 and 256 were fine: those two are whole multiples of its 128-frame quantum, so they happened to be served correctly.
The minimum is declared as 32, clamped to
maxSamplesPerBlock. VST3 states no minimum at all, so this is a practical floor rather than a guaranteed one — the smallest block hosts actually render — and the AUv2 wrapper makes the same kind of call with 16. What fixes the bug is that min != max, which no longer lets a plugin infer a fixed block size.VST3 was the only wrapper declaring a fixed size: AUv2 passes
16, max, AUv3 and the standalone pass1, max, AAX passes two different constants.