AVRoutePickerView displays incorrect output names

Hi Folks,

I'm currently working on video conferencing app and use AVRoutePickerView for output device selection. Since iOS 16 release it started to display incorrect names for ear-piece and speaker options. For both of them the name is iPhone (before it was iPhone/Speaker) Output changes works correctly but display names confuse.

Here is my audio session configuration:

    private func configureSession() {
        let configuration = RTCAudioSessionConfiguration.webRTC()
        configuration.category = AVAudioSession.Category.playAndRecord.rawValue
        configuration.categoryOptions = [.allowBluetooth, .allowBluetoothA2DP, .duckOthers, .mixWithOthers]

        let session = RTCAudioSession.sharedInstance()
        session.lockForConfiguration()
        do {
            try session.setConfiguration(configuration)
        } catch let error as NSError {
            logError("[AudioSessionManager] Unable to configure RTCAudioSession with error: \(error.localizedDescription)")
        }

        session.unlockForConfiguration()
    }

    

    private func overrideOutputPortIfNeeded() {
        DispatchQueue.main.async {
            guard let currentOutputType = self.session.currentRoute.outputs.first?.portType else { return }
         
            self.session.lockForConfiguration()

            let shouldOverride = [.builtInReceiver, .builtInSpeaker].contains(currentOutputType)

            logDebug("[AudioSessionManager] Should override output to speaker? \(shouldOverride)")

            if shouldOverride {
                do {
                    try self.session.overrideOutputAudioPort(.speaker)
                } catch let error as NSError {
                    logError("[AudioSessionManager] Unable to override output to Speaker: \(error.localizedDescription)")
                }
            }

            self.session.unlockForConfiguration()
        }
    }

Any help appreciated, Thansk!

Post not yet marked as solved Up vote post of bryzinski.m Down vote post of bryzinski.m
1.7k views

Replies

Experiencing the same thing in developing a VoIP app for the App Store. Apple, need an assist here to get this fixed!

"Speaker" changes to "iPhone" in error once the speaker option is selected.

Have you got update on this?

I"m also seeing this on iOS 17.1 with Xcode 15.2 on an iphone 15 Pro