AVCaptureMultiCamSession Runtime Error with External headphone

Hi Apple support,

I'm using AVMultiCamPip as a project starting base and I have the following setup(sample[1]). It connects without headphones but generate a runtime error(sample[1]) with headphones. I'm running on iPhone Xs with iOS 14.3

The source code I'm using is the sample AVMultiCamPip code. How should I config the external headphone mic to prevent the runtime error to occur?



sample[1]

Code Block
2021-01-23 11:10:54.216702-0500 AVMultiCamPiP[3760:649414] Metal GPU Frame Capture Enabled
2021-01-23 11:10:54.218037-0500 AVMultiCamPiP[3760:649414] Metal API Validation Enabled
(lldb) po (notification.object as! AVCaptureMultiCamSession).connections
▿ 6 elements
- 0 : <AVCaptureConnection: 0x282092f80 (AVCaptureDeviceInput: 0x282081280 Back Camera) -> (AVCaptureVideoDataOutput: 0x2820f7840) [type:vide][enabled:1][active:1]>
- 1 : <AVCaptureConnection: 0x282082ba0 (AVCaptureDeviceInput: 0x282081280 Back Camera) -> (AVCaptureVideoPreviewLayer: 0x2820e8060) [type:vide][enabled:1][active:1]>
- 2 : <AVCaptureConnection: 0x282085220 (AVCaptureDeviceInput: 0x282081920 Front Camera) -> (AVCaptureVideoDataOutput: 0x2820f7a80) [type:vide][enabled:1][active:1]>
- 3 : <AVCaptureConnection: 0x2820939e0 (AVCaptureDeviceInput: 0x282081920 Front Camera) -> (AVCaptureVideoPreviewLayer: 0x2820e8200) [type:vide][enabled:1][active:1]>
- 4 : <AVCaptureConnection: 0x28208d460 (AVCaptureDeviceInput: 0x2820843e0 Headphones) -> (AVCaptureAudioDataOutput: 0x2820f7ba0) [type:soun][enabled:1][active:1]>
- 5 : <AVCaptureConnection: 0x28208e480 (AVCaptureDeviceInput: 0x2820843e0 Headphones) -> (AVCaptureAudioDataOutput: 0x2820f7d20) [type:soun][enabled:1][active:1]>
(lldb) po (notification.object as! AVCaptureMultiCamSession).hardwareCost
0.58957714
(lldb) po (notification.object as! AVCaptureMultiCamSession).systemPressureCost
0.81041515
(lldb) po (notification.object as! AVCaptureMultiCamSession).outputs
▿ 4 elements
- 0 : <AVCaptureVideoDataOutput: 0x2820f7840>
- 1 : <AVCaptureVideoDataOutput: 0x2820f7a80>
- 2 : <AVCaptureAudioDataOutput: 0x2820f7ba0>
- 3 : <AVCaptureAudioDataOutput: 0x2820f7d20>
(lldb) po (notification.object as! AVCaptureMultiCamSession).inputs
▿ 3 elements
- 0 : <AVCaptureDeviceInput: 0x282081280 [Back Camera]>
- 1 : <AVCaptureDeviceInput: 0x282081920 [Front Camera]>
- 2 : <AVCaptureDeviceInput: 0x2820843e0 [Headphones]>
(lldb) po notification.userInfo
▿ Optional<Dictionary<AnyHashable, Any>>
▿ some : 1 element
▿ 0 : 2 elements
▿ key : AnyHashable("AVCaptureSessionErrorKey")
- value : "AVCaptureSessionErrorKey"
- value : Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12780), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x282e81200 {Error Domain=NSOSStatusErrorDomain Code=-12780 "(null)"}}
(lldb)


I have same error. Example isn't work with external mic

AVCaptureMultiCamSession Runtime Error with External headphone
 
 
Q