Bluetooth Speaker makes installTap fail to callback after first few seconds

If I have bluetooth speaker connected and I have installTap called on input Node, the callback is fired for 1-2 seconds then it doesnt anymore. I dont see any route or any notification handler called in between.

engine.inputNode.removeTap(onBus: 0) engine.inputNode.installTap( onBus: 0, bufferSize: 4096, format: format ) { buffer, _ in // 3 guard let channelData = buffer.floatChannelData else { return }

// This callback fails after some time. }

Not sure if this is expected, but I noticed some other applications, they seem to work fine. If I remove bluetooth device, my input works fine. Also I have no issues with output on Speaker.

I confirmed the behavior. This works with 17.x but fails with 18.x iOS versions. Some bug introduced. installTap is only called around 10 times with buffersize of 4096 and then never gets called back again. Only happening it seems with Bluetooth Speaker connected and iPhone's microphones are input.

I finally debugged and learnt that sampling rate conversion with new iOS 18.0 is failing for my audio unit. Fixed by handling correcting sampling rate.

Bluetooth Speaker makes installTap fail to callback after first few seconds
 
 
Q