The sample crashes on any device besides Samsung Galaxy 10. From what I see, something's wrong with preview configuration. Note that the below error pops before even the recording esssion is started, while trying to show high speed session preview.
The stack:
E/CameraManagerGlobal: Camera 4 is not available. Ignore physical camera status change
E/CameraManagerGlobal: Camera 5 is not available. Ignore physical camera status change
E/CameraFragment: Camera 0 error: (4) Fatal (device)
java.lang.RuntimeException: Camera 0 error: (4) Fatal (device)
at com.example.android.camera2.slowmo.fragments.CameraFragment$openCamera$2$1.onError(CameraFragment.kt:405)
at android.hardware.camera2.impl.CameraDeviceImpl.notifyError(CameraDeviceImpl.java:1893)
at android.hardware.camera2.impl.CameraDeviceImpl.$r8$lambda$KBQCqQRdhVVn7uHI9Xdha6OqnsU(Unknown Source:0)
at android.hardware.camera2.impl.CameraDeviceImpl$$ExternalSyntheticLambda0.accept(Unknown Source:8)
at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:281)
at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:204)
at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:241)
at android.os.Looper.loop(Looper.java:358)
at android.os.HandlerThread.run(HandlerThread.java:67)
E/CameraCaptureSession: Session 0: Exception while stopping repeating:
android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error
at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2510)
at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1377)
at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:596)
at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:808)
at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:284)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:241)
at android.os.Looper.loop(Looper.java:358)
at android.os.HandlerThread.run(HandlerThread.java:67)
The sample crashes on any device besides Samsung Galaxy 10. From what I see, something's wrong with preview configuration. Note that the below error pops before even the recording esssion is started, while trying to show high speed session preview.
The stack:
E/CameraManagerGlobal: Camera 4 is not available. Ignore physical camera status change E/CameraManagerGlobal: Camera 5 is not available. Ignore physical camera status change E/CameraFragment: Camera 0 error: (4) Fatal (device) java.lang.RuntimeException: Camera 0 error: (4) Fatal (device) at com.example.android.camera2.slowmo.fragments.CameraFragment$openCamera$2$1.onError(CameraFragment.kt:405) at android.hardware.camera2.impl.CameraDeviceImpl.notifyError(CameraDeviceImpl.java:1893) at android.hardware.camera2.impl.CameraDeviceImpl.$r8$lambda$KBQCqQRdhVVn7uHI9Xdha6OqnsU(Unknown Source:0) at android.hardware.camera2.impl.CameraDeviceImpl$$ExternalSyntheticLambda0.accept(Unknown Source:8) at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:281) at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:204) at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:241) at android.os.Looper.loop(Looper.java:358) at android.os.HandlerThread.run(HandlerThread.java:67) E/CameraCaptureSession: Session 0: Exception while stopping repeating: android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): The camera device has encountered a serious error at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2510) at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1377) at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:596) at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:808) at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:284) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:241) at android.os.Looper.loop(Looper.java:358) at android.os.HandlerThread.run(HandlerThread.java:67)