I’m having some strange issue with the Convolution in the auvaltool as well, looking really hard to see if it is from my code, but looks quite nice and simple. Maybe might be something worth investigating:
RENDER TESTS:
Input Format: AudioStreamBasicDescription: 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-
endian float, deinterleaved
Output Format: AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit
little-endian float, deinterleaved
Render Test at 512 frames
Slicing Render Test at 64 frames
PASS
Render Test at 64 frames, sample rate: 22050 Hz
Render Test at 137 frames, sample rate: 96000 Hz
Render Test at 4096 frames, sample rate: 48000 Hz
JUCE Assertion failure in juce_AudioBlock.h:337
JUCE Assertion failure in juce_AudioSampleBuffer.h:881
JUCE Assertion failure in juce_AudioSampleBuffer.h:881
JUCE Assertion failure in juce_AudioBlock.h:337
JUCE Assertion failure in juce_AudioSampleBuffer.h:881
JUCE Assertion failure in juce_AudioSampleBuffer.h:881
JUCE Assertion failure in juce_AudioBlock.h:337
JUCE Assertion failure in juce_AudioSampleBuffer.h:881
JUCE Assertion failure in juce_AudioSampleBuffer.h:275
Segmentation fault: 11
It goes quite right in the 2 first render tests, but then it hits an assertion. This is the stack when it hits the assertion:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
* frame #0: 0x0000000105302ae9 Plugin`juce::dsp::AudioBlock<float>::getSubBlock(this=0x00007ffeefbfd4d0, newOffset=0, newLength=4096) const at juce_AudioBlock.h:337
frame #1: 0x00000001052e6d97 Plugin`juce::dsp::Convolution::Pimpl::processSamples(this=0x000000010386fe00, input=0x00007ffeefbfd8e8, output=0x00007ffeefbfd8e8) at juce_Convolution.cpp:714
frame #2: 0x00000001052e667d Plugin`juce::dsp::Convolution::processSamples(this=0x000000010386f008, input=0x00007ffeefbfd8e8, output=0x00007ffeefbfd8e8, isBypassed=false) at juce_Convolution.cpp:1208
frame #3: 0x000000010567d3ad Plugin`void juce::dsp::Convolution::process<juce::dsp::ProcessContextReplacing<float> >(this=0x000000010386f008, context=0x00007ffeefbfd8d8) at juce_Convolution.h:79
frame #4: 0x000000010567d16d Plugin`ss::LinearPhaseFilter::process(this=0x000000010386f000, context=0x00007ffeefbfd8d8) at LinearPhase.cpp:71
frame #5: 0x00000001056805a0 Plugin`ss::LinearPhaseCrossover::process(this=0x000000010386c2b0, context=0x00007ffeefbfdda0) at LinearPhaseCrossover.cpp:79
frame #6: 0x0000000105058e79 Plugin`PluginProcessor::processBlock(this=0x000000010386c180, buffer=0x0000000103820b58) at PluginProcessor.cpp:93
frame #7: 0x0000000105048695 Plugin`PluginAudioProcessor::processBlock(this=0x000000010386be00, buffer=0x0000000103820b58, midiMessages=0x0000000103820c90) at PluginProcessor.cpp:153
frame #8: 0x000000010501f8c8 Plugin`JuceAU::processBlock(this=0x0000000103820800, buffer=0x0000000103820b58, midiBuffer=0x0000000103820c90) at juce_AU_Wrapper.mm:1762
frame #9: 0x00000001050094f6 Plugin`JuceAU::Render(this=0x0000000103820800, ioActionFlags=0x00007ffeefbfe6ec, inTimeStamp=0x00007ffeefbfe7a0, nFrames=4096) at juce_AU_Wrapper.mm:1305
frame #10: 0x0000000105008e3d Plugin`AUBase::RenderBus(this=0x0000000103820800, ioActionFlags=0x00007ffeefbfe6ec, inTimeStamp=0x00007ffeefbfe7a0, inBusNumber=0, inNumberFrames=4096) at AUBase.h:332
frame #11: 0x000000010502a292 Plugin`AUBase::DoRenderBus(this=0x0000000103820800, ioActionFlags=0x00007ffeefbfe6ec, inTimeStamp=0x00007ffeefbfe7a0, inBusNumber=0, theOutput=0x0000000100216c90, inNumberFrames=4096, ioData=0x00000001006020b0) at AUBase.h:816
frame #12: 0x000000010502988b Plugin`AUBase::DoRender(this=0x0000000103820800, ioActionFlags=0x00007ffeefbfe6ec, inTimeStamp=0x00007ffeefbfe7a0, inBusNumber=0, inFramesToProcess=4096, ioData=0x00000001006020b0) at AUBase.cpp:1503
frame #13: 0x0000000105024bbe Plugin`CMgr_AudioUnitBaseRender(This=0x0000000103820800, ioActionFlags=0x00007ffeefbfe6ec, inTimeStamp=0x00007ffeefbfe7a0, inBusNumber=0, inNumberFrames=4096, ioData=0x00000001006020b0) at AUDispatch.cpp:433
frame #14: 0x000000010000ae25 autool`___lldb_unnamed_symbol59$$autool + 1011
frame #15: 0x000000010000c27a autool`___lldb_unnamed_symbol63$$autool + 2532
frame #16: 0x00000001000109f5 autool`___lldb_unnamed_symbol121$$autool + 1731
frame #17: 0x0000000100002169 autool`___lldb_unnamed_symbol3$$autool + 3191
frame #18: 0x000000010000141d autool`___lldb_unnamed_symbol2$$autool + 384
frame #19: 0x00007fff6c8b5015 libdyld.dylib`start + 1
Investigating myself, I’ve came to the conclusion that the “interpolationBuffer” member variable isn’t resized to 4096 samples, even though the “prepare()” method is called accordingly with the sample rate and buffer size changes.
This happens only on auvaltool. On standalone, Logic and Plugin Host tool, the assertion doesn’t get hit.