dsp::IIR is causing host to crash randomly

Hi, I am having a problem with IIR Filter in DSP module, after some troubleshooting I found that filtering is crashing my plugin in AudioHost. I am creating an ‘’’ dsp::IIR::Filter ‘’’ object in processor header, one for each channel. Then in “prepareToPlay” i am using reset() method, moving on to process block i am calling .coefficients method to set it to first order LPF and then I am processing sample by sample in a loop, using .processSample. The filtering itself works fine, but sometimes i crash the host while opening up my plugin, this happens very randomly, the more IIR objects i have, the more crashing there is. I am aware of the fact that I am maybe not using IIR Filtering correctly, so I would appreciate some help on this matter.

Attach a debugger and see where and why the crash happens :slight_smile:

unfortunately, VS is telling me that breakpoint will be missed, because symbols for this document were not loaded, whatever that means. i am new to debugging, i am pointing on .processSample in processBlock, because when i comment this line host is not crashing.

E: i would also like to add that my plugin is never crashing after launch, it only crashes when i try to open it in the host.

Usually I object speculative answers, but that could be the reason. You shouldn’t assume the number of channels.

The better approach is to use the ProcessorDuplicator. That will automatically create as many instances of your Processor or ProcessorChain as needed.

thank you for responding. could you shed some like on how do i use ProcessorDuplicator? ive created

dsp::ProcessorDuplicator<dsp::IIR::Filter, dsp::IIR::Coefficients> LPF;

in processor header, i want to set coefs in the processblock by calling .state and pointing to coefficients but this is not correct. i would also like to process sample by sample, this is how my algorithm works right now and it seems like processor duplicator is only capable of block processing.

Seems like you only debug the standalone, not the plug-in itself. You can do this by attaching a debugger to a running process: compile the plug-in (maybe first in debug mode, not release), open DAW, VS Debug Attach to process, find DAW, attach, load plug-in. see where things go wrong :wink: