VST 2.4 detect offline bounce/rendering


#1

Hi!

I was wondering, if with VST 2.4 there is a reliable way to detect, if the host is playing in real-time or bouncing/rendering offline?

I know the function "isNonRealtime()". But in my case it does not seem to work. It allways returns true, regardless of the mode.

As I understand it, the host should set the real-time condition by calling "setNonRealtime". In Juce you find this function in "processReplacing" and "resume" of juce_VST_Wrapper. I did some debugging. In my case, with Sonar 8, the resume() function is never called by the host. ProcessReplacing() is called, but setNonRealtime() is part of an if-clause, that never is true, and thus never gets executed there either.

Is this a problem with Sonar 8, or am I doing something wrong?

Note: I am not using the latest Juce version, still on Juce 2.x.


#2

AFAIK, the host needs to set the processing level to “offline” to notify the plugin about an offline rendering. On Windows the thread priority is also taken into account. Maybe Jules can comment on why this was added. (it seems to work but there probably was an occasion that lead to adding this)

If the host doesn’t tell the plugin that it’s doing an offline rendering the plugin can’t know. Some hosts also only seem to notify the plugin when rendering but not in resume (IIRC Cubase) which can mess things up if offline rendering should be done with a different latency.


#3

So with processing level you mean the thread priority? Maybe I could check if that changes...


#4

No, getProcessLevel() (so it’s process level and not processing level as I used in my previous post) is a function of the VST SDK that returns whether the host says it’s doing an online, offline or something different processing. This is mainly used to determine whether it’s realtime or not:

filter->setNonRealtime (getCurrentProcessLevel() == 4 /* kVstProcessLevelOffline */);

If the host doesn’t set the process level, JUCE already uses the thread priority to check for offline processing on Windows. But still, the host might do an offline rendering without the plugin knowing.