From patchwork Fri Jul 1 15:46:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16517 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 D8550BD808 for ; Fri, 1 Jul 2022 15:47:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5EA7F6565A; Fri, 1 Jul 2022 17:47:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656690436; bh=An79EAGbcDFs93+ldfHlsveAiD+Llm2IFFTPo8gfAh8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=sRL9Z6nCK3KTK/ElKqBm6bu+/S9NBJ99Gkc+RjpWbp9kLt1AlkVmQx3lukDa9GSvI vvKhgDlHK8HU+qxEUoxHxnX97Yf5Mfs+XbQTMKs2dPk40BfUhPlKYmgRcJICNF4Ib/ c7U1GaudBxYqeuQDFIIHff0Osx1DxO+JnJXe8GSUxzciehL6lQQZ552nsRhXerhj2W 0g9UBhfkle+Ly5NdphiCMqO9lYtawssgSHBmkly1p+o3KNbOGgp4sX08s4C97/T3Pb VVTfuyS1cCmVdEzlBTy6OV3gFHhnvXe9vwru2ipzVJVjbuDC7fMB4KLI3dwplpKgo+ da7+OlyeEU7ng== Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5DDFD65657 for ; Fri, 1 Jul 2022 17:47:12 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id B88DCE0004; Fri, 1 Jul 2022 15:47:11 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Fri, 1 Jul 2022 17:46:59 +0200 Message-Id: <20220701154701.354052-7-jacopo@jmondi.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220701154701.354052-1-jacopo@jmondi.org> References: <20220518134728.777709-2-paul.elder@ideasonboard.com> <20220701154701.354052-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 7/9] fixup: Rework flickerless transition mode 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: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Re-work the introduction text. This might seems arbitrary but the new text provides a bit more context. Signed-off-by: Jacopo Mondi Acked-by: Paul Elder --- src/libcamera/control_ids.yaml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index e6676a149795..225377cf9e76 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -218,19 +218,35 @@ controls: The set of ExposureTimeMode modes that are supported by the camera must have an intersection with the supported set of AnalogueGainMode modes. - As it takes a few frames to apply the exposure time, there is a period of - time between submitting a request with ExposureTimeMode set to Manual - and the exposure time component of the AE actually being disabled, - during which the AE algorithm can still update the exposure time. If an - application is switching from automatic and manual control and wishes - to eliminate any flicker during the switch, the following procedure is - recommended. + Flickerless exposure mode transitions + + Applications that transition from ExposureTimeModeAuto to the direct + control of the exposure time should aim to do so by selecting an + ExposureTime value as close as possible to the last value computed by + the auto exposure algorithm in order to avoid any visible flickering. + + To select the correct value to use as ExposureTime value, applications + should accommodate the natural delay in applying controls caused by the + capture pipeline frame depth. + + When switching to manual exposure mode, applications should not + immediately specify an ExposureTime value in the same request where + ExposureTimeMode is set to Manual. They should instead wait for the + first Request where ExposureTimeMode is reported as + ExposureTimeModeManual in the Request metadata, and use the reported + ExposureTime to populate the control value in the next Request to be + queued to the Camera. + + The implementation of the auto-exposure algorithm should equally try to + minimize flickering and when transitioning from manual exposure mode to + auto exposure use the last value provided by the application as starting + point. 1. Start with ExposureTimeMode set to Auto 2. Set ExposureTimeMode to Manual - 3. Wait for the first request to be output that has ExposureTimeMode + 3. Wait for the first completed request that has ExposureTimeMode set to Manual 4. Copy the value reported in ExposureTime into a new request, and