Skip to content

CLAP: record latency on activation - #544

Open
kdsch wants to merge 1 commit into
DISTRHO:developfrom
kdsch:clap-latency-on-activate
Open

kdsch wants to merge 1 commit into
DISTRHO:developfrom
kdsch:clap-latency-on-activate

Conversation

@kdsch

@kdsch kdsch commented Sep 27, 2026 •

Copy link
Copy Markdown

fLastKnownLatency starts at 0 and nothing updates it on activation, so a plugin that sets a nonzero latency in activate() has a latency change reported as soon as it runs. Recording the latency in activate(), where the host reads it, prevents that.

This was tested on Linux with a plugin that sets its latency in activate(). Bitwig logged "plugin reported latency change while activated" when the plugin loaded, and clap-validator 0.4.1 showed 19 failed tests with "Must only be called within 'clap_plugin::activate'". This commit resolves both.

Fixes #541.

As with the issue I filed, I drafted this with help from an AI assistant and tested it myself. Please let me know if that's unwelcome, and I will close the issue and PR, and refrain from it in the future.

🤖 Generated with Claude Code

fLastKnownLatency starts at 0 and nothing updates it on activation, so a
plugin that sets a nonzero latency in activate() has a latency change
reported as soon as it runs. Recording the latency in activate(), where
the host reads it, prevents that.

This was tested on Linux with a plugin that sets its latency in
activate(). Bitwig logged "plugin reported latency change while
activated" when the plugin loaded, and clap-validator 0.4.1 showed 19
failed tests with "Must only be called within 'clap_plugin::activate'".
This commit resolves both.

Fixes DISTRHO#541.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant