From bb1aa92eb9ee7e713d997d5786129e88219e166a Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Tue, 29 Oct 2024 12:25:00 +0100 Subject: libcamera: software_isp: Initialize exposure+gain before agc calculations On my setup, since commit fb8ad13d ("libcamera: software_isp: Move exposure+gain to an algorithm module"), at start camera output stays very dark for dozen of seconds, and then later slowly gets to normal. This is because existing sensor exposure+gain settings are not used at start. We save initial values in frameContext but in the agc algorithm we use IPA context. Fix the problem by using in frameContext sensor values, since we already use those in blc algorithm and change exposure type to int32_t to unnecessary castings. Signed-off-by: Stanislaw Gruszka Reviewed-by: Milan Zamazal Tested-by: Robert Mader Tested-by: Kieran Bingham Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- src/ipa/simple/soft_simple.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ipa/simple/soft_simple.cpp') diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp index ac2a9421..ba3d5265 100644 --- a/src/ipa/simple/soft_simple.cpp +++ b/src/ipa/simple/soft_simple.cpp @@ -310,8 +310,8 @@ void IPASoftSimple::processStats(const uint32_t frame, ControlList ctrls(sensorInfoMap_); - auto &againNew = context_.activeState.agc.again; - ctrls.set(V4L2_CID_EXPOSURE, context_.activeState.agc.exposure); + auto &againNew = frameContext.sensor.gain; + ctrls.set(V4L2_CID_EXPOSURE, frameContext.sensor.exposure); ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast(camHelper_ ? camHelper_->gainCode(againNew) : againNew)); -- cgit v1.2.1