New to the forum so if this is in the wrong place let me know!
I’m creating a standalone audio application for macOS in xcode.
The problem I’m getting is that occasionally I get audio glitches in the output audio stream - after spending a lot of time debugging it looks as if my ‘getNextAudioBlock()’ method is executing later than it should causing audio drop outs. I timed the execution of this method using kDebug signposts and the system trace instrument in Xcode.
A screenshot of the ‘glitch area’ is below, to the left you can see the regular calls to getNextAudioBlock() that do not produce glitches, then in the centre these get further apart due to an unusually long block from mach_msg_trap(). Is there an easy way to find out what is causing this block?
I was not sure how much info you need from the code, so if you have any ideas about what would be useful to see then please let me know.