Skip to content

Standalone: never activate a plugin at sample rate 0 - #589

Merged
defiantnerd merged 1 commit into
free-audio:nextfrom
baconpaul:standalone-no-zero-rate-activate
Oct 8, 2026
Merged

defiantnerd merged 1 commit into
free-audio:nextfrom
baconpaul:standalone-no-zero-rate-activate

Conversation

@baconpaul

Copy link
Copy Markdown
Collaborator

activatePlugin accepted any sample rate. On macOS, a request_restart from a plugin reactivated it unconditionally, unlike the request_process branch next to it. With no output device, that meant activate(0, …), which risks a divide-by-zero in the plugin.

  • activatePlugin now refuses a non-positive sample rate or an empty block range, before deactivating anything.
  • The macOS and Windows restart handlers only reactivate a plugin that is currently active. A restart request for an inactive plugin has nothing to restart.

This is P0-3 of the standalone-revisited list. Linux doesn't service restart requests at all yet; that is LIN-N1, separate from this.

Tested

  • On macOS with two-filters, normal startup still activates at 48 kHz and audio runs.
  • The Windows change is a one-condition edit that I could not compile here; CI will.

activatePlugin now refuses a non-positive sample rate or an empty block
range. With no output device, a plugin that called request_restart was
activated at 0 Hz on macOS. Both the macOS and Windows restart handlers now
only reactivate a plugin that is currently active.

Assisted-by: Claude Opus 5.5

@defiantnerd defiantnerd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah - perhaps we need a little bit more error handling, the also displays in the Window itself.

@defiantnerd
defiantnerd merged commit 8fba834 into free-audio:next Oct 8, 2026
28 checks passed
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.

2 participants