Debugging pluginval question

When running level 10 tests in pluginval (which is an AWESOME tool) I sometimes get this inconsistent error:

Starting test: pluginval / Plugin state restoration...
!!! Test 1 failed: Parameters not restored on setStateInformation -- Expected value  within 0.1 of: 126.763, Actual value: 127.656

How can I debug it? Is there a place where I can set a breakpoint to catch the specific parameter which is failing? In the same way that a breakpoint in AllocatorInterceptor::logAllocationViolation() will catch Allocations during process errors.

Also coming across this. Not sure what I might be doing wrong here…

Honestly I don’t remember exactly how I solved it, but most likely it was something to do with macro parameters. Are you using macro parameters that can affect other parameters? If so, do something like this to inherit and make your macro parameter a meta parameter

struct MetaAudioParameterFloat : public AudioParameterFloat
{
bool isMetaParameter() const override { return true; }
};

And then pluginval will know how to handle it.

Note that certain DAWs have problems dealing with meta-parameters in automation. We try to avoid meta-parameters at all costs!

2 Likes

This is sad but true

I’m just fighting with a similar issue during the pluginval validation for AU. Looking into the source code I just noted how pluginval and juce construct the AUInstanceParameter object. This object basically doesn’t handle the meta value and it doesn’t override isMetaParameter.

// juce_AudioUnitPluginFormat.mm
const ScopedAudioUnitParameterInfo info { audioUnit, ids[i] };

if (! info.isValid())
    continue;

const auto paramName = getParamName (info.get());
const auto label = getParamLabel (info.get());
const auto isDiscrete = (info.get().unit == kAudioUnitParameterUnit_Indexed
                      || info.get().unit == kAudioUnitParameterUnit_Boolean);
const auto isBoolean = info.get().unit == kAudioUnitParameterUnit_Boolean;

auto parameter = std::make_unique<AUInstanceParameter> (*this,
                                                        ids[i],
                                                        paramName,
                                                        info.get().minValue,
                                                        info.get().maxValue,
                                                        info.get().defaultValue,
                                                        (info.get().flags & kAudioUnitParameterFlag_NonRealTime) == 0,
                                                        isDiscrete,
                                                        isDiscrete ? (int) (info.get().maxValue - info.get().minValue + 1.0f) : AudioProcessor::getDefaultNumParameterSteps(),
                                                        isBoolean,
                                                        label,
                                                        (info.get().flags & kAudioUnitParameterFlag_ValuesHaveStrings) != 0);

This is why using pluginval the parameter.isMetaParameter() in the testParameterInfo is always false. I looked for it here in the forum, but I didn’t find any issue related…