[libcamera-devel] [PATCH 03/10] ipa: add rkisp1 metadata to fix Android HAL

nicholas at rothemail.net nicholas at rothemail.net
Thu Oct 27 07:55:08 CEST 2022


From: Nicholas Roth <nicholas at rothemail.net>

Currently, the Android HAL does not work on rkisp1-based devices because
required FrameDurationLimits metadata is missing from the ISP
implementation.

This change introduces sensible defaults for FrameDurationLimits that
should generally work most of the time.

In theory, it should be possible to implement more sophisticated logic
to detect frame durations. The appropriate API hooks for doing so exist
and are used in IPAIPU3::updateControls(), although the implementation
may be suspect. This is left as future work.

Signed-off-by: Nicholas Roth <nicholas at rothemail.net>
---
 src/ipa/rkisp1/rkisp1.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index ba3c547e..c536852c 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -100,6 +100,13 @@ const ControlInfoMap::Map rkisp1Controls{
 	{ &controls::Contrast, ControlInfo(0.0f, 1.993f) },
 	{ &controls::Saturation, ControlInfo(0.0f, 1.993f) },
 	{ &controls::Sharpness, ControlInfo(0.0f, 10.0f, 1.0f) },
+	/* libcamera requires a fixed value for minimum frame duration,
+	 * but this depends on the frame size and the rkisp1 device datasheets
+	 * measure this in pixels per second. Neither the datasheets nor the driver
+	 * specify a maximum. The minimum below is for 1920x1920. The maximum
+	 * corresponds to two seconds. */
+	{ &controls::FrameDurationLimits, ControlInfo(48505, 2000000) },
+	{ &controls::draft::MaxLatency, ControlInfo(0) },
 	{ &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },
 };
 
-- 
2.34.1



More information about the libcamera-devel mailing list