Skip to content

AUv2: a failed idle-time reactivation leaves the CLAP state machine violated #549

Description

@defiantnerd

Found while fixing AUV2-1 (stale audio during a plugin-requested restart) in the 0.16 release review. Not fixed there — it is a distinct defect on the same path.

The problem

In src/wrapasauv2.cpp, onIdle()'s restart path:

  • activateCLAP() ignores the return value of Plugin::activate().
  • deactivateCLAP() calls stop_processing() and deactivate() unguarded.

So if a plugin-requested restart fails to reactivate, _initialized stays false and the wrapper carries on. A later AU Uninitialize then calls stop_processing()/deactivate() on a plugin that is already inactive — which CLAP's state machine does not allow.

The onIdle comment acknowledges the failure is possible ("If it fails anyway, _initialized stays false…"), but nothing records that the CLAP is now down as opposed to running but not initialized, and the teardown path cannot tell the two apart.

Suggested fix

Track CLAP activation state explicitly rather than inferring it from _initialized, and make deactivateCLAP() a no-op when the plugin is not active. activateCLAP() should propagate the failure so the caller can decide, rather than discarding it.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions