hardware: samsung_slsi:libcamera2: Fix Night scene mode crash
Fix the crash on snapshot under dark condition
by reducing response time to avoid capture sequencer timeout.
Change-Id: Ib072acf8dd490f72991914f1c1e4aff6494a4f9c
Signed-off-by: Sungjoong Kang <sj3.kang@samsung.com>
diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp
index ccc4f51..8af9261 100644
--- a/libcamera2/ExynosCameraHWInterface2.cpp
+++ b/libcamera2/ExynosCameraHWInterface2.cpp
@@ -2946,11 +2946,14 @@
shot_ext->shot.ctl.aa.afRegions[3] = lastAfRegion[3] = 0;
}
}
+ if (shot_ext->shot.ctl.aa.sceneMode == AA_SCENE_MODE_NIGHT
+ && shot_ext->shot.ctl.aa.aeMode == AA_AEMODE_LOCKED)
+ shot_ext->shot.ctl.aa.aeMode = AA_AEMODE_ON;
if (m_nightCaptureCnt == 0) {
if (shot_ext->shot.ctl.aa.captureIntent == AA_CAPTURE_INTENT_STILL_CAPTURE
&& shot_ext->shot.ctl.aa.sceneMode == AA_SCENE_MODE_NIGHT) {
shot_ext->shot.ctl.aa.sceneMode = AA_SCENE_MODE_NIGHT_CAPTURE;
- shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 2;
+ shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 8;
shot_ext->shot.ctl.aa.aeTargetFpsRange[1] = 30;
m_nightCaptureCnt = 4;
m_nightCaptureFrameCnt = matchedFrameCnt;
@@ -2959,12 +2962,19 @@
}
else if (m_nightCaptureCnt == 1) {
shot_ext->shot.ctl.aa.sceneMode = AA_SCENE_MODE_NIGHT_CAPTURE;
- shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 2;
+ shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 8;
shot_ext->shot.ctl.aa.aeTargetFpsRange[1] = 30;
m_nightCaptureCnt--;
shot_ext->request_scc = 1;
}
- else if (m_nightCaptureCnt == 2 || m_nightCaptureCnt == 3 || m_nightCaptureCnt == 4) {
+ else if (m_nightCaptureCnt == 2) {
+ shot_ext->shot.ctl.aa.sceneMode = AA_SCENE_MODE_NIGHT_CAPTURE;
+ shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 8;
+ shot_ext->shot.ctl.aa.aeTargetFpsRange[1] = 30;
+ m_nightCaptureCnt--;
+ shot_ext->request_scc = 0;
+ }
+ else if (m_nightCaptureCnt == 3 || m_nightCaptureCnt == 4) {
shot_ext->shot.ctl.aa.sceneMode = AA_SCENE_MODE_NIGHT_CAPTURE;
shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 2;
shot_ext->shot.ctl.aa.aeTargetFpsRange[1] = 30;