AudioProcessorGraph dropouts after upgrading from 5.4.5 to 6.0.1

After upgrading from 5.4.5 to 6.0.1 AudioProcessorGraph is showing hefty dropouts here that get worse the longer a playback is running. I’m using it in a DAW-like headless app.

First I suspected changes in MidiBuffer, MidiBufferIterator, but it turned out that, after replacing AudioProcessorGraph.h/.cpp with the files of 5.4.5, the problem went away.

I compared both versions with FileMerge, but still have no clue.

What could be the cause? Maybe a locking issue, or more likely something related to std::atomic<bool>& isPrepared used in sleep loops, which seems to have the most impact, if any.

Anyone observing similar issues? Any ideas?

After checking all changes in AudioProcessorGraph with FileMerge, they are mostly minor tweaks limited to graph editing, which doesn’t play a role here.

Xcode Instruments don’t show significant differences in CPU load either.

Meanwhile I learned that the dropouts occur because real-time MIDI data fed into playback queues is lagging behind. So it’s not an audio thing but a multi-threading issue.

How the changes in AudioProcessorGraph contribute to this is over my head. All of a sudden, a carefully balanced system is getting out of step, caused by a seemingly unrelated change.

Sorry for bothering you with this. I thought it was something more straightforward that I was missing, but now I’m deep into a fractal of weird side effects on synchronization, voodoo spells and all.

On a side note, there are still two instances of isPrepared = 1 that should be isPrepared = true.

Ha! It turned out to be a simple sample rate issue.

Somehow, don’t ask me why, the changes in AudioProcessorGraph caused the sample rate to not propagate to all node processors at initial startup. That’s why a transport running at 48kHz ran out of sync with processors thinking they were running at 44kHz.

This bug was clearly in my own code, although I find it puzzling how AudioProcessorGraph had any influence on making it appear only now!

Don’t know if this thread is any useful, so admins, please feel free to delete it.

If you happen to suspect a similar issue, maybe running your graphs at different sample rates may reveal if there’s an undesired side effect on your code, too.

1 Like