setNonRealtime(true) has no effect on AU plugin inside JUCE host


Hi there.

Looks like setNonRealtime() has no effect on loaded AU plugin running inside Juce-powered host.

I looked at code and saw that feature is not working cause it’s not implemented.

In VSTPluginFormat class there is a code that tells plugin that host is rendering in realtime/non-realtime mode, but AudioUnitPluginFormat doesn’t have anything like that.

Do you have plans to add this feature?


Does AU even have a concept of realtime/non-realtime?


Yes, it’s called in the AU in MusicDeviceBase::SetProperty() for property kAudioUnitProperty_OfflineRender. In your own code you can call isNonRealtime() in your plug-in code (after prepareToPlay() has been called). It’s so that you can handle the non-realtime case differently, if needed. For example, you might want handle memory differently, or run some multithreaded code in a single thread, and so on.

Try putting a breakpoint and it’s called when the plug-in first loads to set it to false. Then if you do a bounce of one or more regions, it gets called again with true just before it tries to render the bounce.

                case kAudioUnitProperty_OfflineRender:
                    if (juceFilter != nullptr)
                        juceFilter->setNonRealtime ((*(UInt32*) inData) != 0);