Glitches and zipper noise Auv3 iOS

I’ve been struggling to figure out source of random audio glitches and artifacts while running Tracktion_engine as Auv3 on iOS. Everything works fine in Standalone.

So far I’m hearing these artifacts while changing hosts tempo. I’m also getting random audio glitch once per Edit’s loop area during playback.

Same artifacts can be heard while running EngineInPluginDemo project, it’s just not as obvious since there is no actively playing “sounds”.

@dave96 do you have any pointers on troubleshooting this?

Have you called setUsesProxy (false) on any audio clips?

And can I check what version/branch of Tracktion Engine you’re using?
There have been quite a lot of changes recently around tempo changes.

I don’t have any audio clips in project, only midi clips.

Looks like issue is coming from calling epc->postPosition (toPosition (timeOffset)); in ExternalPlayheadSynchroniser::synchroniseEditPosition. Commenting this line fixes random glitches and zipping noise.

Seems to work great with only sync playheads on start/stop. Looping Edit works works as well in host like AUM.

Hmm, I think this is incorrect because blockSizeInSeconds is not always equal to the block size now?

I think it tries to resync every block in case the host playback speed changes.

Can you try hacking the call to synchronise and pass in the actual block size from the processBlock call and use that in place of the getBlockSizeMs() call. Does that fix it for you?

I tried switching to using actual bufferSize from processBlock, but that doesn’t seem to help.

const TimeDuration blockSizeInSeconds = TimeDuration::fromSeconds(buffer.getNumSamples() / sampleRate);