From patchwork Tue Dec 1 17:55:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10536 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 3B8CBBE176 for ; Tue, 1 Dec 2020 17:55:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 49DBD63509; Tue, 1 Dec 2020 18:55:44 +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="BgTgEuso"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A59D63460 for ; Tue, 1 Dec 2020 18:55:43 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id z7so4043208wrn.3 for ; Tue, 01 Dec 2020 09:55:43 -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=Hu6oCAEIXM/Sa7+sottEdwvBv2khQQQ8N6nhPKg8HIM=; b=BgTgEusoHDfSxcuyizwK1eub+HdAH7JJFTS2TNenFLWEygX8HKklLKl7oCIVOMYkeu YZaK/ryVmACczCJF2lQ1QL2pEaKxzb5f+z23RaFdNln/YTxT9J8c5wWg3UeZ28/xJZ6d o+moa4LaeFoEJ+G6lbhrFmClgE5Z56VlmBGWQ4/3YELFoIcbPsgL4Wdvdx/77htIJCq0 TWRCZXGICA/OiPNWf5ygk4yie8XwZLUguUsnkRNl5ARQgmu60DdgCcQkGK9kTRvteyOh FDz/z7myxuoMJ7NNKuCS8LSJOGGeowqAq9iks6Tz/avAbLE8ozGt7sCnS31GauXNQuNw jbuw== 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=Hu6oCAEIXM/Sa7+sottEdwvBv2khQQQ8N6nhPKg8HIM=; b=D2vxqeDapW6iyra808t3sXsfQLE8htNmO9rX41VOcUre0iZp/32sUAzozp56DssCN9 /J4X6hkc4RH11qlCgQST9fT9DXsS9G1+iDRTidq5b0wVWYkIDuZbzlORM7SWOWvxb9z8 OaF6dFtCPqQHyqzPmzkGgdTOUmc2MbZ1y0+QoVxP52hnfHFSewJym4zv4FX0sToZ93ZD WytUdIGAJPLlxRol02jQiA55+nNQlIjTHYb0hVgEHN+0paHzCHu3NZV4U7Swh8FshnNR YO3k+rjMn5PZ2NUfyuMMgwG+x1TF+JZHGo5Mf9xDFSRl9BG8EuTet4nUdDd+70gJGtf+ BmEg== X-Gm-Message-State: AOAM532AaYXg/5jPlqVZg92n14yo71tH9Ss5/dvs0ffakf1BR9sHvG9m 8/fH78Jupx2enNnr+PpY0l9/20ZPzB1C1TwD X-Google-Smtp-Source: ABdhPJwMmxMcxpoMmZePa0HNHk6pirStJgZ4QeQeCyJtSqZW4oK56cEj0WcC0yt8zZff+7xZPR19AQ== X-Received: by 2002:adf:e5d0:: with SMTP id a16mr5549049wrn.340.1606845342947; Tue, 01 Dec 2020 09:55:42 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id l3sm438561wrr.89.2020.12.01.09.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:55:41 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 1 Dec 2020 17:55:32 +0000 Message-Id: <20201201175536.11093-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201201175536.11093-1-david.plowman@raspberrypi.com> References: <20201201175536.11093-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/5] 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 Tue Dec 1 17:55:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10537 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 1884EBE176 for ; Tue, 1 Dec 2020 17:55:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D5E736350A; Tue, 1 Dec 2020 18:55:46 +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="fZSvx52u"; dkim-atps=neutral Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6807F6350A for ; Tue, 1 Dec 2020 18:55:44 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id z7so4043290wrn.3 for ; Tue, 01 Dec 2020 09:55:44 -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=ER5bp6kWDKmeBDzRb8dI93yLVd9KdrJ8QDJlGEaxezc=; b=fZSvx52uB9pqb/XnYob+ag5ahp0eghmMjs4bPf5Byo8u2uh2VbFRG+ZXGjIlUoxEmb uYSW8Th4dln0Np15/GoiO340/p0krsWRVlu/SjMo2NSkvCC8waiB1hPX7zRQp3T+6VjW m994FhKlhceUYL/U+yc7MeoFtdnAO67EFTjiB0Jjdr4gbbN17bpN1X20f9jXtUKIzq+v vhoNbcvYBM2LzbA4e7IW0NWNWAEq04o7W2qILu8eZMHk0TjGuMxehnpZHpfB/YGV9O84 shUDpoTHBDqkDQx1oesOj6eH6mgJVFCRLpT1zTHfNQMsqdUYa0aSmOlOyd5BCHwDMWm0 gSYQ== 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=ER5bp6kWDKmeBDzRb8dI93yLVd9KdrJ8QDJlGEaxezc=; b=Ecoz9EytAnUMuRutfcTP/4/yvTiKZexNFxN/S/gACKXkD2FxvIJ6lIuni/OAB0o/8Y e0j45FrNx5FBAmvMjtFoXOrqAEpcv+KxWnNiODsZ5/vEyiSkGjadifGv5Bm9JGIlOdZy d2wy20XsCHp8hC/drVyQKYWVlsfldKphgtFwMdSf1q6wANQPkXH68UOPUGohseaHsyMl GXy0GoJKUaxufnU7lTh1AnThnYXWd8N8Y+7XKaBmXhsLnBAQfNBHdPk5b8zLe0/HUw0N uC+/mdHcwD7nPXV6cQUzHVjSKJw8RDnUlue/gOTt95eZUeRW3c0vNGTJk0ktuHbVAh8W VA7Q== X-Gm-Message-State: AOAM532FEylYHAogP6OvcqeHPj9TbkZQVcAl9GeL9ysaN0AOMkFVV/5/ ehbnWPTnz0/DjRKkkRqlfBqjihy7DDUyJ38z X-Google-Smtp-Source: ABdhPJyoqVz4YuTJA0WBYYlneTzJd6/OIIlExvj3WpfxAUA4OY6KxvjveAaIml6JSoic2AEUPHClpg== X-Received: by 2002:a5d:67c5:: with SMTP id n5mr5426810wrw.179.1606845343900; Tue, 01 Dec 2020 09:55:43 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id l3sm438561wrr.89.2020.12.01.09.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:55:43 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 1 Dec 2020 17:55:33 +0000 Message-Id: <20201201175536.11093-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201201175536.11093-1-david.plowman@raspberrypi.com> References: <20201201175536.11093-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 2/5] 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 Tue Dec 1 17:55:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10538 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 92D23BE176 for ; Tue, 1 Dec 2020 17:55:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3549F6350F; Tue, 1 Dec 2020 18:55:47 +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="sp4Qkzb4"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D136D63507 for ; Tue, 1 Dec 2020 18:55:45 +0100 (CET) Received: by mail-wm1-x334.google.com with SMTP id k10so5163549wmi.3 for ; Tue, 01 Dec 2020 09:55:45 -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=QUSybnUtj7GW9ZjPR+j3KFbT+EDJ6U5W05X8JBEXZyw=; b=sp4Qkzb4h4MD5owE2IEuoYdvuPxE73Qua3UVNooGtaQLxfYd9uVuQnWRzpEaz7HvHG Mr1acRnYjnh8Ij2LV3M0Hjbc6Fjaxf4LV2b1KvNbjNcZDjx+iXcg1+xC5jbuvVEuez+v c2tuRevlBC4x1kDpRC4Q39tCYt7vYS+XdYiyLDT8vSgbox1H+L2UJTgrULeoCzuPjTPK r4LO53ekPcJhT75529stXtOBRXNVjKplNu3ZO34X5uNmaqKVpYSOYMf4rgGT64OXmkl7 ZstyVF4Z93HETVjxl48Olh6k5x30YxgPt3g37jTmVSoOjrjFTjjmo566ZjvWcm1y2Jvc QYwA== 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=QUSybnUtj7GW9ZjPR+j3KFbT+EDJ6U5W05X8JBEXZyw=; b=ZwU/RleuawA3nlFT+aYVc9Imzg7XkwG9Bp9tCCAO9pT23pdfZUa6cv8jEfqq3jXqEq vX6P2esr9d9y2JjeZLAPOChsSwZETGxXSTW27OZQ5NqOfVnhPEqRlN3v83rvmNdgqnVx GDCbOHOwXqVxEjbQELYBumKDeGXUuwStYqVHuLEvhQ96xB68aupsgRE2wsrYwrqHun0F GBmtexhxxD650Nwc0N/UanFBl6N0dQ4NwcR/UKimGqG2jgpzldPZbZt00vS76vsmT6CY gsE9ECe57BBdm69C+WvlyQUtuZUB0YOZYuzT3YbkBndrfkXcC/2MMsxGJARf6v3ioaIG JRQQ== X-Gm-Message-State: AOAM530ROLtF2OgCHgVGODngJQhr0MfjMOBvUrJ6zykOnXiPlTYR1uLn UlL5nMkLW5XhserA5ZE9v5kd1FXD/8IlFjlP X-Google-Smtp-Source: ABdhPJyy15hYeKrrAuhrQv+NV1kMoI2b+OkQiMg+6Hx4VavHr9sJ4PrdpnF1GgLEqoyxFbH9BUaQRg== X-Received: by 2002:a1c:1fc4:: with SMTP id f187mr3834216wmf.107.1606845345356; Tue, 01 Dec 2020 09:55:45 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id l3sm438561wrr.89.2020.12.01.09.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:55:44 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 1 Dec 2020 17:55:34 +0000 Message-Id: <20201201175536.11093-4-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201201175536.11093-1-david.plowman@raspberrypi.com> References: <20201201175536.11093-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 3/5] 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: Naushir Patuck 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 Tue Dec 1 17:55:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10539 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 CC263BE176 for ; Tue, 1 Dec 2020 17:55:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C4DD6350D; Tue, 1 Dec 2020 18:55:48 +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="uAOnLemO"; dkim-atps=neutral Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CFE5263504 for ; Tue, 1 Dec 2020 18:55:46 +0100 (CET) Received: by mail-wm1-x343.google.com with SMTP id a3so7527847wmb.5 for ; Tue, 01 Dec 2020 09:55:46 -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=COAYMNMqiriqFstPxQ8fW7J1G1dQjwxxt6BNNdSn0zg=; b=uAOnLemOMv9cCrK2L30Dhi+PAXj2/wLjqUkqGYVcH9sJvtBRxMLxGV7xjUDtEPuINT zStzu67nSJTn7Sik4y9sZSociIzbG+73fShG1IZI2FeZ+Dq1OEwTSavlM9LoQWEuANxb eeVn51cnU40TMZGISlMvSovn3zAVRAdjZp5RLeTGDkqJM6gQ+xku7SHhI+GQGekVPNRs 6EUEC+/eOKLezUKRpE51ZCsLXNRDmrHZf1dOILuN9kYXeY7F7SRYZ9njyBvF6cF44CkP tEdjSxiU1G2fJdDsmQFbtscrmj+YvbGzMDrdy9qJf2Cb2tyLDo6iHF8DJDHKJfQM0SRQ dCGw== 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=COAYMNMqiriqFstPxQ8fW7J1G1dQjwxxt6BNNdSn0zg=; b=tXdlXXXAMfM44Ubl+bp/U6cL1bCBvz/6zNgAfWwCwna4t2t4dmRQFjnVE7+ioSiShL HXgSuY9OoQo0r8sNpTgwK0sOOgQoNqljc+9ah/0/Yf51mTW+Ckmbnuu44h3qbt9iCKLR GKGcjar06fEwD+SUUTN+2msJzfu1F9xIFBaovwlKMkvC5RmBL4EllpMgdsoFqIrFYKGX ckgdXtxlttp/fIzICiTOa1ggWH22DO/FpdowOCdsvUuYUgvtISATqm/OfQAZisc0QF2w jICA1ZSwAD5chC4bRHBMqJcBlNXchCtHDKEl2AewqDzj/fPUhIE/AvNHonawSCfcUv1u 5mHA== X-Gm-Message-State: AOAM531KUqciA++1diyuPRQaala6G/w1H7F7pT032ZYYIeC3KLpXLV4u v+73Tz+LGpms+6QAZ6Zeh8r4vm00NpbwRA5B X-Google-Smtp-Source: ABdhPJyRSnLpVeUDEufytiHV+lBOzxbHL0vKnglAlEz0awiTM4qMzVJKqhPooqxwmLBdyY6hriCv6Q== X-Received: by 2002:a1c:e0d4:: with SMTP id x203mr4040602wmg.68.1606845346340; Tue, 01 Dec 2020 09:55:46 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id l3sm438561wrr.89.2020.12.01.09.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:55:45 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 1 Dec 2020 17:55:35 +0000 Message-Id: <20201201175536.11093-5-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201201175536.11093-1-david.plowman@raspberrypi.com> References: <20201201175536.11093-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 4/5] libcamera: controls: Improve documentation for ExposureTime and AnalogueGain 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" Setting these controls "fixes" them and the AE may not change them; setting them back to zero returns them to the control of the AE algorithm. Signed-off-by: David Plowman --- src/libcamera/control_ids.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index a883e27e..fba1f545 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -125,8 +125,15 @@ controls: Exposure time (shutter speed) for the frame applied in the sensor device. This value is specified in micro-seconds. + Setting this value means that it is now fixed and the AE algorithm may + not change it. Setting it back to zero returns it to the control of the + AE algorithm. + \sa AnalogueGain AeEnable + \todo Consider how setting the exposure time interacts with other AE + features, such as aperture, aperture/shutter priority modes etc. + - AnalogueGain: type: float description: | @@ -134,8 +141,15 @@ controls: The value of the control specifies the gain multiplier applied to all colour channels. This value cannot be lower than 1.0. + Setting this value means that it is now fixed and the AE algorithm may + not change it. Setting it back to zero returns it to the control of the + AE algorithm. + \sa ExposureTime AeEnable + \todo Consider how setting the analogue gain interacts with other AE + features, such as aperture, aperture/shutter priority modes etc. + - Brightness: type: float description: | From patchwork Tue Dec 1 17:55:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10540 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 31960BE176 for ; Tue, 1 Dec 2020 17:55:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F29CC63503; Tue, 1 Dec 2020 18:55:49 +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="BskxjTdb"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF3C363503 for ; Tue, 1 Dec 2020 18:55:47 +0100 (CET) Received: by mail-wr1-x432.google.com with SMTP id 64so4013352wra.11 for ; Tue, 01 Dec 2020 09:55:47 -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=1IhhX9Kxp2LTXRJWgP4dKUm1Yko7iAPqLiD2A8MLxcI=; b=BskxjTdbHdpFISwKssg5t2X9tqWz9kmtmrITwqLXOWIKCme6bi93rNzNrWFOF817vy mL7V4opx7kwxtrlvY2GVeI3Hwwgsv7UGIRGUUhRWphf9dl1R/ROmOScxbf0Hsk9JL72s Mhl6mJzvSP8fVh+QpupqxMdXTeCAP+FWcKWsK9bqb+ZY3dtWsxdIW5iTXV57idh8cRO1 ZLuDvPyn16eTg8a57VGz6IlgCL+fYmCHQwjL1OwGtwfHSkP2Vc9Bs1h6bZM1MCNyvydh Axfmh8cpRDQjEaao5imx3lHSU6IVkgE8uhI3O4qv0OsHYKpWowe5VDYUzdc7Icn2tKzf G7+w== 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=1IhhX9Kxp2LTXRJWgP4dKUm1Yko7iAPqLiD2A8MLxcI=; b=krbdzwS9SFzAAFqui4t+qzNSZpJyU8KkQ6z/rJu5aq71d+2zjaQI7AaKjmIQ/BX6qK 1DduApmG+8KnxzavErt6RH98vsu4AD9TfCnB83sAQsKf+dQ2ZV1mM+9ZRa99YJtbu2r/ X+d+E9C5ur7IaQ3YANStmkaAqHVJMCjS7sovJceb/6bSjD6ZNGHIn6VZ7JmSeL6U9zMf DGh+Hy7Mz/BMKKgK2OaclSBGJeiKn2amStlIrW0rLU72OtJDzm+PW7zApDrTXbZLLY6Z hPO9nwFJwtVOLLj8oNLtbU8ypwxZ69uVAQXgqfKXOD899QKj8yLZQDyi+ySKc4FMUaos Ydng== X-Gm-Message-State: AOAM533RJNanDDKFTK8lXfxwHJFc1zGPScaxjh3soLqmB7JCiUwX5l4v jHmKZY2lF5IsnpDa3OGCmIkjglahvQuDG4wp X-Google-Smtp-Source: ABdhPJxF12yNmBYENuhBCScw13XdA0cJzuw+FAFnyrMMEIO7i21D7j7dqu68F8WzlEEeAsH8rgDkWg== X-Received: by 2002:a5d:5604:: with SMTP id l4mr5357185wrv.127.1606845347408; Tue, 01 Dec 2020 09:55:47 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id l3sm438561wrr.89.2020.12.01.09.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:55:46 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 1 Dec 2020 17:55:36 +0000 Message-Id: <20201201175536.11093-6-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201201175536.11093-1-david.plowman@raspberrypi.com> References: <20201201175536.11093-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 5/5] 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": [