shepeliev / webrtc-kmp

WebRTC Kotlin Multiplatform SDK
Apache License 2.0
196 stars 38 forks source link

Camera not working on iPhone devices running iOS 18.1.1 #147

Closed aschulz90 closed 1 day ago

aschulz90 commented 4 days ago

I am currently experiencing a non-working camera on iOS using the sample app. But only for one device (of the ones that I can test on).

webrtc-kmp: 0.125.5 webrtc-ios: 125.6422.05

Not working

Device: iPhone 15 OS Version: 18.1.1 Xcode: 16.1

Error: The camera's active format is unsupported by this session. I guess format means whatever gets selected here. I tried both front and back facing camera. Cameras themself work fine using the default camera app.

Logs:

(RTCLogging.mm:33): (RTCAudioSession.mm:117 -[RTCAudioSession initWithAudioSession:]): RTC_OBJC_TYPE(RTCAudioSession) (0x3021ace80): init.
(RTCLogging.mm:33): (RTCAudioSession+Configuration.mm:104 -[RTCAudioSession(Configuration) setConfiguration:active:shouldSetActive:error:]): Set preferred sample rate to: 48000.00
(RTCLogging.mm:33): (RTCAudioSession+Configuration.mm:119 -[RTCAudioSession(Configuration) setConfiguration:active:shouldSetActive:error:]): Set preferred IO buffer duration to: 0.020000
(RTCLogging.mm:33): (RTCAudioSession.mm:612 -[RTCAudioSession handleApplicationDidBecomeActive:]): Application became active after an interruption. Treating as interruption end. isInterrupted changed from 0 to 0.
(audio_device_module_ios.mm:45): current platform is IOS
(audio_device_module_ios.mm:46): iPhone Audio APIs will be utilized.
(RTCLogging.mm:33): (RTCAudioDeviceModule.mm:52 -[RTCAudioDeviceModule initWithNativeModule:workerThread:]): RTCAudioDeviceModule initWithNativeModule:workerThread:
(audio_device_module_ios.mm:671): SetAudioDeviceSink(da65f0) Not implemented
(input_volume_stats_reporter.cc:98): Will not log any `WebRTC.Audio.Apm.AppliedInputVolume.*` histogram stats.
(input_volume_stats_reporter.cc:98): Will not log any `WebRTC.Audio.Apm.RecommendedInputVolume.*` histogram stats.
(audio_processing_impl.cc:697): Injected APM submodules:
Echo control factory: 0
Echo detector: 0
Capture analyzer: 0
Capture post processor: 0
Render pre processor: 0
(audio_processing_impl.cc:710): AudioProcessing: AudioProcessing::Config{ pipeline: { maximum_internal_processing_rate: 48000, multi_channel_render: 0, multi_channel_capture: 0 }, pre_amplifier: { enabled: 0, fixed_gain_factor: 1 },capture_level_adjustment: { enabled: 0, pre_gain_factor: 1, post_gain_factor: 1, analog_mic_gain_emulation: { enabled: 0, initial_level: 255 }}, high_pass_filter: { enabled: 0 }, echo_canceller: { enabled: 0, mobile_mode: 0, enforce_high_pass_filtering: 1 }, noise_suppression: { enabled: 0, level: Moderate }, transient_suppression: { enabled: 0 }, gain_controller1: { enabled: 0, mode: AdaptiveAnalog, target_level_dbfs: 3, compression_gain_db: 9, enable_limiter: 1, analog_gain_controller { enabled: 1, startup_min_volume: 0, clipped_level_min: 70, enable_digital_adaptive: 1, clipped_level_step: 15, clipped_ratio_threshold: 0.1, clipped_wait_frames: 300, clipping_predictor:  { enabled: 0, mode: 0, window_length: 5, reference_window_length: 5, reference_window_delay: 5, clipping_threshold: -1, crest_factor_margin: 3, use_predicted_step: 1 }}}, gain_controller2: { enabled: 0, fixed_digital: { gain_db: 0 }, adaptive_digital: { enabled: 0, headroom_db: 5, max_gain_db: 50, initial_gain_db: 15, max_gain_change_db_per_second: 6, max_output_noise_level_dbfs: -50 }, input_volume_control : { enabled 0}}
(webrtc_voice_engine.cc:354): WebRtcVoiceEngine::WebRtcVoiceEngine
(webrtc_voice_engine.cc:376): WebRtcVoiceEngine::Init
(audio_device_buffer.cc:66): AudioDeviceBuffer::ctor
(audio_device_ios.mm:109): AudioDeviceIOS::ctor<NSThread: 0x301aedb40>{number = 10, name = (null)},bypass_voice_processing=0
(audio_device_ios.mm:129): AudioDeviceIOS::AttachAudioBuffer
(audio_device_ios.mm:136): AudioDeviceIOS::Init
(audio_device_ios.mm:704): AudioDeviceIOS::UpdateAudioDevicebuffer
(audio_device_buffer.cc:203): SetPlayoutSampleRate(48000)
(audio_device_buffer.cc:223): SetPlayoutChannels(1)
(audio_device_buffer.cc:197): SetRecordingSampleRate(48000)
(audio_device_buffer.cc:217): SetRecordingChannels(1)
(audio_device_ios.mm:1072): SetPlayoutDevice: Not implemented
(audio_device_ios.mm:1125): SetStereoPlayout: Not implemented
(audio_device_module_ios.mm:330): stereo playout is not supported
(adm_helpers.cc:57): Failed to set stereo playout mode.
(audio_device_ios.mm:1174): SetRecordingDevice: Not implemented
(adm_helpers.cc:77): Failed to set stereo recording mode.
(webrtc_voice_engine.cc:478): WebRtcVoiceEngine::ApplyOptions: AudioOptions {aec: 1, agc: 1, ns: 0, hf: 1, swap: 0, audio_jitter_buffer_max_packets: 200, audio_jitter_buffer_fast_accelerate: 0, audio_jitter_buffer_min_delay_ms: 0, }
(webrtc_voice_engine.cc:497): Always disable AEC on iOS. Use built-in instead.
(webrtc_voice_engine.cc:507): Always disable AGC on iOS. Use built-in instead.
(audio_device_generic.cc:18): BuiltInAECIsAvailable: Not supported on this platform
(audio_device_generic.cc:28): BuiltInAGCIsAvailable: Not supported on this platform
(audio_device_generic.cc:38): BuiltInNSIsAvailable: Not supported on this platform
(audio_processing_impl.cc:913): AudioProcessing::ApplyConfig: AudioProcessing::Config{ pipeline: { maximum_internal_processing_rate: 48000, multi_channel_render: 0, multi_channel_capture: 0 }, pre_amplifier: { enabled: 0, fixed_gain_factor: 1 },capture_level_adjustment: { enabled: 0, pre_gain_factor: 1, post_gain_factor: 1, analog_mic_gain_emulation: { enabled: 0, initial_level: 255 }}, high_pass_filter: { enabled: 1 }, echo_canceller: { enabled: 0, mobile_mode: 0, enforce_high_pass_filtering: 1 }, noise_suppression: { enabled: 0, level: High }, transient_suppression: { enabled: 0 }, gain_controller1: { enabled: 0, mode: FixedDigital, target_level_dbfs: 3, compression_gain_db: 9, enable_limiter: 1, analog_gain_controller { enabled: 1, startup_min_volume: 0, clipped_level_min: 70, enable_digital_adaptive: 1, clipped_level_step: 15, clipped_ratio_threshold: 0.1, clipped_wait_frames: 300, clipping_predictor:  { enabled: 0, mode: 0, window_length: 5, reference_window_length: 5, reference_window_delay: 5, clipping_threshold: -1, crest_factor_margin: 3, use_predicted_step: 1 }}}, gain_controller2: { enabled: 0, fixed_digital: { gain_db: 0 }, adaptive_digital: { enabled: 0, headroom_db: 5, max_gain_db: 50, initial_gain_db: 15, max_gain_change_db_per_second: 6, max_output_noise_level_dbfs: -50 }, input_volume_control : { enabled 0}}
(RTCAudioTrack.mm:214): RTCAudioTrack init
(RTCAudioTrack.mm:37): RTCAudioTrack.AudioSinkConverter init
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:206 -[RTCCameraVideoCapturer startCaptureWithDevice:format:fps:completionHandler:]_block_invoke): startCaptureWithDevice <AVCaptureDeviceFormat: 0x300da91c0 'vide'/'420v' 1280x 720, { 1-120 fps}, photo dims:{1280x720}, fov:73.699, binned, supports vis (max strength:Low), max zoom:64.50 (upscales @1.43), AF System:1, ISO:20.0-800.0, SS:0.000041-1.000000, system exposure bias range:-2.0-2.0, supports Portrait Effect, supports Studio Lighting, supports Reactions> @ 30 fps
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:399 -[RTCCameraVideoCapturer handleCaptureSessionRuntimeError:]): Capture session runtime error: Error Domain=AVFoundationErrorDomain Code=-11873 "Cannot Record" UserInfo={NSLocalizedDescription=Cannot Record, AVErrorDeviceKey=<AVCaptureFigVideoDevice: 0x103a35e00 [Front Camera][com.apple.avfoundation.avcapturedevice.built-in_video:1]>, NSLocalizedRecoverySuggestion=Reset the camera to a supported active format, then restart the session., NSLocalizedFailureReason=The camera's active format is unsupported by this session.}
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:435 -[RTCCameraVideoCapturer handleFatalError]_block_invoke): Attempting to recover from fatal capture error.
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:447 -[RTCCameraVideoCapturer handleNonFatalError]_block_invoke): Restarting capture session after error.
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:399 -[RTCCameraVideoCapturer handleCaptureSessionRuntimeError:]): Capture session runtime error: Error Domain=AVFoundationErrorDomain Code=-11873 "Cannot Record" UserInfo={NSLocalizedDescription=Cannot Record, AVErrorDeviceKey=<AVCaptureFigVideoDevice: 0x103a35e00 [Front Camera][com.apple.avfoundation.avcapturedevice.built-in_video:1]>, NSLocalizedRecoverySuggestion=Reset the camera to a supported active format, then restart the session., NSLocalizedFailureReason=The camera's active format is unsupported by this session.}
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:439 -[RTCCameraVideoCapturer handleFatalError]_block_invoke): Previous fatal error recovery failed.
(RTCLogging.mm:33): (RTCAudioSession.mm:612 -[RTCAudioSession handleApplicationDidBecomeActive:]): Application became active after an interruption. Treating as interruption end. isInterrupted changed from 0 to 0.
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:463 -[RTCCameraVideoCapturer handleApplicationDidBecomeActive:]_block_invoke): Restarting capture session on active.
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:399 -[RTCCameraVideoCapturer handleCaptureSessionRuntimeError:]): Capture session runtime error: Error Domain=AVFoundationErrorDomain Code=-11873 "Cannot Record" UserInfo={NSLocalizedDescription=Cannot Record, AVErrorDeviceKey=<AVCaptureFigVideoDevice: 0x103a35e00 [Front Camera][com.apple.avfoundation.avcapturedevice.built-in_video:1]>, NSLocalizedRecoverySuggestion=Reset the camera to a supported active format, then restart the session., NSLocalizedFailureReason=The camera's active format is unsupported by this session.}
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:439 -[RTCCameraVideoCapturer handleFatalError]_block_invoke): Previous fatal error recovery failed.

