iOS 15 RemoteIO unit silent microphone samples with builtin mic

On an iPhone 12 mini running iOS 15 beta 3, the microphone samples with builtin microphone are all silent in RemoteIO unit callbacks. This happens when AVAudioSession preferredInputSource is set to back or front mic. It is NOT seen when preferred input source is set to bottom mic or with external microphones.

Is this a known bug on iOS 15?

On further investigation, I see the problem happens only when stereo format is configured on the microphone as follows. The code works perfectly on iOS 14 devices, only on iOS 15 devices it causes RemoteIO unit to emit silent audio frames. Is there any known workaround for the same? I have filed a bug FB9393169 along with reproducible sample code.

 public func selectStereoFormatForBuiltinMic(_ orientation:AVAudioSession.Orientation) -> Bool {
        var configuredStereo = false

        if #available(iOS 14.0, *) {
            let session = AVAudioSession.sharedInstance()

            guard let preferredInput = session.preferredInput,

            let dataSources = preferredInput.dataSources,

            let newDataSource = dataSources.first(where: { $0.orientation == orientation }),

            let supportedPolarPatterns = newDataSource.supportedPolarPatterns else {    
                return false
            }

            do {

                supportsStereo = supportedPolarPatterns.contains(.stereo)

                // If the data source supports stereo, set it as the preferred polar pattern.

                if supportsStereo {

                    // Set the preferred polar pattern to stereo.

                    try newDataSource.setPreferredPolarPattern(.stereo)
                    configuredStereo = true
                }

                // Set the preferred data source and polar pattern.
                try preferredInput.setPreferredDataSource(newDataSource)

                // Update the input orientation to match the current user interface orientation.

                try session.setPreferredInputOrientation(stereoOrientation)

            } catch {
                NSLog("Unable to select stereo \(error)")
                configuredStereo = false
            }

        }

        return configuredStereo
    }

Dear Core Audio/AVFoundation engineers,

Any update on this bug? Is this a known issue for you guys? If not, is this expected to be fixed in upcoming iOS 15 betas?

Still seen on iOS 15 beta 4. Stereo Audio Capture sample code is broken!

iOS 15 RemoteIO unit silent microphone samples with builtin mic
 
 
Q