From patchwork Tue Mar 26 11:24:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 19812 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 1F5F7C32C9 for ; Tue, 26 Mar 2024 11:26:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A8EC363361; Tue, 26 Mar 2024 12:26:34 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="MGAXQpJI"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4758A6334D for ; Tue, 26 Mar 2024 12:26:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711452384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZZoxr7e+9DLjwMQCQu7w3y8F5CLpNlUzgOTZZGgNfug=; b=MGAXQpJIO2PolJwjdL58shCxIQBwkVYpabZSEBwENfBzth81xGmEaF6eQ1ZCqsU4xpg5rw rwLWxaMpnD2fsMmuWCQgaAbkldPEOE56GcZVxftE6ZtsW2klMO+bh/4lHvfiqbWclwy5SO rQv3amAHmV7+d9SVXLDLcSPJqOggcr0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-534-38tTpm7bPEOxGUbUp4-ebw-1; Tue, 26 Mar 2024 07:26:22 -0400 X-MC-Unique: 38tTpm7bPEOxGUbUp4-ebw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85957382C462 for ; Tue, 26 Mar 2024 11:26:22 +0000 (UTC) Received: from nuthatch.brq.redhat.com (unknown [10.43.17.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10B5B3C54; Tue, 26 Mar 2024 11:26:21 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [RFC PATCH 11/11] config: Add global configuration documentation Date: Tue, 26 Mar 2024 12:24:14 +0100 Message-ID: <20240326112419.503286-12-mzamazal@redhat.com> In-Reply-To: <20240326112419.503286-1-mzamazal@redhat.com> References: <20240326112419.503286-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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" WIP Signed-off-by: Milan Zamazal --- Documentation/index.rst | 2 +- Documentation/meson.build | 2 +- ...ariables.rst => runtime_configuration.rst} | 56 +++++++++++++++++-- 3 files changed, 54 insertions(+), 6 deletions(-) rename Documentation/{environment_variables.rst => runtime_configuration.rst} (76%) diff --git a/Documentation/index.rst b/Documentation/index.rst index 5442ae75..aa277b85 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -19,7 +19,7 @@ Pipeline Handler Writer's Guide IPA Writer's guide Tracing guide - Environment variables + Runtime configuration Sensor driver requirements Lens driver requirements Python Bindings diff --git a/Documentation/meson.build b/Documentation/meson.build index 3872e0a8..f8ca63eb 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -70,7 +70,6 @@ if sphinx.found() 'conf.py', 'contributing.rst', 'docs.rst', - 'environment_variables.rst', 'guides/application-developer.rst', 'guides/introduction.rst', 'guides/ipa.rst', @@ -79,6 +78,7 @@ if sphinx.found() 'index.rst', 'lens_driver_requirements.rst', 'python-bindings.rst', + 'runtime_configuration.rst', 'sensor_driver_requirements.rst', 'software-isp-benchmarking.rst', '../README.rst', diff --git a/Documentation/environment_variables.rst b/Documentation/runtime_configuration.rst similarity index 76% rename from Documentation/environment_variables.rst rename to Documentation/runtime_configuration.rst index a9b230bc..75bf3530 100644 --- a/Documentation/environment_variables.rst +++ b/Documentation/runtime_configuration.rst @@ -1,10 +1,58 @@ .. SPDX-License-Identifier: CC-BY-SA-4.0 -Environment variables +Runtime configuration ===================== -The libcamera behaviour can be tuned through environment variables. This -document lists all the available variables and describes their usage. +The libcamera behaviour can be tuned through a configuration file or environment +variables. This document lists all the configuration options and describes their +usage. + +General rules +------------- + +The configuration file is looked up in the following locations, in this order: + +- $XDG_CONFIG_HOME/libcamera/configuration.yaml +- LIBCAMERA_SYSCONF_DIR/configuration.yaml +- /etc/libcamera/configuration.yaml + +The first configuration file found wins, contingent configuration files in other locations are ignored. + +Settings in environment variables take precedence over settings in configuration +files. This allows overriding behaviour temporarily without the need to modify +configuration files. + +Configuration options +--------------------- + +... + +Configuration file example +-------------------------- + +:: + + --- + version: 1 + configuration: + log: + file: syslog + levels: 'IPAManager:DEBUG' + color: false + pipelines: + simple: + supportedDevices: + - driver: mxc-isi + softwareIsp: true + rpi: + config_file: /usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml + rkisp1: + tuning_file: + /home/user/.libcamera/rkisp1.yaml + ipa: + config_paths: /home/user/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa + module_paths: /home/user/.libcamera/lib:/opt/libcamera/vendor/lib + force_isolation: true List of variables ----------------- @@ -136,7 +184,7 @@ code. IPA configuration ~~~~~~~~~~~~~~~~~ -IPA modules use configuration files to store parameters. The format and +IPA modules use their own configuration files to store parameters. The format and contents of the configuration files is specific to the IPA module. They usually contain tuning parameters for the algorithms, in JSON format.