Working Fine

Device: iPhone 7 OS Version: 15.8.3 Xcode: 16.1

Device: iPad Pro OS Version: 18.1 Xcode: 16.1

2024-11-25 15:53:21.996161+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Looking up debug dylib relative path
2024-11-25 15:53:21.996821+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Found debug dylib relative path string `WebRTC KMP Playground.debug.dylib`
2024-11-25 15:53:21.996831+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Looking up debug dylib entry point name
2024-11-25 15:53:21.996836+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] No debug dylib entry point name defined.
2024-11-25 15:53:21.996841+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Looking up debug dylib install name
2024-11-25 15:53:21.996848+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Found debug dylib install name string `@rpath/WebRTC KMP Playground.debug.dylib`
2024-11-25 15:53:21.996855+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Looking for Previews JIT link entry point.
2024-11-25 15:53:22.031688+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] No Previews JIT entry point found.
2024-11-25 15:53:22.031719+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Gave PreviewsInjection a chance to run and it returned, continuing with debug dylib.
2024-11-25 15:53:22.031726+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Looking for main entry point.
2024-11-25 15:53:22.031734+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Opening debug dylib with '@rpath/WebRTC KMP Playground.debug.dylib'
2024-11-25 15:53:22.031770+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Debug dylib handle: 0x209ce56e0
2024-11-25 15:53:22.031778+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] No entry point found. Checking for alias.
2024-11-25 15:53:22.031786+0100 WebRTC KMP Playground[35115:1060708] [PreviewsAgentExecutorLibrary] Calling provided entry point.
2024-11-25 15:53:22.233364+0100 WebRTC KMP Playground[35115:1060708] Metal GPU Frame Capture Enabled
2024-11-25 15:53:22.233667+0100 WebRTC KMP Playground[35115:1060708] Metal API Validation Enabled
2024-11-25 15:53:22.404599+0100 WebRTC KMP Playground[35115:1060708] fopen failed for data file: errno = 2 (No such file or directory)
2024-11-25 15:53:22.404705+0100 WebRTC KMP Playground[35115:1060708] Errors found! Invalidating cache...
2024-11-25 15:53:22.601553+0100 WebRTC KMP Playground[35115:1060708] fopen failed for data file: errno = 2 (No such file or directory)
2024-11-25 15:53:22.601675+0100 WebRTC KMP Playground[35115:1060708] Errors found! Invalidating cache...
(RTCLogging.mm:33): (RTCAudioSession.mm:117 -[RTCAudioSession initWithAudioSession:]): RTC_OBJC_TYPE(RTCAudioSession) (0x283d94100): init.
(RTCLogging.mm:33): (RTCAudioSession+Configuration.mm:104 -[RTCAudioSession(Configuration) setConfiguration:active:shouldSetActive:error:]): Set preferred sample rate to: 48000.00
(RTCLogging.mm:33): (RTCAudioSession+Configuration.mm:119 -[RTCAudioSession(Configuration) setConfiguration:active:shouldSetActive:error:]): Set preferred IO buffer duration to: 0.020000
(RTCLogging.mm:33): (RTCAudioSession.mm:612 -[RTCAudioSession handleApplicationDidBecomeActive:]): Application became active after an interruption. Treating as interruption end. isInterrupted changed from 0 to 0.
(audio_device_module_ios.mm:45): current platform is IOS
(audio_device_module_ios.mm:46): iPhone Audio APIs will be utilized.
(RTCLogging.mm:33): (RTCAudioDeviceModule.mm:52 -[RTCAudioDeviceModule initWithNativeModule:workerThread:]): RTCAudioDeviceModule initWithNativeModule:workerThread:
(audio_device_module_ios.mm:671): SetAudioDeviceSink(81199c70) Not implemented
(input_volume_stats_reporter.cc:98): Will not log any `WebRTC.Audio.Apm.AppliedInputVolume.*` histogram stats.
(input_volume_stats_reporter.cc:98): Will not log any `WebRTC.Audio.Apm.RecommendedInputVolume.*` histogram stats.
(audio_processing_impl.cc:697): Injected APM submodules:
Echo control factory: 0
Echo detector: 0
Capture analyzer: 0
Capture post processor: 0
Render pre processor: 0
(audio_processing_impl.cc:710): AudioProcessing: AudioProcessing::Config{ pipeline: { maximum_internal_processing_rate: 48000, multi_channel_render: 0, multi_channel_capture: 0 }, pre_amplifier: { enabled: 0, fixed_gain_factor: 1 },capture_level_adjustment: { enabled: 0, pre_gain_factor: 1, post_gain_factor: 1, analog_mic_gain_emulation: { enabled: 0, initial_level: 255 }}, high_pass_filter: { enabled: 0 }, echo_canceller: { enabled: 0, mobile_mode: 0, enforce_high_pass_filtering: 1 }, noise_suppression: { enabled: 0, level: Moderate }, transient_suppression: { enabled: 0 }, gain_controller1: { enabled: 0, mode: AdaptiveAnalog, target_level_dbfs: 3, compression_gain_db: 9, enable_limiter: 1, analog_gain_controller { enabled: 1, startup_min_volume: 0, clipped_level_min: 70, enable_digital_adaptive: 1, clipped_level_step: 15, clipped_ratio_threshold: 0.1, clipped_wait_frames: 300, clipping_predictor:  { enabled: 0, mode: 0, window_length: 5, reference_window_length: 5, reference_window_delay: 5, clipping_threshold: -1, crest_factor_margin: 3, use_predicted_step: 1 }}}, gain_controller2: { enabled: 0, fixed_digital: { gain_db: 0 }, adaptive_digital: { enabled: 0, headroom_db: 5, max_gain_db: 50, initial_gain_db: 15, max_gain_change_db_per_second: 6, max_output_noise_level_dbfs: -50 }, input_volume_control : { enabled 0}}
(webrtc_voice_engine.cc:354): WebRtcVoiceEngine::WebRtcVoiceEngine
(webrtc_voice_engine.cc:376): WebRtcVoiceEngine::Init
(audio_device_buffer.cc:66): AudioDeviceBuffer::ctor
(audio_device_ios.mm:109): AudioDeviceIOS::ctor<NSThread: 0x2806fc1c0>{number = 8, name = (null)},bypass_voice_processing=0
(audio_device_ios.mm:129): AudioDeviceIOS::AttachAudioBuffer
(audio_device_ios.mm:136): AudioDeviceIOS::Init
(audio_device_ios.mm:704): AudioDeviceIOS::UpdateAudioDevicebuffer
(audio_device_buffer.cc:203): SetPlayoutSampleRate(48000)
(audio_device_buffer.cc:223): SetPlayoutChannels(1)
(audio_device_buffer.cc:197): SetRecordingSampleRate(48000)
(audio_device_buffer.cc:217): SetRecordingChannels(1)
(audio_device_ios.mm:1072): SetPlayoutDevice: Not implemented
(audio_device_ios.mm:1125): SetStereoPlayout: Not implemented
(audio_device_module_ios.mm:330): stereo playout is not supported
(adm_helpers.cc:57): Failed to set stereo playout mode.
(audio_device_ios.mm:1174): SetRecordingDevice: Not implemented
(adm_helpers.cc:77): Failed to set stereo recording mode.
(webrtc_voice_engine.cc:478): WebRtcVoiceEngine::ApplyOptions: AudioOptions {aec: 1, agc: 1, ns: 0, hf: 1, swap: 0, audio_jitter_buffer_max_packets: 200, audio_jitter_buffer_fast_accelerate: 0, audio_jitter_buffer_min_delay_ms: 0, }
(webrtc_voice_engine.cc:497): Always disable AEC on iOS. Use built-in instead.
(webrtc_voice_engine.cc:507): Always disable AGC on iOS. Use built-in instead.
(audio_device_generic.cc:18): BuiltInAECIsAvailable: Not supported on this platform
(audio_device_generic.cc:28): BuiltInAGCIsAvailable: Not supported on this platform
(audio_device_generic.cc:38): BuiltInNSIsAvailable: Not supported on this platform
(audio_processing_impl.cc:913): AudioProcessing::ApplyConfig: AudioProcessing::Config{ pipeline: { maximum_internal_processing_rate: 48000, multi_channel_render: 0, multi_channel_capture: 0 }, pre_amplifier: { enabled: 0, fixed_gain_factor: 1 },capture_level_adjustment: { enabled: 0, pre_gain_factor: 1, post_gain_factor: 1, analog_mic_gain_emulation: { enabled: 0, initial_level: 255 }}, high_pass_filter: { enabled: 1 }, echo_canceller: { enabled: 0, mobile_mode: 0, enforce_high_pass_filtering: 1 }, noise_suppression: { enabled: 0, level: High }, transient_suppression: { enabled: 0 }, gain_controller1: { enabled: 0, mode: FixedDigital, target_level_dbfs: 3, compression_gain_db: 9, enable_limiter: 1, analog_gain_controller { enabled: 1, startup_min_volume: 0, clipped_level_min: 70, enable_digital_adaptive: 1, clipped_level_step: 15, clipped_ratio_threshold: 0.1, clipped_wait_frames: 300, clipping_predictor:  { enabled: 0, mode: 0, window_length: 5, reference_window_length: 5, reference_window_delay: 5, clipping_threshold: -1, crest_factor_margin: 3, use_predicted_step: 1 }}}, gain_controller2: { enabled: 0, fixed_digital: { gain_db: 0 }, adaptive_digital: { enabled: 0, headroom_db: 5, max_gain_db: 50, initial_gain_db: 15, max_gain_change_db_per_second: 6, max_output_noise_level_dbfs: -50 }, input_volume_control : { enabled 0}}
(RTCAudioTrack.mm:214): RTCAudioTrack init
(RTCAudioTrack.mm:37): RTCAudioTrack.AudioSinkConverter init
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:206 -[RTCCameraVideoCapturer startCaptureWithDevice:format:fps:completionHandler:]_block_invoke): startCaptureWithDevice <AVCaptureDeviceFormat: 0x28119a360 'vide'/'420v' 1280x 720, { 2- 60 fps}, HRSI:1920x1080, fov:63.898, binned, max zoom:67.50 (upscales @1.50), ISO:23.0-2208.0, SS:0.000013-0.500000> @ 30 fps
2024-11-25 15:53:24.854017+0100 WebRTC KMP Playground[35115:1060983] *** -[AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (
    Width,
    Height
)
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:416 -[RTCCameraVideoCapturer handleCaptureSessionDidStartRunning:]): Capture session started.
(RTCLogging.mm:33): (RTCAudioSession.mm:612 -[RTCAudioSession handleApplicationDidBecomeActive:]): Application became active after an interruption. Treating as interruption end. isInterrupted changed from 0 to 0.
shepeliev commented 3 days ago

@aschulz90 it seems to be an issue with iOS 18.1.1. I can reproduce it with my iPhone 13. Thanks for reporting. I'll try to figure out as soon as be able.

aschulz90 commented 3 days ago

I have updated the iPad to 18.1.1 now as well. There it is still working fine. So iPadOS doesn't seem to be affected.

(RTCLogging.mm:33): (RTCAudioSession.mm:117 -[RTCAudioSession initWithAudioSession:]): RTC_OBJC_TYPE(RTCAudioSession) (0x300f61d00): init.
(RTCLogging.mm:33): (RTCAudioSession+Configuration.mm:104 -[RTCAudioSession(Configuration) setConfiguration:active:shouldSetActive:error:]): Set preferred sample rate to: 48000.00
(RTCLogging.mm:33): (RTCAudioSession+Configuration.mm:119 -[RTCAudioSession(Configuration) setConfiguration:active:shouldSetActive:error:]): Set preferred IO buffer duration to: 0.020000
(RTCLogging.mm:33): (RTCAudioSession.mm:612 -[RTCAudioSession handleApplicationDidBecomeActive:]): Application became active after an interruption. Treating as interruption end. isInterrupted changed from 0 to 0.
(audio_device_module_ios.mm:45): current platform is IOS
(audio_device_module_ios.mm:46): iPhone Audio APIs will be utilized.
(RTCLogging.mm:33): (RTCAudioDeviceModule.mm:52 -[RTCAudioDeviceModule initWithNativeModule:workerThread:]): RTCAudioDeviceModule initWithNativeModule:workerThread:
(audio_device_module_ios.mm:671): SetAudioDeviceSink(2352f40) Not implemented
(input_volume_stats_reporter.cc:98): Will not log any `WebRTC.Audio.Apm.AppliedInputVolume.*` histogram stats.
(input_volume_stats_reporter.cc:98): Will not log any `WebRTC.Audio.Apm.RecommendedInputVolume.*` histogram stats.
(audio_processing_impl.cc:697): Injected APM submodules:
Echo control factory: 0
Echo detector: 0
Capture analyzer: 0
Capture post processor: 0
Render pre processor: 0
(audio_processing_impl.cc:710): AudioProcessing: AudioProcessing::Config{ pipeline: { maximum_internal_processing_rate: 48000, multi_channel_render: 0, multi_channel_capture: 0 }, pre_amplifier: { enabled: 0, fixed_gain_factor: 1 },capture_level_adjustment: { enabled: 0, pre_gain_factor: 1, post_gain_factor: 1, analog_mic_gain_emulation: { enabled: 0, initial_level: 255 }}, high_pass_filter: { enabled: 0 }, echo_canceller: { enabled: 0, mobile_mode: 0, enforce_high_pass_filtering: 1 }, noise_suppression: { enabled: 0, level: Moderate }, transient_suppression: { enabled: 0 }, gain_controller1: { enabled: 0, mode: AdaptiveAnalog, target_level_dbfs: 3, compression_gain_db: 9, enable_limiter: 1, analog_gain_controller { enabled: 1, startup_min_volume: 0, clipped_level_min: 70, enable_digital_adaptive: 1, clipped_level_step: 15, clipped_ratio_threshold: 0.1, clipped_wait_frames: 300, clipping_predictor:  { enabled: 0, mode: 0, window_length: 5, reference_window_length: 5, reference_window_delay: 5, clipping_threshold: -1, crest_factor_margin: 3, use_predicted_step: 1 }}}, gain_controller2: { enabled: 0, fixed_digital: { gain_db: 0 }, adaptive_digital: { enabled: 0, headroom_db: 5, max_gain_db: 50, initial_gain_db: 15, max_gain_change_db_per_second: 6, max_output_noise_level_dbfs: -50 }, input_volume_control : { enabled 0}}
(webrtc_voice_engine.cc:354): WebRtcVoiceEngine::WebRtcVoiceEngine
(webrtc_voice_engine.cc:376): WebRtcVoiceEngine::Init
(audio_device_buffer.cc:66): AudioDeviceBuffer::ctor
(audio_device_ios.mm:109): AudioDeviceIOS::ctor<NSThread: 0x303403980>{number = 12, name = (null)},bypass_voice_processing=0
(audio_device_ios.mm:129): AudioDeviceIOS::AttachAudioBuffer
(audio_device_ios.mm:136): AudioDeviceIOS::Init
(audio_device_ios.mm:704): AudioDeviceIOS::UpdateAudioDevicebuffer
(audio_device_buffer.cc:203): SetPlayoutSampleRate(48000)
(audio_device_buffer.cc:223): SetPlayoutChannels(1)
(audio_device_buffer.cc:197): SetRecordingSampleRate(48000)
(audio_device_buffer.cc:217): SetRecordingChannels(1)
(audio_device_ios.mm:1072): SetPlayoutDevice: Not implemented
(audio_device_ios.mm:1125): SetStereoPlayout: Not implemented
(audio_device_module_ios.mm:330): stereo playout is not supported
(adm_helpers.cc:57): Failed to set stereo playout mode.
(audio_device_ios.mm:1174): SetRecordingDevice: Not implemented
(adm_helpers.cc:77): Failed to set stereo recording mode.
(webrtc_voice_engine.cc:478): WebRtcVoiceEngine::ApplyOptions: AudioOptions {aec: 1, agc: 1, ns: 0, hf: 1, swap: 0, audio_jitter_buffer_max_packets: 200, audio_jitter_buffer_fast_accelerate: 0, audio_jitter_buffer_min_delay_ms: 0, }
(webrtc_voice_engine.cc:497): Always disable AEC on iOS. Use built-in instead.
(webrtc_voice_engine.cc:507): Always disable AGC on iOS. Use built-in instead.
(audio_device_generic.cc:18): BuiltInAECIsAvailable: Not supported on this platform
(audio_device_generic.cc:28): BuiltInAGCIsAvailable: Not supported on this platform
(audio_device_generic.cc:38): BuiltInNSIsAvailable: Not supported on this platform
(audio_processing_impl.cc:913): AudioProcessing::ApplyConfig: AudioProcessing::Config{ pipeline: { maximum_internal_processing_rate: 48000, multi_channel_render: 0, multi_channel_capture: 0 }, pre_amplifier: { enabled: 0, fixed_gain_factor: 1 },capture_level_adjustment: { enabled: 0, pre_gain_factor: 1, post_gain_factor: 1, analog_mic_gain_emulation: { enabled: 0, initial_level: 255 }}, high_pass_filter: { enabled: 1 }, echo_canceller: { enabled: 0, mobile_mode: 0, enforce_high_pass_filtering: 1 }, noise_suppression: { enabled: 0, level: High }, transient_suppression: { enabled: 0 }, gain_controller1: { enabled: 0, mode: FixedDigital, target_level_dbfs: 3, compression_gain_db: 9, enable_limiter: 1, analog_gain_controller { enabled: 1, startup_min_volume: 0, clipped_level_min: 70, enable_digital_adaptive: 1, clipped_level_step: 15, clipped_ratio_threshold: 0.1, clipped_wait_frames: 300, clipping_predictor:  { enabled: 0, mode: 0, window_length: 5, reference_window_length: 5, reference_window_delay: 5, clipping_threshold: -1, crest_factor_margin: 3, use_predicted_step: 1 }}}, gain_controller2: { enabled: 0, fixed_digital: { gain_db: 0 }, adaptive_digital: { enabled: 0, headroom_db: 5, max_gain_db: 50, initial_gain_db: 15, max_gain_change_db_per_second: 6, max_output_noise_level_dbfs: -50 }, input_volume_control : { enabled 0}}
(RTCAudioTrack.mm:214): RTCAudioTrack init
(RTCAudioTrack.mm:37): RTCAudioTrack.AudioSinkConverter init
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:206 -[RTCCameraVideoCapturer startCaptureWithDevice:format:fps:completionHandler:]_block_invoke): startCaptureWithDevice <AVCaptureDeviceFormat: 0x302341ff0 'vide'/'420v' 1280x 720, { 1- 60 fps}, photo dims:{1280x720,1408x792}, fov:85.655, gdc fov:85.901, binned, supports vis (max strength:Low), max zoom:45.00 (upscales @1.00), ISO:20.0-1920.0, SS:0.000022-1.000000, system exposure bias range:-2.0-2.0, supports multicam, supports Center Stage, supports CS RoI, supports Portrait Effect, supports Studio Lighting, supports Reactions> @ 30 fps
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:416 -[RTCCameraVideoCapturer handleCaptureSessionDidStartRunning:]): Capture session started.
(RTCLogging.mm:33): (RTCAudioSession.mm:612 -[RTCAudioSession handleApplicationDidBecomeActive:]): Application became active after an interruption. Treating as interruption end. isInterrupted changed from 0 to 0.
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:390 -[RTCCameraVideoCapturer handleCaptureSessionInterruption:]): Capture session interrupted: VideoDeviceNotAvailableInBackground
(RTCLogging.mm:33): (RTCCameraVideoCapturer.m:427 -[RTCCameraVideoCapturer handleCaptureSessionDidStopRunning:]): Capture session stopped.
shepeliev commented 1 day ago

Well, I found that the core issue seems to be in iOS WebRTC-SDK. Linking the sample app with v.125.6422.04 solves the problem. For now, it could be a workaround. I've created an issue at @webrtc-sdk repo: https://github.com/webrtc-sdk/Specs/issues/10