Halion won't work OK with kOffline

I’m having problems running Halion Sonic SE offline.

This is what my host code does:

  • create an instance of Halion
  • restore its state (copied from another instance)
  • call process() in a loop as fast as possible. This is in a background thread.

Both IAudioProcessor.setupProcessing() and Process() ‘see’ kOffline.

This is what happens:

  • output is silent until after approx. 100 bars some crackling notes appear. A bit later it starts to sound right.
  • it works OK if I call sleep() after each process call, effectively making it run realtime.

Halion clearly doesn’t wait for it’s samples to be read from disk.

Looks like this problem is with Halion only, ie. samplers from other vendors work fine.

Any ideas?

Edit: the issue happens with the AU version of Halion too.

FTR: I’m specifically talking about the case where the host creates the instance and uses it all by itself.
There is no problem if the plugin is in an effect slot, and the user has to click here and there to start offline processing. But it doesn’t work if the host creates a Halion instance behind the scenes.

I’ve tried using CFRunLoopRunInMode() to give the plugin a chance to finish any thread communication. That helps a little bit for the AU version, it doesn’t improve the VST version.