From patchwork Thu Oct 6 12:01:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17539 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 E8E4AC0DA4 for ; Thu, 6 Oct 2022 12:01:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A972062D07; Thu, 6 Oct 2022 14:01:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665057691; bh=ZWJzbNK9Sgp3i+vmT9zCJ0eHRVMs8PmjGI/+/E0ehHU=; 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=z4iItAg+vVREzO4QCmioN5HaFGp7s1mJLUv+Vb9jFnM1zIyrYxCSSSCUza+pZlBx9 A1q0ZSinqF03kZe3NLJ7n7Hitj/gdwdlCQjIllT0DR3qRpms30d+l0d41RZQwwQgRn 4YglDZDQETTAbHtzXciJ4GSiBUoXfxljfr0DQPvblvbrHN+39VCvBASc651+NkLETp 2KnLj4zJBzyE6h+N3Yp332iYeFrWoPZD/tuI0Wkro9itGAQaebuUML/uByZlMOBKd6 DM9tPSYXou2dJ8B2gCMIcOOmBfD52wCmG7BSz4ruS6fC87BHoI1Lhxf0qZCbGi9+2Z SGDKNi7M6Sr7g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 972E162CFC for ; Thu, 6 Oct 2022 14:01:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="qeWc2JDW"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 429E2A1C; Thu, 6 Oct 2022 14:01:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665057689; bh=ZWJzbNK9Sgp3i+vmT9zCJ0eHRVMs8PmjGI/+/E0ehHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qeWc2JDWRpzA1djJKmmsPHrwTidxGfs4h+K2M+KrKnE3mUEgGm8MAPZe9c7AuSW6m dYdsDv/WH5ESDIpK/AsjZfYxThXisugaIeJxdIqGC6YHcVOakHq4ZxPCLRvXfNOUj+ sExVm1TiYMgES2HpQH9PvfdkktUefplTYehMDKPE= To: libcamera-devel@lists.libcamera.org Date: Thu, 6 Oct 2022 21:01:04 +0900 Message-Id: <20221006120105.3861831-7-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221006120105.3861831-1-paul.elder@ideasonboard.com> References: <20221006120105.3861831-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 6/7] [DNI] utils: tuning: Add full libtuning raspberrypi tuning script 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: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a tuning script for raspberrypi that uses libtuning. This reproduces what ctt does (albeit with less logging for now), but with common components factored out into libtuning so that tuning scripts for other platforms can reuse them. Signed-off-by: Paul Elder --- This is incomplete, hence the DNI. --- utils/tuning/raspberrypi.py | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 utils/tuning/raspberrypi.py diff --git a/utils/tuning/raspberrypi.py b/utils/tuning/raspberrypi.py new file mode 100644 index 00000000..b1592f0f --- /dev/null +++ b/utils/tuning/raspberrypi.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +import sys + +import libtuning as lt +from libtuning.modules import AWB +from libtuning.parsers import RaspberryPiParser +from libtuning.generators import RaspberryPiOutput + +from raspberrypi.alsc import ALSC as RaspberryPiALSC + +tuner = lt.Camera('Raspberry Pi') + +# These modules can also be custom modules. libtuning will come with utilities +# for handling stuff like images, so there shouldn't be too much boilerplate +# involved in creating custom modules, though I don't yet have a concrete +# vision on how custom implementations of modules would look. +tuner.add(RaspberryPiALSC) + +# Other tuning modules can be added like so. +# The order that the tuning modules will be executed is determined by the order +# that they're added. +# This is kind of an implementation detail, but the "context" is saved +# internally in lt.Camera, so modules that are added (and therefore executed) +# later can use the output of the previous modules. I'm thinking that a module +# that depends on values from another module has two modes of execution, for +# when those values are available and another for when they're not. Not quite +# sure concretely how to handle this yet. +tuner.add(AWB( # module parameters +)) + +tuner.setInputType(RaspberryPiParser) +tuner.setOutputType(RaspberryPiOutput) + +# The order of the output doesn't necessarily have to be the same as the order +# of input, which is specified by the order of adding the modules above. +tuner.setOutputOrder([AWB, ALSC]) + +tuner.run(sys.argv)