Skip to content

Avoid concurrent main-thread callbacks with AU Logic Pro #395

Open
@SamWindell

Description

@SamWindell

Logic Pro using an AU wrapped CLAP is calling GetParameterInfo from the audio thread (when I query the name of the thread it returns com.apple.audio...).

In GetParameterInfo, the wrapper calls the CLAP's params.get_value function - main thread only.

It's only doing this to set a flag though, we could avoid this by querying this once earlier on rather than in the GetParameterInfo callback

// we can't get the value since we are not in the audio thread
auto guarantee_mainthread = _plugin->AlwaysMainThread();
double value;
if (_plugin->_ext._params->get_value(_plugin->_plugin, info.id, &value))
{
char buf[200];
if (_plugin->_ext._params->value_to_text(_plugin->_plugin, info.id, value, buf, sizeof(buf)))
{
flags |= kAudioUnitParameterFlag_HasName;
}
}

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