azure-sdk-for-ios icon indicating copy to clipboard operation
azure-sdk-for-ios copied to clipboard

[BUG] Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread causing UI unresponsiveness

Open ShawnHuangS opened this issue 1 month ago • 9 comments

Describe the bug

When initiating a video call and enabling the local video, the following error occurs: Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness. This issue causes my UI to freeze and become unresponsive.

Exception or Stack Trace

Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness PID: 4823, TID: 3378073 Backtrace ================================================================= 3 AzureCommunicationCalling 0x0000000106dee770 -[AVFoundationCapturer startImpl:frameRate:fourCC:] + 1116 4 libdispatch.dylib 0x00000001028b0b98 _dispatch_call_block_and_release + 32 5 libdispatch.dylib 0x00000001028b27bc _dispatch_client_callout + 20 6 libdispatch.dylib 0x00000001028c2d58 _dispatch_main_queue_drain + 1084 7 libdispatch.dylib 0x00000001028c290c _dispatch_main_queue_callback_4CF + 44 8 CoreFoundation 0x000000019b86151c 3A5F992A-D1CD-312E-BD2E-F7C66343A417 + 226588 9 CoreFoundation 0x000000019b85e218 3A5F992A-D1CD-312E-BD2E-F7C66343A417 + 213528 10 CoreFoundation 0x000000019b85d968 CFRunLoopRunSpecific + 608 11 GraphicsServices 0x00000001dfb534e0 GSEventRunModal + 164 12 UIKitCore 0x000000019dcd0edc 7BF01CFC-23F1-326A-AFD8-AD967FFECE28 + 2272988 13 UIKitCore 0x000000019dcd0518 UIApplicationMain + 340 14 UIKitCore 0x000000019df09734 7BF01CFC-23F1-326A-AFD8-AD967FFECE28 + 4601652 15 xxxxxxxxxxxxx 0x000000010084943c $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 120 16 xxxxxxxxxxxxx 0x00000001008493b4 $s1411AppDelegateC5$mainyyFZ + 44 17 xxxxxxxxxxxxx 0x000000010084c0b8 main + 28 18 dyld 0x00000001bed7ed84 7BE2B757-3B3D-3E91-8CB7-74F3887660C7 + 23940 error in connection_block_invoke_2: Connection invalid

To Reproduce

  1. Initiate a video call.
  2. Enable local video.
  3. Observe the UI becoming unresponsive.

Expected behavior

I expected the video call to start without causing the UI to freeze or become unresponsive.

Setup (please complete the following information):

  • OS: iOS 17.4.1
  • IDE : XCode
  • AzureCommunicationCalling 2.10.0

Additional context Even when attempting to call startRunning from a background thread, the issue persists.

ShawnHuangS avatar May 24 '24 03:05 ShawnHuangS