Offline rendering issues

Hey there,

Im facing a bug in my VST3/AU audio restauration plugin which I have been trying to fix for some time now:

In normal insert mode on a channel in a DAW everything works fine. I have tested it with multiple DAWs and no issues so far. I’ve verified it additionally with different sample rates and buffer sizes. Also the final rendering works without any trouble.

However when I try to use it in a offline processing mode it doesn’t seem to work correctly:

  • In Izotope RX I get some weird periodic artifacts. (Preview works fine)
  • Nuendo with Direct Offline Processing also the preview is fine but if it is commited to the clip it doesn’t do anything at all.

I don’t quite understand whats the difference between the realtime and offline processing. In my understanding it should work exactly the same way, shouldn’t it?

Did anybody experience something similar? I’m really clueless here…

The main difference is, that in realtime your processBlock is called in certain periods. So you have a deterministic time to finish. Especially in connection with background tasks, you need to have an emergency measure, e.g. play silence if the background task wasn’t finished. But that should never be hit, unless a user interaction makes it absolutely necessary like loading new sounds.

In non realtime, processBlock() is called as fast as possible. That means you will hit that emergency case almost every time. But on the plus side, it is ok to block in non-realtime, in fact you have to wait for your background task.

You are in trouble though, if some host doesn’t supply the isNonRealtime flag correctly (I struggled with FCPX in the past, don’t know if it is still an issue).

Obviously I can’t say for sure, if that is your problem.

Thanks for the answer.
I still don’t see whats the problem here. To me it sounds like offline processing should be even less error-prone. In my plugin there aren’t any background task and all the processing is done single threaded on the audio thread. So there must be another difference which I don’t see.

Strangely, I was just told that in ProTools as AudioSuite plugin, which is also offline processing, it works fine.

Are you using JUCE at all? AFAIK JUCE doesn’t support AudioSuite or did I miss that?

When the host starts offline rendering, it will probably for example call prepareToPlay again. Will your plugin tolerate that happening? The host might even create a whole new instance of the plugin just for the offline rendering. Will your plugin survive that? Does it save and restore its state properly? Will it work properly without its GUI ever opened?

Maybe the problematic hosts do something differently with the plugin I/O channel counts between realtime and offline rendering modes? For example, if you preview a mono file, maybe the host uses the plugin in stereo mode but when it starts the offline rendering it wants the plugin to work as mono. Do you support that scenario?

Juce supports the AudioSuite mode that just uses the plugin’s regular realtime features to process the audio.

Ah, that makes sense, thanks @Xenakios

Thanks for the ideas. I can not confidently say that I support all this without giving it a second thought. I will look into it.

Ok fixed the issue for Izotope RX offline rendering. The problem was that I didnt reset the state of the plugin properly. Now I explicitly reset all stateful objects in prepareToPlay() and releaseResources().

Hopefully that also fixed the Nuendo issue. Have to wait for the feedback of one of my beta testers.

Thanks for your input!

1 Like