From patchwork Thu Nov 26 12:32:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10502 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E0BC4BE176 for ; Thu, 26 Nov 2020 12:32:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B055163461; Thu, 26 Nov 2020 13:32:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qnpoYI0e"; dkim-atps=neutral Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B846063449 for ; Thu, 26 Nov 2020 13:32:11 +0100 (CET) Received: by mail-ej1-x62b.google.com with SMTP id oq3so2679552ejb.7 for ; Thu, 26 Nov 2020 04:32:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/pSU3BOgrEJ51O03wWUnGTA4E3xeSmlleW7QcokDXz8=; b=qnpoYI0eU6GB23VHHSqjhGwmkO9CyUqH+bU9c3D4DCEMzJXkJATrIt5+a2tWVB2mqx Nmz3xfg1clF/OlWqYNjkgNek5hq0Rc0bPrQekptMIZGN+4tVHQ6ZZAixC0urLyJIeXiV 1kJp2qXFuqU5e/rSbKj5m8vKrPQJvu/EocQlBpfQpzHCJyfnVRJg+gjRK7A9VtOYXflS zG5u0gd4RmXPkg2Bdi6BWKTlQk6XV52kWXYybFOuN1FPpeJwwGnGFnK/7LMHMT1Ae0DC ZD7DkN+nH4FH1LIdsPe4Nz6KuoJ74kAqqrt7Yn29S/NRp0/aALnsZHoTIu0xos0UDI1q qIrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/pSU3BOgrEJ51O03wWUnGTA4E3xeSmlleW7QcokDXz8=; b=HQPUIk5TCItOl4hUgEjWNWa31zpYDGHUumlqXJ6V2SiYJ5NmrDq8+Dt804fGtd9ZyB zacP3EosKZYLvEKzsW/regPJOhRFFA7sY4upIu+uIFD+RFPVtAwUx93goNJABAHoc04v mFX+fnElhto2+FYqvBSk40qWajkRaC+8nFKmx6tbAzYqajiHQ1sLq86ank6OfxO1mdtI 8jIMbcYaFa8hDEjUtC5wbD/DZFATjYeRyfgWMzWUJsGsyW/wt0tw8bD3GvLT33p5Q6cC 83IYGoX7l2i1qwRDSmYeqDCfJjzanod9Ko0UlhHCWucmF5IScoYHa2yMjxN8ltw8tDEZ IqJw== X-Gm-Message-State: AOAM532Xtx0q2H/SyKYaU6+Si+L4e7KrMdxJVB/axYqaUkmI/YDifAFQ fspMHacncIaOCexHvCkfhaiDYrcv1KF1fhNB X-Google-Smtp-Source: ABdhPJx2f/acB7vp9e99tVvxaFdQk+vFpVB35RiuxrgtjUMY8NbCLf3YO07atHf/Z78bUkxGlMJ7HA== X-Received: by 2002:a17:906:5243:: with SMTP id y3mr2466874ejm.273.1606393930277; Thu, 26 Nov 2020 04:32:10 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id u5sm3064354edp.5.2020.11.26.04.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 04:32:09 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 12:32:00 +0000 Message-Id: <20201126123203.19105-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126123203.19105-1-david.plowman@raspberrypi.com> References: <20201126123203.19105-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/4] src: ipa: raspberrypi: Avoid AGC filtering when both gain and shutter specified X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When both gain and shutter have been directly specified, do not filter slowly towards those target values, but adopt them immediately. This should match user expectations better. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index 4c56bdc9..30a1c1c1 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -588,7 +588,12 @@ bool Agc::applyDigitalGain(double gain, double target_Y) void Agc::filterExposure(bool desaturate) { - double speed = frame_count_ <= config_.startup_frames ? 1.0 : config_.speed; + double speed = config_.speed; + // AGC adapts instantly if both shutter and gain are directly specified + // or we're in the startup phase. + if ((status_.fixed_shutter && status_.fixed_analogue_gain) || + frame_count_ <= config_.startup_frames) + speed = 1.0; if (filtered_.total_exposure == 0.0) { filtered_.total_exposure = target_.total_exposure; filtered_.total_exposure_no_dg = target_.total_exposure_no_dg; From patchwork Thu Nov 26 12:32:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10503 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0BD21BE176 for ; Thu, 26 Nov 2020 12:32:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2FFB96345C; Thu, 26 Nov 2020 13:32:14 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Btkl4vDc"; dkim-atps=neutral Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9150B63449 for ; Thu, 26 Nov 2020 13:32:12 +0100 (CET) Received: by mail-ej1-x634.google.com with SMTP id hb22so2455538ejb.12 for ; Thu, 26 Nov 2020 04:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9ktpT+D5PLVk79s3FjnYeYZukjakGS97umiZNbnJkx0=; b=Btkl4vDcI6JOks2CM6S3Qx1ZyT3QlAVFQcp6ULmSiJ4Ct1HiM1qOc7Yfa2pIZgjdBX m/AX3ajcJhV/BI1qZh+nQWTFFV+q2E5aBJOzIXRx6rixnpWypktbP3we1jj6aaV3MW+R 9QyWD6Uc1eAsMEjUrwEcG71O8I9E6Mv1wSTJoEXJ2op5m6u7Dbjd7LSw1b88vQVwiNNa hg29rLiazOZp3e7JxOeqrB0Z/BsPymhPGhLmv0rSHrfhh+aC/gYbT5iJeuqWghKezzK5 8UgrNxUyjFAT7vXF2am6H1jkyB65qC6fphw9XBA+02GvlFBRuQjCIqn32FX1K5nHQHWU IZDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ktpT+D5PLVk79s3FjnYeYZukjakGS97umiZNbnJkx0=; b=lpHy2nN7h9r3hwYE+x3S9Z3EtRjlKPRAfMsyrck1zAdXyE1q1EAqslIjE2DdPgH6wk NCvrsoqJs8BETvnDMLTod5kNKn4GFqgd+ZOxu0OccqOpe9aAlJbnLtfrfS3tikxNwpMx qTbKcPmvdXND/e0TXqwvbf2XBmP8XPON6wkm1LGBZWcuEe3lq3XHrFpmzRlbUvMiMBxw Q18p0wasq8wrKAB0nmFpTYE0dQPUlxRRVm0uFc9zi6NpOQMNqtEnjutOlzRsi9a4tb/O //NW837p8itFL3fO5YAJWnWMOAB2aN/NI59kdhnd/uJbWSHB+hiBHXb4AwP0XCtVG2Am 7B/Q== X-Gm-Message-State: AOAM5300gW0X7wiBEc7romGqn22Uxoh/n7+3Jz9bpoMalBu9JaG3YT10 +CsdZulNkWwns9ZNqlh1bZ+BoyB0rCb/zAqe X-Google-Smtp-Source: ABdhPJzWA8rUT6x4cxsFrRQ8SpWaC0V0QzKMfUkoH0r4Jg1G3p7HXigk+e6s3AUaIu4urRpUPG8Ziw== X-Received: by 2002:a17:906:170e:: with SMTP id c14mr2413082eje.117.1606393931960; Thu, 26 Nov 2020 04:32:11 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id u5sm3064354edp.5.2020.11.26.04.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 04:32:11 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 12:32:01 +0000 Message-Id: <20201126123203.19105-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126123203.19105-1-david.plowman@raspberrypi.com> References: <20201126123203.19105-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/4] src: ipa: raspberrypi: agc: Make AGC handle Pause/Resume for itself X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" AGC, when paused, sets the last exposure/gain it wrote to be its "fixed" values and will therefore continue to return them. When resumed, we clear them so that both will float again. This approach is better because AGC can be paused and we can subsequently change (for example) the exposure and the gain won't float again. Signed-off-by: David Plowman Reviewed-by: Kieran Bingham --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 24 ++++++++++++++++++++++ src/ipa/raspberrypi/controller/rpi/agc.hpp | 5 +++++ 2 files changed, 29 insertions(+) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index 30a1c1c1..9da18c31 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -184,6 +184,26 @@ void Agc::Read(boost::property_tree::ptree const ¶ms) exposure_mode_ = &config_.exposure_modes[exposure_mode_name_]; constraint_mode_name_ = config_.default_constraint_mode; constraint_mode_ = &config_.constraint_modes[constraint_mode_name_]; + // Set up the "last shutter/gain" values, in case AGC starts "disabled". + status_.shutter_time = config_.default_exposure_time; + status_.analogue_gain = config_.default_analogue_gain; +} + +bool Agc::IsPaused() const +{ + return false; +} + +void Agc::Pause() +{ + fixed_shutter_ = status_.shutter_time; + fixed_analogue_gain_ = status_.analogue_gain; +} + +void Agc::Resume() +{ + fixed_shutter_ = 0; + fixed_analogue_gain_ = 0; } void Agc::SetEv(double ev) @@ -199,11 +219,15 @@ void Agc::SetFlickerPeriod(double flicker_period) void Agc::SetFixedShutter(double fixed_shutter) { fixed_shutter_ = fixed_shutter; + // Set this in case someone calls Pause() straight after. + status_.shutter_time = fixed_shutter; } void Agc::SetFixedAnalogueGain(double fixed_analogue_gain) { fixed_analogue_gain_ = fixed_analogue_gain; + // Set this in case someone calls Pause() straight after. + status_.analogue_gain = fixed_analogue_gain; } void Agc::SetMeteringMode(std::string const &metering_mode_name) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp index 47ebb324..8a1a20e6 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.hpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp @@ -70,6 +70,11 @@ public: Agc(Controller *controller); char const *Name() const override; void Read(boost::property_tree::ptree const ¶ms) override; + // AGC handles "pausing" for itself. + bool IsPaused() const; + void Pause(); + void Resume(); + unsigned int GetFrameDrops() const override; void SetEv(double ev) override; void SetFlickerPeriod(double flicker_period) override; void SetFixedShutter(double fixed_shutter) override; // microseconds From patchwork Thu Nov 26 12:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10504 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 3BB5ABE176 for ; Thu, 26 Nov 2020 12:32:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 09A8363461; Thu, 26 Nov 2020 13:32:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="t63TEj00"; dkim-atps=neutral Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C7B9363463 for ; Thu, 26 Nov 2020 13:32:13 +0100 (CET) Received: by mail-ej1-x630.google.com with SMTP id oq3so2679690ejb.7 for ; Thu, 26 Nov 2020 04:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UvoJ3Ey4fzjxOq8S+86z4FWYBiIf60CMkrI83WlclDs=; b=t63TEj000IgAA9LZTgC1jRxJOaMa7Pix6NXnjSgvQOpfVpj7UjiP2nlseSSnQAAnaE dylUycMAU8M2EFNNvIj/4n7yAIHChz5FPvD1sVsG9fGFohegnUkSOU2Otqbnakv3oDks DxqbyMVlxTO5AxVa6ifLlZ9vV5mckzKLT+Ju3CRhUdHFGHvoKIajS4Z414Q1i2tU194f LZCiVyR6mCk4o5SXCDsdMK/tLx8gVTRRggtCo81yzJlXs+SO69i/Vv1Xhdp+XX3AUTaW fKMyAZf/njwNcRa2TQnkACYYOIrFDEhYnty4m7W7HU24CELmfrgkQRF3Qb1ceehfN0Mj L84w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UvoJ3Ey4fzjxOq8S+86z4FWYBiIf60CMkrI83WlclDs=; b=EPVCZAhJIwM5rr1H6BefOHYwr+t6igXa/XehSub/2KCY+ADC2qmRw8etugZmL9XkUD reycRLOi7Hkz/7Ouswq0WScTa4Ifwm1oor5s0JUJhgbf0wOOG0g2VBilEvx59tacW05c aS4WNOq21fTE8vwhT7OnYoHpvVnhWOlpBUFCdqZX7OE7H93rZupIIt55lXZOhw5Ci770 udr4OS+tObwzrxOL0N9fytJcrND2vrgCFdI4nGYLHHPnTIWDLIMsA3y4ycPCTCtHxg2E QEA7kViESw30TDTy2IBwyySQFZmkgGqoE8+EbNGxKSwnZdCxQyw78XXYGc5S74be1hMe RxbQ== X-Gm-Message-State: AOAM532qjcRU/ghEcHAORWYn+4keErvuBJBZ2j0twBMdCrYbCtXweHYn SGVFahyP8RV1IKfN+7T5ZVX8NBLHrBhazRI/ X-Google-Smtp-Source: ABdhPJz8rQqzvoZDkvDcwRvGWbl2C/bXH/YNowqGZ1iqrTN6J+PeXvS/4pU3cPgqYM7v42/63FRt1Q== X-Received: by 2002:a17:906:b003:: with SMTP id v3mr2483187ejy.290.1606393932879; Thu, 26 Nov 2020 04:32:12 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id u5sm3064354edp.5.2020.11.26.04.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 04:32:12 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 12:32:02 +0000 Message-Id: <20201126123203.19105-4-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126123203.19105-1-david.plowman@raspberrypi.com> References: <20201126123203.19105-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/4] src: ipa: raspberrypi: Improve behaviour when AE disabled X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" AE/AGC "disabled" is now handled better by the algorithm for itself, so it no longer needs to be "resumed" before setting fixed shutter or gain values. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/ipa/raspberrypi/raspberrypi.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 9853a343..e437c626 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -495,6 +495,7 @@ void IPARPi::queueRequest(const ControlList &controls) case controls::AE_ENABLE: { RPiController::Algorithm *agc = controller_.GetAlgorithm("agc"); ASSERT(agc); + if (ctrl.second.get() == false) agc->Pause(); else @@ -512,10 +513,6 @@ void IPARPi::queueRequest(const ControlList &controls) /* This expects units of micro-seconds. */ agc->SetFixedShutter(ctrl.second.get()); - /* For the manual values to take effect, AGC must be unpaused. */ - if (agc->IsPaused()) - agc->Resume(); - libcameraMetadata_.set(controls::ExposureTime, ctrl.second.get()); break; } @@ -526,10 +523,6 @@ void IPARPi::queueRequest(const ControlList &controls) ASSERT(agc); agc->SetFixedAnalogueGain(ctrl.second.get()); - /* For the manual values to take effect, AGC must be unpaused. */ - if (agc->IsPaused()) - agc->Resume(); - libcameraMetadata_.set(controls::AnalogueGain, ctrl.second.get()); break; From patchwork Thu Nov 26 12:32:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10505 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A9A7EBE176 for ; Thu, 26 Nov 2020 12:32:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6E6B363467; Thu, 26 Nov 2020 13:32:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="inxP2XJr"; dkim-atps=neutral Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 065AA63449 for ; Thu, 26 Nov 2020 13:32:15 +0100 (CET) Received: by mail-ed1-x535.google.com with SMTP id q3so2072579edr.12 for ; Thu, 26 Nov 2020 04:32:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+NVlZDjzRN8Jm3viX7G6HYZHjp/sXYM7h/3wGLb47/w=; b=inxP2XJr5wxY427s1TzVxfg/bV1shgeri0dfZAgmJCro4fNctb10FmwRnHfCkZBpJW sphl+K4bPK6ePubF5rXCmIvvkbkgapJ0TGXNOcFgYQjXsChWIWKrSdhAWpIx4oQBgHli tdu49eyYHJGGpJdgTcP7K2Y6hf4TlWKe8YUY8mNzcn5GQMsoSABCqQ/4fcY1iHpDkVqU 8Op84aojOrJUp3aBByiTLdgFvh6lMhlBcksk2AyIvzkDcPf8UOOa+7PeEHJ0Fu44EpRI ic3ypc75Or2WSMfKOtPRDqaX/QhrYok+LRM50jgFtlmb7LUd3GDA4Um6v5uISWyNBbE9 zXyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+NVlZDjzRN8Jm3viX7G6HYZHjp/sXYM7h/3wGLb47/w=; b=IYtDT5vcm45XStqoemvcd3SuUT6oSW9YQumAgbEehlLlwb/JFP/uUrpJLour3gvn6w LO13cpTm06G2k2WefiFtuP3xLpDWnF3fHG0n8BlVDrOTnLtYVwSHeINskckOk6+N2XvF st8kkdA6bRKF4wU5bbjN5x9SLuJUsMBGnBr6cZ97wVusmAwsIrOvwZlsdc5SQsafEMEX wx73TU8ZzcSlnRrLLygytWIEJX9edNrvNtIQ2J/+3Qu3BdofxR8vJSNsByp0tThgQMnD gVf5ZZHieFRVtYcbZnEwLgNS9TeQWFuYTqmTr9onbxBP7RV/4L6bbKJJqdowwzJ0EFEX x/eQ== X-Gm-Message-State: AOAM530PGLtiaw9pUKYITnG5SZ5wBh+RqhBETjv8GMJPrazVw4cmv60i FQzZNPHLIKo6I8Rso0sqHzhNnJCsgMPxxTRH X-Google-Smtp-Source: ABdhPJyBfnMI2eacxFzh7NlmK7uB88mm4dkAqRM5A+Twv/2HZ8BlGb/e2YnSVdwrn/NUrAj9ZCkWYA== X-Received: by 2002:a05:6402:19b4:: with SMTP id o20mr2280350edz.103.1606393934278; Thu, 26 Nov 2020 04:32:14 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id u5sm3064354edp.5.2020.11.26.04.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 04:32:13 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 12:32:03 +0000 Message-Id: <20201126123203.19105-5-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126123203.19105-1-david.plowman@raspberrypi.com> References: <20201126123203.19105-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/4] src: ipa: raspberrypi: Fix initial AGC oscillation for imx219 sensor X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The exposure times in the exposure modes were causing AGC oscillations because the algorithm was demanding long unachievable exposure times but, without working sensor metadata, thought it was getting them when actually it was not. We fix it by making the exposure profile request only achievable exposure times, as we do for the ov5647 tuning. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/ipa/raspberrypi/data/imx219.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/raspberrypi/data/imx219.json b/src/ipa/raspberrypi/data/imx219.json index b03a7beb..212f8b9a 100644 --- a/src/ipa/raspberrypi/data/imx219.json +++ b/src/ipa/raspberrypi/data/imx219.json @@ -133,7 +133,7 @@ { "shutter": [ - 100, 10000, 30000, 60000, 120000 + 100, 10000, 30000, 30000, 30000 ], "gain": [ @@ -144,7 +144,7 @@ { "shutter": [ - 100, 5000, 10000, 20000, 120000 + 100, 5000, 10000, 20000, 30000 ], "gain": [