Is playback context actually allocated?


I have a situation where I’m pausing the playback context between playbacks and restoring it when the user starts playback. Now, if I start injecting live messages into the playback graph right after calling transport.ensureContextAllocated (which I need to setup synths etc), some of these messages never reache their destination.

I believe there is a race going on: at the point when ensureContextAllocated returns, there is no guarantee that the playback graph is really active – correct?

Is there any way to wait for the playback graph to actually being “live”? Or do you have any other suggestions?


It’s synchronous from what I can tell… How are you injecting your live messages? AudioTrack::injectLiveMidiMessage? If so, is that managing to call any listener?