android / android/camera-samples
Camera2SlowMotion fails on most current devices
- Dominant language
- Kotlin
- Stars
- 5.5k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
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)
Contributor guide
Research direction
Reproduce Camera2SlowMotion on a current device other than the Samsung Galaxy 10, focusing on the high-speed session preview before recording starts. Read CameraFragment.kt around line 405 and trace the preview configuration that precedes the recording session. Done means the sample opens the camera and shows the high-speed preview without the fatal Camera 0 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100