Hi everyone,
We’re encountering an issue where AudioQueueNewOutput blocks indefinitely and never returns, and we’re hoping to get some insight or confirmation if this is a known behavior/regression on newer iOS versions.
Issue Description
When triggering audio playback, we create an output AudioQueue using AudioQueueNewOutput.
On some devices, the call hangs inside AudioQueueNewOutput and never returns, with no OSStatus error and no subsequent logs.
This behavior is reproducible mainly on iOS 18.3.
Earlier iOS versions do not show this issue under the same code path.
if (audioDes)
{
mAudioDes.mSampleRate = audioDes->mSampleRate;
mAudioDes.mBitsPerChannel = audioDes->mBitsPerChannel;
mAudioDes.mChannelsPerFrame = audioDes->mChannelsPerFrame;
mAudioDes.mFormatID = audioDes->mFormatID;
mAudioDes.mFormatFlags = audioDes->mFormatFlags;
mAudioDes.mFramesPerPacket = audioDes->mFramesPerPacket;
mAudioDes.mBytesPerFrame = audioDes->mBytesPerFrame;
mAudioDes.mBytesPerPacket = audioDes->mBytesPerFrame;
mAudioDes.mReserved = 0;
}
// Create AudioQueue for output
OSStatus status = AudioQueueNewOutput(
&mAudioDes,
AQOutputCallback,
this,
NULL,
NULL,
0,
&audioQueue
);
code-block
The thread blocks inside AudioQueueNewOutput, and execution never reaches the next line.
Additional Notes / Observations
ASBD is confirmed to be valid
Standard PCM output
Sample rate, channels, bytes per frame/packet all consistent
Same ASBD works correctly on earlier iOS versions
AudioQueue is created on a background thread
Not on the main thread
Not inside the AudioQueue callback
On first creation, AVAudioSession may not yet be active
setCategory and setActive:YES may be called shortly before creating the AudioQueue
There may be a timing window where the session is still activating
Issue is reported mainly on iOS 18.3
Multiple user reports point to iOS 18.3 devices
Same code path works on iOS 17.x and earlier
No OSStatus error is returned — the call simply never returns.
Questions
Is it expected that AudioQueueNewOutput can block indefinitely while waiting for AVAudioSession / audio route / HAL readiness?
Have there been any behavior changes in iOS 18.3 regarding AudioQueue creation or AudioSession synchronization?
Is it unsafe to call AudioQueueNewOutput before AVAudioSession is fully active on recent iOS versions?
Are there recommended patterns (or delays / callbacks) to ensure AudioQueue creation does not hang?
Any insight or confirmation would be greatly appreciated.
Thanks in advance!