When the HDR extension on the CameraX library is used (while using the back camera), while the preview is running logcat displays these lines continuously:
2024-08-30 09:58:54.550 21414-21461 cx/CaptureCallback com.mypackage V onCaptureProcessStarted, seq = 1
2024-08-30 09:58:54.555 21414-21461 cx/CaptureCallback com.mypackage V onCaptureCompleted, seq = 1, timestamp = 66168716018710
2024-08-30 09:58:54.592 21414-21460 cx/CaptureCallback com.mypackage V onCaptureStarted, seq = 1, timestamp = 66168776051314
2024-08-30 09:58:54.610 21414-21453 cx/CaptureCallback com.mypackage V onCaptureProcessStarted, seq = 1
2024-08-30 09:58:54.616 21414-21453 cx/CaptureCallback com.mypackage V onCaptureCompleted, seq = 1, timestamp = 66168776051314
2024-08-30 09:58:54.652 21414-21459 cx/CaptureCallback com.mypackage V onCaptureStarted, seq = 1, timestamp = 66168836083971
2024-08-30 09:58:54.672 21414-21460 cx/CaptureCallback com.mypackage V onCaptureProcessStarted, seq = 1
2024-08-30 09:58:54.679 21414-21460 cx/CaptureCallback com.mypackage V onCaptureCompleted, seq = 1, timestamp = 66168836083971
2024-08-30 09:58:54.713 21414-21453 cx/CaptureCallback com.mypackage V onCaptureStarted, seq = 1, timestamp = 66168896116575
2024-08-30 09:58:54.733 21414-21461 cx/CaptureCallback com.mypackage V onCaptureProcessStarted, seq = 1
2024-08-30 09:58:54.739 21414-21461 cx/CaptureCallback com.mypackage V onCaptureCompleted, seq = 1, timestamp = 66168896116575
2024-08-30 09:58:54.773 21414-21460 cx/CaptureCallback com.mypackage V onCaptureStarted, seq = 1, timestamp = 66168956149179
2024-08-30 09:58:54.795 21414-21459 cx/CaptureCallback com.mypackage V onCaptureProcessStarted, seq = 1
2024-08-30 09:58:54.800 21414-21459 cx/CaptureCallback com.mypackage V onCaptureCompleted, seq = 1, timestamp = 661689561491
This goes on and on. When capturing a photo, the capture callback is never called. In logcat I can see the following errors:
Surface no longer in use[total_surfaces=6, used_surfaces=4](androidx.camera.core.impl.SessionProcessorSurface@1258a6c}
--
CameraDevice.onError(): 0 failed with ERROR_CAMERA_DEVICE while in OPENED state. Will attempt recovering from error.
--
Attempt to reopen camera[0] after error[ERROR_CAMERA_DEVICE]
--
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:2513)
See the attached logcat file log1.txt.
When using the front camera, the preview issues the same logs while the preview is running. Capturing a photo sometimes work (looks like it works when there is not a lot of difference in light intensity). When it does not work, the following error is logged:
Tag name 'dynamicShotCaptureDuration' does not exist.
See the attached logcat file log2.txt.
I followed the API documentation. The sample library (
https://github.com/android/camera-samples) has the same behaviour. I also tried a third party CameraX app from the Play Store, taking a photo in HDR causes the same issue. Using code or an app that implements Camera2 directly does not cause any problems with HDR enabled.
Occurs with CameraX version: 1.3.4 and 1.4.0-rc01
I tried both PreviewView.ImplementationMode.PERFORMANCE and PreviewView.ImplementationMode.COMPATIBLE
Extensions Bokeh and Face Retouch do work.
Device: Samsung Galaxy A52s 5G
Model: SM-A528B/DS
Android version: 14 (build number UP1A.231005.007.A528BXXS9GXG5)