I need to implement a feature in the Android application where I need to record a slow motion video with at least 120fps, if a device supports it. Now I found the Slow Motion example in the camera2 repository for Slow Motion video recording:
https://github.com/android/camera-samples/tree/main/Camera2SlowMotion
Here is the problem I found: I wasn't able to run the app on Android 11 devices, but somehow on Android 10 it does work (at least on pocophone f1).
I couldn't figure out why the camera failed to load on Android 11 devices (was testing on xiaomi mi 10 phone), I just know that it fails after this method call:
session.setRepeatingBurst(previewRequestList, null, cameraHandler)
inside the initializeCamera()
method call.
The next thing I did was running a bug report for both phones and I found that on Android 11 device, this popped up in the logs:
I CameraManagerGlobal: Connecting to camera service
W ServiceManager: Permission failure: android.permission.CAMERA_OPEN_CLOSE_LISTENER from uid=10224 pid=13211,
but on Android 10 it successfully loaded the cameras:
I CameraManagerGlobal: Connecting to camera service
D CAM_Camera2CompatAdapterCommon: All available camera ids: [0, 1, 2, 3, 4, 5]
D CAM_Camera2CompatAdapterCommon: ====================================================================
D CAM_Camera2CompatAdapterCommon: BACK: [main, aux, sat, bokeh, virtual, infrared] = [0, 2, 3, 4, -1, -1]
D CAM_Camera2CompatAdapterCommon: FRONT: [main, aux, sat, bokeh, virtual, infrared] = [1, 5, -1, -1, -1, -1]
D CAM_Camera2CompatAdapterCommon: ====================================================================
D CAM_Camera2CompatAdapterCommon: X: init()
By the way, session object is of type CameraConstrainedHighSpeedCaptureSession.
If anybody has an inclination how this issue could be solved, please share your answer.