#Severe lag when starting a camera session/recording for the first time

1 messages · Page 1 of 1 (latest)

next tusk
#

I have seen this issue on both my own iOS app and the Camera Kit sample iOS app. Replicating the issue is rather simple: just launch the camera, select an AR lens, and start recording. The app would freeze for at least 3 seconds.

Upon closer inspection it seems that internally SCSDKCameraKit is hogging the main queue:

Thread Performance Checker: Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions
PID: 5636, TID: 2723222
Backtrace
=================================================================
3   SCSDKCameraKit                      0x0000000107b1c158 $sSo31SCCameraKitAdjustmentsProcessorP011SCSDKCameraB0E5apply10adjustment10ControllerQyd__qd___tKAC10AdjustmentRd__lF + 1302000
4   SCSDKCameraKit                      0x0000000107b1be3c $sSo31SCCameraKitAdjustmentsProcessorP011SCSDKCameraB0E5apply10adjustment10ControllerQyd__qd___tKAC10AdjustmentRd__lF + 1301204

Does anyone know a way around this? It's really bad UX and first impression for any user of the video recording feature in my app

brazen field
#

Hi @next tusk -- thank you for reporting this issue. The 3 second freeze it totally unexpected and not something our team has not been able to reproduce. Camera Kit SDK doesn't block the main thread.

As you point out there is a priority inversion in the logs. But we don't think this inversion impacts performance in this context. Our team still intends to fix it though.

Are you able to repro this issue on every lens or only certain lenses? Thanks again for bring this to our attention.

next tusk
#

Funny, after you said this I went and run the same code on the same device and codebase, and it doesn't happen anymore. Which is very strange, I have been encountering it for 2 weeks but now it's just gone.

I guess I'll consider this as resolved until I encounter it again!

However, in case you might want to verify it a little further, here was how I do it last time:
Device: iPhone 12 Pro
OS Version: iOS 17.5.1
Lens: CamKit Distortion
Sequence: Download and run the CameraKitSample application on device, switch to the Distortion lens. There will be 3-5 seconds freeze when selecting the lens, starting a recording, and closing a recording

brazen field
#

Thanks for the update @next tusk! Is CamKit Distortion a Lens that you made? Could you provide a Lens Id when you get a chance? This might have been caused by the Lens rather than the SDK or sample apps as we haven't had other similar reports. Your device and OS versions aren't unusual for Camera Kit

next tusk
#

@brazen field here's the lens group ID we used: 701c3cb8-a330-411d-b098-2f844a605fef

I've started seeing the issue again, the replication sequence is exactly as described in the previous message