From patchwork Thu Nov 26 14:23:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10507 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 4B491BE08A for ; Thu, 26 Nov 2020 14:23:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 12C5863473; Thu, 26 Nov 2020 15:23:28 +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="MdDMEu6n"; dkim-atps=neutral Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0BAF76346C for ; Thu, 26 Nov 2020 15:23:26 +0100 (CET) Received: by mail-ed1-x52a.google.com with SMTP id n24so351284edb.4 for ; Thu, 26 Nov 2020 06:23:26 -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=MdDMEu6nq1CEFCwAROB3FId77xp/WxORviLGPv82RPZaWZoL2bs0BkxVy/KpuscrrZ zWEDAsOJnwdkTHanmg+3glafqnzcpbwgd0vEbuh9cF3LmW05VL3DnL+lbjZAStrDV+BL TtMrTkbc0uCtARaIo6QTAxMUsYePqEkKD8zlxU4ShFpvjnVsGbMRYoFbeJk38Ktxr7Iy NliT6wLe33xSE19csrrJhlcyA53Y5MAjO//BPr5SBSLk//fa5LE21X4HxL6hYX8ryFJU N3YieOq4yuwsl/6xvFf0VpMQLVFECQot5e5PeWBGKA7VgKghwREBAsEVotFxyQTmcg9V 4bCQ== 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=bl5gq7V05rze9zCG0cY8dGSYd8bA+13sAl+wHZ5hvxbdeVhdRLLgckGBzF8vrpI/Ug lasZob08AKR9NbDKxWHuthhuxIlEpwS29vLyjkOtN2UsBuaeCg0FVDo/HR+utl+P1ssB DtHNxlVl7SmdHKpxRWsCl40qnBFqhUosbkh9WgGI+iI5QxOWBdxMFCYlg0bhRqG81mxo VNs5CZZDBL8y3PS11oKEASvhUK/GmAJYGn47xMQ7wTRsm42unV0Q/Ix3bbvvZZ1HDhT6 qjI2Py40mj6tJEotXBtO2oq+nvaWS26cbguYaC/C3WiOP2mhSQG02c06QA5WyYeGG9hm UpyA== X-Gm-Message-State: AOAM530FU9Shr8wX+silDlZQTDhCUhyXMYcYfkhd/J9t8ugm5Tsvzwdn c6+C4QSbRMrpWgZvAnJj3mXVvEaIkUkn5TkU X-Google-Smtp-Source: ABdhPJz8xTwG/hVevQb6Wt8ClDebMoQo6cQhJ7yJ2vHNHwGWLN4jYtWtj1tsR1oGuVGwFbAHM+WdwA== X-Received: by 2002:a05:6402:1508:: with SMTP id f8mr2936889edw.350.1606400605389; Thu, 26 Nov 2020 06:23:25 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id f24sm3237003edx.90.2020.11.26.06.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 06:23:24 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 14:23:18 +0000 Message-Id: <20201126142321.5563-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126142321.5563-1-david.plowman@raspberrypi.com> References: <20201126142321.5563-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 14:23:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10508 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 4C251BE08A for ; Thu, 26 Nov 2020 14:23:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C7C5763470; Thu, 26 Nov 2020 15:23:28 +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="CAGV+q2i"; dkim-atps=neutral Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B19D6346B for ; Thu, 26 Nov 2020 15:23:27 +0100 (CET) Received: by mail-ej1-x62c.google.com with SMTP id a16so3188080ejj.5 for ; Thu, 26 Nov 2020 06:23:27 -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=oSLgktFCKL+BD4JC3I/jRKa0iCz7TO1buKMoSeXAMkQ=; b=CAGV+q2iwlRvNpiEziER/ZDZs2wG5g1hpcfn/t7JbKI1EHaZplRKFc2k93mUOwP0Sn QS5zlR4TCWAZDtwMkMChK6BUGTN39cEe3nXp2obHWQ6UtdELdeZHfTn+gU3fTOX7+eBX 1QBGKkP2jUHEfIRUdgswCBU9xPvD6l28UlvyjYI89SUX00yxhse5jdi8XDH9S3Ho4dqF J84vpM14qxWq9KQTBMbD5j39h1kmTkR5vR/giQP0P8CSze3+ulwDmJ4qvXi+rdL0ASIk u3I5jX/wS7tdWn3oAtmjjkztFopKjq2sNSXyVjuVupV0Ywk3B5CZLTydPp1aujfChH94 /5sw== 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=oSLgktFCKL+BD4JC3I/jRKa0iCz7TO1buKMoSeXAMkQ=; b=ekrEyY9ucxXIudi8wx/JBOgWlXPrN6lJhJnwKjauMJDEg5sWXmvEqzrZIgZbDuiCRD GdT2phd13yczrOY2gh4JIs7eQAYqPchDk9hBY6KD3juSfT4ZE9eSeUMYzYR8hOpGUX0D oa/NQ2SFBUf4BYDR2nDoFBAqeQQcDtVeKFxMI1AIryqsy/Gbq2VGiKhpsEQRKGyazYS3 W8lwz4DyO6GFiVJRycBbvadUFUm19WtdSVEdfAwFxk8IJJV29Q/dU1w/Gz1vbCcF0QpR l+Xrr9qP+viOkZcBgJncf6mHFGCrkE2PzqBStpPFr9FOd9hWEanFlc4ECzvebW7xFeRh lG7A== X-Gm-Message-State: AOAM530UDzYSr5O7VNLFMC/fXLq31AiYSPWtxv7Rwm/37ZaBpDLUWhnJ C8l6jDTOBb4QDv/1NEGJCRpf2vMvX83XFWbL X-Google-Smtp-Source: ABdhPJzxafgF6I0RfUTSIlpm1uDXZ5p3L5aDOur4KBm7kgX5VesN/2wC1xOWwwwqleDRQ/13NyGQWw== X-Received: by 2002:a17:906:d92c:: with SMTP id rn12mr2874757ejb.472.1606400606434; Thu, 26 Nov 2020 06:23:26 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id f24sm3237003edx.90.2020.11.26.06.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 06:23:25 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 14:23:19 +0000 Message-Id: <20201126142321.5563-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126142321.5563-1-david.plowman@raspberrypi.com> References: <20201126142321.5563-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 Reviewed-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 24 ++++++++++++++++++++++ src/ipa/raspberrypi/controller/rpi/agc.hpp | 4 ++++ 2 files changed, 28 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..95db1812 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.hpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp @@ -70,6 +70,10 @@ 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 override; + void Pause() override; + void Resume() override; void SetEv(double ev) override; void SetFlickerPeriod(double flicker_period) override; void SetFixedShutter(double fixed_shutter) override; // microseconds From patchwork Thu Nov 26 14:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10509 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 BA83DBE08A for ; Thu, 26 Nov 2020 14:23:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 89AB16346A; Thu, 26 Nov 2020 15:23:30 +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="ijaPUrGa"; dkim-atps=neutral Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0CA1163472 for ; Thu, 26 Nov 2020 15:23:28 +0100 (CET) Received: by mail-ed1-x531.google.com with SMTP id k1so2430012eds.13 for ; Thu, 26 Nov 2020 06:23:28 -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=F4f6KNupEAMJcITnVVSvovunsN/G4z8RTNdi2pn/g+Q=; b=ijaPUrGaBm0DKnfIrH0Y42/ZdQ4RF8gWmG6KioNV1DD6H5XEwfSYeFDfSyyj4E8U+T Bs8+5VpnpFkTtey8b6xg8163zN4eMSwbhtd1/kII8T166A/QsavMJuDXZrM1+X1PFcIz u42IY/Yi/9sZhmBnhWy62mIDnoq5/pl6Mmv4snnGNTApqpeTnTX3oztyjMMzAKio0ekC S8u7KiNKEKoBHtbqOLi+xLw80A9+oAQ5qnZi1Qe/uc2fJOSH1hGIAqG9AE/6t7dRJgzM iWGSrK87oQQjRpJLfq4+24de1uRQcjCLsVZpLwwxB/YPZk5yBjfw6FCXXkCOPsF8uPn7 GTAw== 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=F4f6KNupEAMJcITnVVSvovunsN/G4z8RTNdi2pn/g+Q=; b=uUOUC8mIjfmY9sGiWSFDGSJ2zjZCnV9UlsF7U5yvjdHWOa1wr8dpBrT2/X4MJSvln5 0sGH6mn1FyZjx1KvZTxt3ZitMsZAfvKLPk71G0WepFTlTNx4DN8AGBqshVRsQGjbbjFo 6DhnWnoI9MnIpDSrtafKv63atw11kG+bmrVfZyMH2MDeVWLJrzBrrlauncX0b+t6oZZm Ta7JfX1Z66Ky9fLUyilbJRO2sunIevS9t2oMMzITUGEvFZ5STtrwD2WjnuBmVFd3L8ci yRoEOGCxe0DSRJyI+B3DurRep9Bts3y5K1Eanm/bb9NB9VC9PixuJRZSniig5Ong/qp9 nD1Q== X-Gm-Message-State: AOAM5334xVuA+O0W9ZQ4xDt5388s4napwLklXPypqcxb6QOk8lzQai8A K5JDLk+OMr2TXKJuZwwhWm4lm9tabq3YVwbP X-Google-Smtp-Source: ABdhPJw7yh1Uaz+iqdK0MzYTVufayq11vW9ZZMZS4ZqdEpvHMRkidJu+VvxUiBZElaQFobn3R2hWBQ== X-Received: by 2002:aa7:cad2:: with SMTP id l18mr2738964edt.183.1606400607452; Thu, 26 Nov 2020 06:23:27 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id f24sm3237003edx.90.2020.11.26.06.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 06:23:26 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 14:23:20 +0000 Message-Id: <20201126142321.5563-4-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126142321.5563-1-david.plowman@raspberrypi.com> References: <20201126142321.5563-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/raspberrypi.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 9853a343..29d48b1b 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -512,10 +512,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 +522,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 14:23:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10510 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 3AB0CBE08A for ; Thu, 26 Nov 2020 14:23:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D83EA63479; Thu, 26 Nov 2020 15:23:30 +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="WD+BbYp7"; dkim-atps=neutral Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3668263469 for ; Thu, 26 Nov 2020 15:23:29 +0100 (CET) Received: by mail-ed1-x531.google.com with SMTP id q3so2438808edr.12 for ; Thu, 26 Nov 2020 06:23:29 -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=WD+BbYp7l8eIBxxcNNrqCYiD2jWTEyGzPHrCHoBEd1qY6BSlAuxudNMiUfu8K+aa2+ OwaGYTaOFA15/thlL9mVtgmQeTPrqk3VB86MMf3Wx2GA7kcEiPMhu+bdHL1MzqLJ9fPc FxCfB3KxRaDWUo082B1qoiefUUTYC2jX6jx0XfKjfNIISlLJ6Rz0p2hpjdHjhN4dXOXY cVNpcrgCxgOuGu8KDajm+abjQP/bbmfplfd36hGvkfUoAJG/E5x05O8wRMU80laSq1DJ FC1jbRoxzRcqnXk4UbghmlbRQOk/EAmJLzNhYvxuSTsIR5eKw9Z79c65tEWYnuPejktU z1AQ== 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=kE4uC3C/E+amY7wqdAoQXQ1LN8Y6kvYtZaMOuN/feFBMgptqORujwW6ro6FzEokmVR P+VydJR/3TGsKVu9mOPIL6vgm4oCKOqmS19cyFOUWNU01JPfhF8O6ZgH3ErWTl4LSXnw jRFysxW3zrj6XVLx4LJtVoz3fusUwRuzblt6XO0Rr+TvBhpn971TywVI1DsyaA9SHWbh FjCv/DcEMnOrl+ax45DHwZHyc7mxTPWb6u/Ncp8RnRglsTePGVAhM5XEtvZPe4+ynSlM y20m1jcMPWAZt8Ptg/RG0OrOnq9qKBfqbKk94UkE64SsLmtZYBw3Woqu25NfytCgwK9a 7UwA== X-Gm-Message-State: AOAM531CxMjtZLlkQUTDCj8h0lzpfkAlI/jwqWp8wSVZY8MguziVo6Yw OurpIlZ9t8hGjOZvJ42WFaPXVUi0n3WamQEZ X-Google-Smtp-Source: ABdhPJyE5XahOHpkiCcDLds5n9pKrrgP++onXpaQkVKdkEVOaDXqL7ZOg8UwTYYXqal3Uy40XS66Sg== X-Received: by 2002:aa7:d791:: with SMTP id s17mr2879448edq.272.1606400608657; Thu, 26 Nov 2020 06:23:28 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id f24sm3237003edx.90.2020.11.26.06.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 06:23:27 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 14:23:21 +0000 Message-Id: <20201126142321.5563-5-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126142321.5563-1-david.plowman@raspberrypi.com> References: <20201126142321.5563-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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": [