Skip to content

False negative result in ParameterThreadSafetyTest() - the locks wait() and signal() don't meet #127

@TheMates

Description

@TheMates

Hi,
I am testing my plugin and getting false negative result on the ParameterThreadSafetyTest()

-----------------------------------------------------------------
Starting tests in: pluginval / Parameter thread safety...
*** FAILED: Timeout after 30 secs

Finished validating: C:\Program Files\Common Files\VST3\Audified\U73b Compressor.vst3\Contents\x86_64-win\U73b Compressor.vst3
*** FAILED WITH EXIT CODE: 1

Finished batch validation

I think that it might happen to some more cpu intensive plugins that take more time in processing.

I think this block might finish

// This emulates the plugin itself setting a value for example from a slider within its UI
juce::MessageManager::callAsync ([&, threadRandom = r]() mutable
{
startWaiter.signal();
for (int i = 0; i < numBlocks; ++i)
for (auto param : parameters)
param->setValueNotifyingHost (threadRandom.nextFloat());
endWaiter.signal();
});

before the main thread gets to endWaiter.signal(); at the end of this block and we never get the endWaiter.signal() while the main thread is waiting.

startWaiter.wait();
for (int i = 0; i < numBlocks; ++i)
{
// Add note off in last block if plugin is a synth
if (isPluginInstrument && i == (numBlocks - 1))
addNoteOff (mb, noteChannel, noteNumber, 0);
for (auto param : parameters)
param->setValue (r.nextFloat());
fillNoise (ab);
instance.processBlock (ab, mb);
mb.clear();
}
endWaiter.wait();

I am not an expret in threading and in using JUCE thread classes, but when I decreased the number of cycles in the main loop

for (int i = 0; i < numBlocks; ++i)

to something like 10-20, the test finished successfully. I am not sure now how to fix it, but someone might be able to figure this out.

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