[{"id":29314,"web_url":"https://patchwork.libcamera.org/comment/29314/","msgid":"<171387019899.284777.12957714772072079246@ping.linuxembedded.co.uk>","date":"2024-04-23T11:03:18","subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2024-04-23 11:30:26)\n> Extend (and rename) the documentation of environment variables with\n> information about the configuration file.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  Documentation/index.rst                       |  2 +-\n>  Documentation/meson.build                     |  2 +-\n>  ...ariables.rst => runtime_configuration.rst} | 96 ++++++++++++++++---\n>  3 files changed, 87 insertions(+), 13 deletions(-)\n>  rename Documentation/{environment_variables.rst => runtime_configuration.rst} (65%)\n> \n> diff --git a/Documentation/index.rst b/Documentation/index.rst\n> index 5442ae75..aa277b85 100644\n> --- a/Documentation/index.rst\n> +++ b/Documentation/index.rst\n> @@ -19,7 +19,7 @@\n>     Pipeline Handler Writer's Guide <guides/pipeline-handler>\n>     IPA Writer's guide <guides/ipa>\n>     Tracing guide <guides/tracing>\n> -   Environment variables <environment_variables>\n> +   Runtime configuration <runtime_configuration>\n>     Sensor driver requirements <sensor_driver_requirements>\n>     Lens driver requirements <lens_driver_requirements>\n>     Python Bindings <python-bindings>\n> diff --git a/Documentation/meson.build b/Documentation/meson.build\n> index 3872e0a8..f8ca63eb 100644\n> --- a/Documentation/meson.build\n> +++ b/Documentation/meson.build\n> @@ -70,7 +70,6 @@ if sphinx.found()\n>          'conf.py',\n>          'contributing.rst',\n>          'docs.rst',\n> -        'environment_variables.rst',\n>          'guides/application-developer.rst',\n>          'guides/introduction.rst',\n>          'guides/ipa.rst',\n> @@ -79,6 +78,7 @@ if sphinx.found()\n>          'index.rst',\n>          'lens_driver_requirements.rst',\n>          'python-bindings.rst',\n> +        'runtime_configuration.rst',\n>          'sensor_driver_requirements.rst',\n>          'software-isp-benchmarking.rst',\n>         '../README.rst',\n> diff --git a/Documentation/environment_variables.rst b/Documentation/runtime_configuration.rst\n> similarity index 65%\n> rename from Documentation/environment_variables.rst\n> rename to Documentation/runtime_configuration.rst\n> index a9b230bc..d3972363 100644\n> --- a/Documentation/environment_variables.rst\n> +++ b/Documentation/runtime_configuration.rst\n> @@ -1,43 +1,117 @@\n>  .. SPDX-License-Identifier: CC-BY-SA-4.0\n>  \n> -Environment variables\n> +Runtime configuration\n>  =====================\n>  \n> -The libcamera behaviour can be tuned through environment variables. This\n> -document lists all the available variables and describes their usage.\n> +The libcamera behaviour can be tuned through a configuration file or\n> +environment variables. This document lists all the configuration options\n> +and describes their usage.\n> +\n> +General rules\n> +-------------\n> +\n> +The configuration file is looked up in the following locations, in this\n> +order:\n> +\n> +- $XDG_CONFIG_HOME/libcamera/configuration.yaml\n> +- LIBCAMERA_SYSCONF_DIR/configuration.yaml\n> +- /etc/libcamera/configuration.yaml\n> +\n> +The first configuration file found wins, contingent configuration files\n> +in other locations are ignored.\n> +\n> +Settings in environment variables take precedence over settings in\n> +configuration files. This allows overriding behaviour temporarily\n> +without the need to modify configuration files.\n> +\n> +Configuration options\n> +---------------------\n> +\n> +Here is an overview of the available configuration options, in the YAML\n> +file structure:\n> +\n> +::\n> +\n> +  configuration:\n> +     ipa:\n> +       config_paths: # full paths to directories, separated by colons\n> +       force_isolation: # true/false\n> +       module_paths: # full paths to directories, separated by colons\n> +    log:\n> +      color: # true/false for color/no-color\n> +      file: # either `syslog` or a full path\n> +      levels: # see Log levels\n> +    pipelines:\n> +      rkisp1:\n> +        tuning_file: # full path\n> +      rpi:\n> +        config_file: # full path\n> +        tuning_file: # full path\n\nIn fact, for the tuning files - I believe these need to be indexed by\ncamera id ...\n\nImagine running qcam on a Raspberry Pi 5 with two cameras. Setting a\nsingle tuning file would then override and apply for both cameras\nincorrectly (qcam can run either camera selectively, and same with the\npipewire use cases etc...)\n\n\n> +      simple:\n> +        supported_devices:\n> +        - driver: # driver name, e.g. `mxc-isi`\n> +          software_isp: # true/false\n> +\n> +Configuration file example\n> +--------------------------\n> +\n> +::\n> +\n> +   ---\n> +   version: 1\n> +   configuration:\n> +     ipa:\n> +       config_paths: /home/user/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa\n> +       module_paths: /home/user/.libcamera/lib:/opt/libcamera/vendor/lib\n> +       force_isolation: true\n> +     log:\n> +       color: false\n> +       file: syslog\n> +       levels: 'IPAManager:DEBUG'\n> +     pipelines:\n> +       rkisp1:\n> +         tuning_file: /home/user/.libcamera/rkisp1.yaml\n> +       rpi:\n> +         config_file: /usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml\n> +       simple:\n> +         supported_devices:\n> +         - driver: mxc-isi\n> +           software_isp: true\n>  \n>  List of variables\n>  -----------------\n>  \n> -LIBCAMERA_LOG_FILE\n> +The corresponding configuration file paths are listed in parentheses.\n> +\n> +LIBCAMERA_LOG_FILE (log.file)\n>     The custom destination for log output.\n>  \n>     Example value: ``/home/{user}/camera_log.log``\n>  \n> -LIBCAMERA_LOG_LEVELS\n> +LIBCAMERA_LOG_LEVELS (log.levels)\n>     Configure the verbosity of log messages for different categories (`more <Log levels_>`__).\n>  \n>     Example value: ``*:DEBUG``\n>  \n> -LIBCAMERA_LOG_NO_COLOR\n> +LIBCAMERA_LOG_NO_COLOR (log.color)\n>     Disable coloring of log messages (`more <Notes about debugging_>`__).\n>  \n> -LIBCAMERA_IPA_CONFIG_PATH\n> +LIBCAMERA_IPA_CONFIG_PATH (ipa.config_paths)\n>     Define custom search locations for IPA configurations (`more <IPA configuration_>`__).\n>  \n>     Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa``\n>  \n> -LIBCAMERA_IPA_FORCE_ISOLATION\n> +LIBCAMERA_IPA_FORCE_ISOLATION (ipa.force_isolation)\n>     When set to a non-empty string, force process isolation of all IPA modules.\n>  \n>     Example value: ``1``\n>  \n> -LIBCAMERA_IPA_MODULE_PATH\n> +LIBCAMERA_IPA_MODULE_PATH (ipa.module_paths)\n>     Define custom search locations for IPA modules (`more <IPA module_>`__).\n>  \n>     Example value: ``${HOME}/.libcamera/lib:/opt/libcamera/vendor/lib``\n>  \n> -LIBCAMERA_RPI_CONFIG_FILE\n> +LIBCAMERA_RPI_CONFIG_FILE (pipelines.rpi.config_file)\n>     Define a custom configuration file to use in the Raspberry Pi pipeline handler.\n>  \n>     Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``\n> @@ -136,7 +210,7 @@ code.\n>  IPA configuration\n>  ~~~~~~~~~~~~~~~~~\n>  \n> -IPA modules use configuration files to store parameters. The format and\n> +IPA modules use their own configuration files to store parameters. The format and\n>  contents of the configuration files is specific to the IPA module. They usually\n>  contain tuning parameters for the algorithms, in JSON format.\n>  \n> -- \n> 2.42.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F2E06C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Apr 2024 11:03:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1FC5E61B28;\n\tTue, 23 Apr 2024 13:03:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 03F9D61AC1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 13:03:21 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C041265D;\n\tTue, 23 Apr 2024 13:02:30 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Okk97d8V\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1713870150;\n\tbh=9y5LsAptsmmHtnOoG6PhkXnLApEZGXmXwnddRFqnnSY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Okk97d8VfCryZqRg4Ak9X9qz6uQTx0zHk4fwYPjalfcGDbzYCAZr5AMJ/HSIml+RS\n\t/7HngptEJzoMf3VHhx+TX6accrL4gGbzyXUJom4FIwgM7a0pMFO+rRK06LFzG6dDjp\n\t4aEww42U+I9ILaUf6cdkkG9U1T+iAkki6ITLxJIY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240423103034.364150-12-mzamazal@redhat.com>","References":"<20240423103034.364150-1-mzamazal@redhat.com>\n\t<20240423103034.364150-12-mzamazal@redhat.com>","Subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Tue, 23 Apr 2024 12:03:18 +0100","Message-ID":"<171387019899.284777.12957714772072079246@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29316,"web_url":"https://patchwork.libcamera.org/comment/29316/","msgid":"<877cgocnb9.fsf@redhat.com>","date":"2024-04-23T11:48:10","subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Quoting Milan Zamazal (2024-04-23 11:30:26)\n>> Extend (and rename) the documentation of environment variables with\n>> information about the configuration file.\n>\n>> \n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>  Documentation/index.rst                       |  2 +-\n>>  Documentation/meson.build                     |  2 +-\n>>  ...ariables.rst => runtime_configuration.rst} | 96 ++++++++++++++++---\n>>  3 files changed, 87 insertions(+), 13 deletions(-)\n>>  rename Documentation/{environment_variables.rst => runtime_configuration.rst} (65%)\n>> \n>> diff --git a/Documentation/index.rst b/Documentation/index.rst\n>> index 5442ae75..aa277b85 100644\n>> --- a/Documentation/index.rst\n>> +++ b/Documentation/index.rst\n>> @@ -19,7 +19,7 @@\n>>     Pipeline Handler Writer's Guide <guides/pipeline-handler>\n>>     IPA Writer's guide <guides/ipa>\n>>     Tracing guide <guides/tracing>\n>> -   Environment variables <environment_variables>\n>> +   Runtime configuration <runtime_configuration>\n>>     Sensor driver requirements <sensor_driver_requirements>\n>>     Lens driver requirements <lens_driver_requirements>\n>>     Python Bindings <python-bindings>\n>> diff --git a/Documentation/meson.build b/Documentation/meson.build\n>> index 3872e0a8..f8ca63eb 100644\n>> --- a/Documentation/meson.build\n>> +++ b/Documentation/meson.build\n>> @@ -70,7 +70,6 @@ if sphinx.found()\n>>          'conf.py',\n>>          'contributing.rst',\n>>          'docs.rst',\n>> -        'environment_variables.rst',\n>>          'guides/application-developer.rst',\n>>          'guides/introduction.rst',\n>>          'guides/ipa.rst',\n>> @@ -79,6 +78,7 @@ if sphinx.found()\n>>          'index.rst',\n>>          'lens_driver_requirements.rst',\n>>          'python-bindings.rst',\n>> +        'runtime_configuration.rst',\n>>          'sensor_driver_requirements.rst',\n>>          'software-isp-benchmarking.rst',\n>>         '../README.rst',\n>> diff --git a/Documentation/environment_variables.rst b/Documentation/runtime_configuration.rst\n>> similarity index 65%\n>> rename from Documentation/environment_variables.rst\n>> rename to Documentation/runtime_configuration.rst\n>> index a9b230bc..d3972363 100644\n>> --- a/Documentation/environment_variables.rst\n>> +++ b/Documentation/runtime_configuration.rst\n>> @@ -1,43 +1,117 @@\n>>  .. SPDX-License-Identifier: CC-BY-SA-4.0\n>>  \n>> -Environment variables\n>> +Runtime configuration\n>>  =====================\n>>  \n>> -The libcamera behaviour can be tuned through environment variables. This\n>> -document lists all the available variables and describes their usage.\n>> +The libcamera behaviour can be tuned through a configuration file or\n>> +environment variables. This document lists all the configuration options\n>> +and describes their usage.\n>> +\n>> +General rules\n>> +-------------\n>> +\n>> +The configuration file is looked up in the following locations, in this\n>> +order:\n>> +\n>> +- $XDG_CONFIG_HOME/libcamera/configuration.yaml\n>> +- LIBCAMERA_SYSCONF_DIR/configuration.yaml\n>> +- /etc/libcamera/configuration.yaml\n>> +\n>> +The first configuration file found wins, contingent configuration files\n>> +in other locations are ignored.\n>> +\n>> +Settings in environment variables take precedence over settings in\n>> +configuration files. This allows overriding behaviour temporarily\n>> +without the need to modify configuration files.\n>> +\n>> +Configuration options\n>> +---------------------\n>> +\n>> +Here is an overview of the available configuration options, in the YAML\n>> +file structure:\n>> +\n>> +::\n>> +\n>> +  configuration:\n>> +     ipa:\n>> +       config_paths: # full paths to directories, separated by colons\n>> +       force_isolation: # true/false\n>> +       module_paths: # full paths to directories, separated by colons\n>> +    log:\n>> +      color: # true/false for color/no-color\n>> +      file: # either `syslog` or a full path\n>> +      levels: # see Log levels\n>> +    pipelines:\n>> +      rkisp1:\n>> +        tuning_file: # full path\n>> +      rpi:\n>> +        config_file: # full path\n>> +        tuning_file: # full path\n>\n> In fact, for the tuning files - I believe these need to be indexed by\n> camera id ...\n>\n> Imagine running qcam on a Raspberry Pi 5 with two cameras. Setting a\n> single tuning file would then override and apply for both cameras\n> incorrectly (qcam can run either camera selectively, and same with the\n> pipewire use cases etc...)\n\nI see.  This is based on the current code, which looks for a configuration file\nbased on the given sensor model but allows overriding it with an environment\nvariable (and here also the given configuration option).  The corresponding\ncommit messages don't provide the reason for overriding, perhaps for debugging\nor experimentation?\n\nMaybe we could leave these configuration environment variables without\nconfiguration file options or we could enhance the configuration as you suggest.\nBut I don't know what's the intended use case.  Suggestions?\n\n>> +      simple:\n>> +        supported_devices:\n>> +        - driver: # driver name, e.g. `mxc-isi`\n>> +          software_isp: # true/false\n>> +\n>> +Configuration file example\n>> +--------------------------\n>> +\n>> +::\n>> +\n>> +   ---\n>> +   version: 1\n>> +   configuration:\n>> +     ipa:\n>> +       config_paths: /home/user/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa\n>> +       module_paths: /home/user/.libcamera/lib:/opt/libcamera/vendor/lib\n>> +       force_isolation: true\n>> +     log:\n>> +       color: false\n>> +       file: syslog\n>> +       levels: 'IPAManager:DEBUG'\n>> +     pipelines:\n>> +       rkisp1:\n>> +         tuning_file: /home/user/.libcamera/rkisp1.yaml\n>> +       rpi:\n>> +         config_file: /usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml\n>> +       simple:\n>> +         supported_devices:\n>> +         - driver: mxc-isi\n>> +           software_isp: true\n>>  \n>>  List of variables\n>>  -----------------\n>>  \n>> -LIBCAMERA_LOG_FILE\n>> +The corresponding configuration file paths are listed in parentheses.\n>> +\n>> +LIBCAMERA_LOG_FILE (log.file)\n>>     The custom destination for log output.\n>>  \n>>     Example value: ``/home/{user}/camera_log.log``\n>>  \n>> -LIBCAMERA_LOG_LEVELS\n>> +LIBCAMERA_LOG_LEVELS (log.levels)\n>>     Configure the verbosity of log messages for different categories (`more <Log levels_>`__).\n>>  \n>>     Example value: ``*:DEBUG``\n>>  \n>> -LIBCAMERA_LOG_NO_COLOR\n>> +LIBCAMERA_LOG_NO_COLOR (log.color)\n>>     Disable coloring of log messages (`more <Notes about debugging_>`__).\n>>  \n>> -LIBCAMERA_IPA_CONFIG_PATH\n>> +LIBCAMERA_IPA_CONFIG_PATH (ipa.config_paths)\n>>     Define custom search locations for IPA configurations (`more <IPA configuration_>`__).\n>>  \n>>     Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa``\n>>  \n>> -LIBCAMERA_IPA_FORCE_ISOLATION\n>> +LIBCAMERA_IPA_FORCE_ISOLATION (ipa.force_isolation)\n>>     When set to a non-empty string, force process isolation of all IPA modules.\n>>  \n>>     Example value: ``1``\n>>  \n>> -LIBCAMERA_IPA_MODULE_PATH\n>> +LIBCAMERA_IPA_MODULE_PATH (ipa.module_paths)\n>>     Define custom search locations for IPA modules (`more <IPA module_>`__).\n>>  \n>>     Example value: ``${HOME}/.libcamera/lib:/opt/libcamera/vendor/lib``\n>>  \n>> -LIBCAMERA_RPI_CONFIG_FILE\n>> +LIBCAMERA_RPI_CONFIG_FILE (pipelines.rpi.config_file)\n>>     Define a custom configuration file to use in the Raspberry Pi pipeline handler.\n>>  \n>>     Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``\n>> @@ -136,7 +210,7 @@ code.\n>>  IPA configuration\n>>  ~~~~~~~~~~~~~~~~~\n>>  \n>> -IPA modules use configuration files to store parameters. The format and\n>> +IPA modules use their own configuration files to store parameters. The format and\n>>  contents of the configuration files is specific to the IPA module. They usually\n>>  contain tuning parameters for the algorithms, in JSON format.\n>>  \n>> -- \n>> 2.42.0\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 38B4AC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Apr 2024 11:48:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1AB5A61B24;\n\tTue, 23 Apr 2024 13:48:19 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 71F9261AC1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 13:48:17 +0200 (CEST)","from mail-wr1-f72.google.com (mail-wr1-f72.google.com\n\t[209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-410-wNRkzwqyNhuTb_5kSlCz4w-1; Tue, 23 Apr 2024 07:48:13 -0400","by mail-wr1-f72.google.com with SMTP id\n\tffacd0b85a97d-343f5059c5fso3664557f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 04:48:13 -0700 (PDT)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\td4-20020a5d6dc4000000b00341ce80ea66sm14337472wrz.82.2024.04.23.04.48.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 23 Apr 2024 04:48:11 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"E51h5krR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1713872896;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=rUbZFhNL1VsQ4NhD71pj/QD46oEvS/SNRSPWVhh8Jgg=;\n\tb=E51h5krRBxJxuCve0ucJA+MjX5T+sBf+se+mwAnPxZBIQpwcLALiWCqJglPcSrtcB5EzoB\n\tr8iR8R0pyL+FLg/4bTs+SHKe0gQEcR9Rp14FLeDwAJUezIdV6YVRNjWT/4e5SWwdLdk3Rp\n\tSkyAmpgLVTp6odR2/SFetCK26XkH+WU=","X-MC-Unique":"wNRkzwqyNhuTb_5kSlCz4w-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1713872892; x=1714477692;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=rUbZFhNL1VsQ4NhD71pj/QD46oEvS/SNRSPWVhh8Jgg=;\n\tb=QIlVbaW0jMXv5vghoKz4FSZzZMQZLelxl2Adu8lLSKr7NcROi/KZzD/xgCKVl5SOWW\n\tccugLeL4IFf30GSY0SEyrpOYPnmDVzHrbOzhh4KmlVwqIlsRo+YwK+RetNcrwlJbx8FR\n\tAk5ohsp0kpMVZAcDFpweutV1fM7rVZwBNzg7hwfJqCVYdlkdYxTwRz8CQlXf6psWFR47\n\tmZuTMYRH5GNThJLhfDohmcWRrsXbak6Nh7C7mWVFkLuX+lZd9AVf5mfJAs7jgffhNC0W\n\to9osSnD94MtzuRXLhJrT6GOC211QvXUOHxanMhYjd2d2woLj/vLsos0A1sCM8sxFoT5W\n\t6u2w==","X-Gm-Message-State":"AOJu0Yzos9djb2QDlQxGWjqNSXlE5BrgACVfeblz99ELQRrAImgzzYDf\n\tMFpbGLOQuMY05BSgGKXB7eIEyQTVXdYpf2yibVdVeISw1MRuMhFRjJGbykDGUp3NHh30c1pSrVQ\n\tzXIXyJAn2SjI5QYbmibwOlxf7GFyWBvh0J6dBab1K5RORsL9YaOwRyWO7ElvwRHaQIUiUTNx0UO\n\tXWgWg=","X-Received":["by 2002:a05:6000:1e98:b0:343:dd56:b941 with SMTP id\n\tdd24-20020a0560001e9800b00343dd56b941mr8233771wrb.52.1713872892154; \n\tTue, 23 Apr 2024 04:48:12 -0700 (PDT)","by 2002:a05:6000:1e98:b0:343:dd56:b941 with SMTP id\n\tdd24-20020a0560001e9800b00343dd56b941mr8233756wrb.52.1713872891724; \n\tTue, 23 Apr 2024 04:48:11 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IESzOAkIsxHO7W39ykdItJWjSyecYtkkcKnhZNZVSeMX4UEQCVfmPyYWCM0tZtRr0T8K57NFA==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Naushir Patuck\n\t<naush@raspberrypi.com>","Subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","In-Reply-To":"<171387019899.284777.12957714772072079246@ping.linuxembedded.co.uk>\n\t(Kieran Bingham's message of \"Tue, 23 Apr 2024 12:03:18 +0100\")","References":"<20240423103034.364150-1-mzamazal@redhat.com>\n\t<20240423103034.364150-12-mzamazal@redhat.com>\n\t<171387019899.284777.12957714772072079246@ping.linuxembedded.co.uk>","Date":"Tue, 23 Apr 2024 13:48:10 +0200","Message-ID":"<877cgocnb9.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29317,"web_url":"https://patchwork.libcamera.org/comment/29317/","msgid":"<171387377418.1636495.13646739599535132176@ping.linuxembedded.co.uk>","date":"2024-04-23T12:02:54","subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2024-04-23 12:48:10)\n> Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n> \n> > Quoting Milan Zamazal (2024-04-23 11:30:26)\n> >> Extend (and rename) the documentation of environment variables with\n> >> information about the configuration file.\n> >\n> >> \n> >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> >> ---\n> >>  Documentation/index.rst                       |  2 +-\n> >>  Documentation/meson.build                     |  2 +-\n> >>  ...ariables.rst => runtime_configuration.rst} | 96 ++++++++++++++++---\n> >>  3 files changed, 87 insertions(+), 13 deletions(-)\n> >>  rename Documentation/{environment_variables.rst => runtime_configuration.rst} (65%)\n> >> \n> >> diff --git a/Documentation/index.rst b/Documentation/index.rst\n> >> index 5442ae75..aa277b85 100644\n> >> --- a/Documentation/index.rst\n> >> +++ b/Documentation/index.rst\n> >> @@ -19,7 +19,7 @@\n> >>     Pipeline Handler Writer's Guide <guides/pipeline-handler>\n> >>     IPA Writer's guide <guides/ipa>\n> >>     Tracing guide <guides/tracing>\n> >> -   Environment variables <environment_variables>\n> >> +   Runtime configuration <runtime_configuration>\n> >>     Sensor driver requirements <sensor_driver_requirements>\n> >>     Lens driver requirements <lens_driver_requirements>\n> >>     Python Bindings <python-bindings>\n> >> diff --git a/Documentation/meson.build b/Documentation/meson.build\n> >> index 3872e0a8..f8ca63eb 100644\n> >> --- a/Documentation/meson.build\n> >> +++ b/Documentation/meson.build\n> >> @@ -70,7 +70,6 @@ if sphinx.found()\n> >>          'conf.py',\n> >>          'contributing.rst',\n> >>          'docs.rst',\n> >> -        'environment_variables.rst',\n> >>          'guides/application-developer.rst',\n> >>          'guides/introduction.rst',\n> >>          'guides/ipa.rst',\n> >> @@ -79,6 +78,7 @@ if sphinx.found()\n> >>          'index.rst',\n> >>          'lens_driver_requirements.rst',\n> >>          'python-bindings.rst',\n> >> +        'runtime_configuration.rst',\n> >>          'sensor_driver_requirements.rst',\n> >>          'software-isp-benchmarking.rst',\n> >>         '../README.rst',\n> >> diff --git a/Documentation/environment_variables.rst b/Documentation/runtime_configuration.rst\n> >> similarity index 65%\n> >> rename from Documentation/environment_variables.rst\n> >> rename to Documentation/runtime_configuration.rst\n> >> index a9b230bc..d3972363 100644\n> >> --- a/Documentation/environment_variables.rst\n> >> +++ b/Documentation/runtime_configuration.rst\n> >> @@ -1,43 +1,117 @@\n> >>  .. SPDX-License-Identifier: CC-BY-SA-4.0\n> >>  \n> >> -Environment variables\n> >> +Runtime configuration\n> >>  =====================\n> >>  \n> >> -The libcamera behaviour can be tuned through environment variables. This\n> >> -document lists all the available variables and describes their usage.\n> >> +The libcamera behaviour can be tuned through a configuration file or\n> >> +environment variables. This document lists all the configuration options\n> >> +and describes their usage.\n> >> +\n> >> +General rules\n> >> +-------------\n> >> +\n> >> +The configuration file is looked up in the following locations, in this\n> >> +order:\n> >> +\n> >> +- $XDG_CONFIG_HOME/libcamera/configuration.yaml\n> >> +- LIBCAMERA_SYSCONF_DIR/configuration.yaml\n> >> +- /etc/libcamera/configuration.yaml\n> >> +\n> >> +The first configuration file found wins, contingent configuration files\n> >> +in other locations are ignored.\n> >> +\n> >> +Settings in environment variables take precedence over settings in\n> >> +configuration files. This allows overriding behaviour temporarily\n> >> +without the need to modify configuration files.\n> >> +\n> >> +Configuration options\n> >> +---------------------\n> >> +\n> >> +Here is an overview of the available configuration options, in the YAML\n> >> +file structure:\n> >> +\n> >> +::\n> >> +\n> >> +  configuration:\n> >> +     ipa:\n> >> +       config_paths: # full paths to directories, separated by colons\n> >> +       force_isolation: # true/false\n> >> +       module_paths: # full paths to directories, separated by colons\n> >> +    log:\n> >> +      color: # true/false for color/no-color\n> >> +      file: # either `syslog` or a full path\n> >> +      levels: # see Log levels\n> >> +    pipelines:\n> >> +      rkisp1:\n> >> +        tuning_file: # full path\n> >> +      rpi:\n> >> +        config_file: # full path\n> >> +        tuning_file: # full path\n> >\n> > In fact, for the tuning files - I believe these need to be indexed by\n> > camera id ...\n> >\n> > Imagine running qcam on a Raspberry Pi 5 with two cameras. Setting a\n> > single tuning file would then override and apply for both cameras\n> > incorrectly (qcam can run either camera selectively, and same with the\n> > pipewire use cases etc...)\n> \n> I see.  This is based on the current code, which looks for a configuration file\n\nOh absolutely. But I think there's a big difference when we move these\nto a configuration file which outlives a single run of a single binary\nand will affect /all/ cameras managed by a single pipeline handler.\n\nI don't think /you/ specifically have to address this - but it's\nimportant to consider here that it affects any camera.\n\n> based on the given sensor model but allows overriding it with an environment\n> variable (and here also the given configuration option).  The corresponding\n> commit messages don't provide the reason for overriding, perhaps for debugging\n> or experimentation?\n\nSome of Raspberry Pi's cameras have multiple tuning files, so this lets\nusers choose which one to select at present.\n\nIt's definitely somethign that is worthy of being in a configuration\nfile. But it's a per-camera thing, not a per-pipeline handler thing.\n\nI suspect it means even the environment variable is misleading too! The\nsame issue would occur there if you launch qcam with a single tuning\nfile overridden.\n\n> Maybe we could leave these configuration environment variables without\n> configuration file options or we could enhance the configuration as you suggest.\n> But I don't know what's the intended use case.  Suggestions?\n\nNaush - any thoughts here?\n\n--\nKieran\n\n\n> \n> >> +      simple:\n> >> +        supported_devices:\n> >> +        - driver: # driver name, e.g. `mxc-isi`\n> >> +          software_isp: # true/false\n> >> +\n> >> +Configuration file example\n> >> +--------------------------\n> >> +\n> >> +::\n> >> +\n> >> +   ---\n> >> +   version: 1\n> >> +   configuration:\n> >> +     ipa:\n> >> +       config_paths: /home/user/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa\n> >> +       module_paths: /home/user/.libcamera/lib:/opt/libcamera/vendor/lib\n> >> +       force_isolation: true\n> >> +     log:\n> >> +       color: false\n> >> +       file: syslog\n> >> +       levels: 'IPAManager:DEBUG'\n> >> +     pipelines:\n> >> +       rkisp1:\n> >> +         tuning_file: /home/user/.libcamera/rkisp1.yaml\n> >> +       rpi:\n> >> +         config_file: /usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml\n> >> +       simple:\n> >> +         supported_devices:\n> >> +         - driver: mxc-isi\n> >> +           software_isp: true\n> >>  \n> >>  List of variables\n> >>  -----------------\n> >>  \n> >> -LIBCAMERA_LOG_FILE\n> >> +The corresponding configuration file paths are listed in parentheses.\n> >> +\n> >> +LIBCAMERA_LOG_FILE (log.file)\n> >>     The custom destination for log output.\n> >>  \n> >>     Example value: ``/home/{user}/camera_log.log``\n> >>  \n> >> -LIBCAMERA_LOG_LEVELS\n> >> +LIBCAMERA_LOG_LEVELS (log.levels)\n> >>     Configure the verbosity of log messages for different categories (`more <Log levels_>`__).\n> >>  \n> >>     Example value: ``*:DEBUG``\n> >>  \n> >> -LIBCAMERA_LOG_NO_COLOR\n> >> +LIBCAMERA_LOG_NO_COLOR (log.color)\n> >>     Disable coloring of log messages (`more <Notes about debugging_>`__).\n> >>  \n> >> -LIBCAMERA_IPA_CONFIG_PATH\n> >> +LIBCAMERA_IPA_CONFIG_PATH (ipa.config_paths)\n> >>     Define custom search locations for IPA configurations (`more <IPA configuration_>`__).\n> >>  \n> >>     Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa``\n> >>  \n> >> -LIBCAMERA_IPA_FORCE_ISOLATION\n> >> +LIBCAMERA_IPA_FORCE_ISOLATION (ipa.force_isolation)\n> >>     When set to a non-empty string, force process isolation of all IPA modules.\n> >>  \n> >>     Example value: ``1``\n> >>  \n> >> -LIBCAMERA_IPA_MODULE_PATH\n> >> +LIBCAMERA_IPA_MODULE_PATH (ipa.module_paths)\n> >>     Define custom search locations for IPA modules (`more <IPA module_>`__).\n> >>  \n> >>     Example value: ``${HOME}/.libcamera/lib:/opt/libcamera/vendor/lib``\n> >>  \n> >> -LIBCAMERA_RPI_CONFIG_FILE\n> >> +LIBCAMERA_RPI_CONFIG_FILE (pipelines.rpi.config_file)\n> >>     Define a custom configuration file to use in the Raspberry Pi pipeline handler.\n> >>  \n> >>     Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``\n> >> @@ -136,7 +210,7 @@ code.\n> >>  IPA configuration\n> >>  ~~~~~~~~~~~~~~~~~\n> >>  \n> >> -IPA modules use configuration files to store parameters. The format and\n> >> +IPA modules use their own configuration files to store parameters. The format and\n> >>  contents of the configuration files is specific to the IPA module. They usually\n> >>  contain tuning parameters for the algorithms, in JSON format.\n> >>  \n> >> -- \n> >> 2.42.0\n> >>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 10C77BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Apr 2024 12:03:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 30C0761AC9;\n\tTue, 23 Apr 2024 14:02:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 496C461AC1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 14:02:57 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BF7DF250;\n\tTue, 23 Apr 2024 14:02:05 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"rSz+HwG+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1713873725;\n\tbh=L+kVgSppBgczgxIXPHPP/wQSCGGTov4f/AtZXPEvqG0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=rSz+HwG+E9G+p9He1WnBHLh9T9P7llt9yoMii58IDtgazx/DglgxWdPXScJHjdD1Q\n\ti19XAda0b4dksUYy3fCpFxBv9tUNFZo9LN9LYVxYSrY1YdyAAd7PYqktWWkL9uWFPF\n\t21q6eI4wwcM2tkWNOzwNb4sDGY/ao3aeFuhzMAH8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<877cgocnb9.fsf@redhat.com>","References":"<20240423103034.364150-1-mzamazal@redhat.com>\n\t<20240423103034.364150-12-mzamazal@redhat.com>\n\t<171387019899.284777.12957714772072079246@ping.linuxembedded.co.uk>\n\t<877cgocnb9.fsf@redhat.com>","Subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tNaushir Patuck <naush@raspberrypi.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Date":"Tue, 23 Apr 2024 13:02:54 +0100","Message-ID":"<171387377418.1636495.13646739599535132176@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29318,"web_url":"https://patchwork.libcamera.org/comment/29318/","msgid":"<CAEmqJPoT7_rCQQdVGZDBq9qB9LGcRfW3XoY+eGPAk+0Xor4kaA@mail.gmail.com>","date":"2024-04-23T14:02:57","subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Tue, 23 Apr 2024 at 13:02, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting Milan Zamazal (2024-04-23 12:48:10)\n> > Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n> >\n> > > Quoting Milan Zamazal (2024-04-23 11:30:26)\n> > >> Extend (and rename) the documentation of environment variables with\n> > >> information about the configuration file.\n> > >\n> > >>\n> > >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> > >> ---\n> > >>  Documentation/index.rst                       |  2 +-\n> > >>  Documentation/meson.build                     |  2 +-\n> > >>  ...ariables.rst => runtime_configuration.rst} | 96 ++++++++++++++++---\n> > >>  3 files changed, 87 insertions(+), 13 deletions(-)\n> > >>  rename Documentation/{environment_variables.rst => runtime_configuration.rst} (65%)\n> > >>\n> > >> diff --git a/Documentation/index.rst b/Documentation/index.rst\n> > >> index 5442ae75..aa277b85 100644\n> > >> --- a/Documentation/index.rst\n> > >> +++ b/Documentation/index.rst\n> > >> @@ -19,7 +19,7 @@\n> > >>     Pipeline Handler Writer's Guide <guides/pipeline-handler>\n> > >>     IPA Writer's guide <guides/ipa>\n> > >>     Tracing guide <guides/tracing>\n> > >> -   Environment variables <environment_variables>\n> > >> +   Runtime configuration <runtime_configuration>\n> > >>     Sensor driver requirements <sensor_driver_requirements>\n> > >>     Lens driver requirements <lens_driver_requirements>\n> > >>     Python Bindings <python-bindings>\n> > >> diff --git a/Documentation/meson.build b/Documentation/meson.build\n> > >> index 3872e0a8..f8ca63eb 100644\n> > >> --- a/Documentation/meson.build\n> > >> +++ b/Documentation/meson.build\n> > >> @@ -70,7 +70,6 @@ if sphinx.found()\n> > >>          'conf.py',\n> > >>          'contributing.rst',\n> > >>          'docs.rst',\n> > >> -        'environment_variables.rst',\n> > >>          'guides/application-developer.rst',\n> > >>          'guides/introduction.rst',\n> > >>          'guides/ipa.rst',\n> > >> @@ -79,6 +78,7 @@ if sphinx.found()\n> > >>          'index.rst',\n> > >>          'lens_driver_requirements.rst',\n> > >>          'python-bindings.rst',\n> > >> +        'runtime_configuration.rst',\n> > >>          'sensor_driver_requirements.rst',\n> > >>          'software-isp-benchmarking.rst',\n> > >>         '../README.rst',\n> > >> diff --git a/Documentation/environment_variables.rst b/Documentation/runtime_configuration.rst\n> > >> similarity index 65%\n> > >> rename from Documentation/environment_variables.rst\n> > >> rename to Documentation/runtime_configuration.rst\n> > >> index a9b230bc..d3972363 100644\n> > >> --- a/Documentation/environment_variables.rst\n> > >> +++ b/Documentation/runtime_configuration.rst\n> > >> @@ -1,43 +1,117 @@\n> > >>  .. SPDX-License-Identifier: CC-BY-SA-4.0\n> > >>\n> > >> -Environment variables\n> > >> +Runtime configuration\n> > >>  =====================\n> > >>\n> > >> -The libcamera behaviour can be tuned through environment variables. This\n> > >> -document lists all the available variables and describes their usage.\n> > >> +The libcamera behaviour can be tuned through a configuration file or\n> > >> +environment variables. This document lists all the configuration options\n> > >> +and describes their usage.\n> > >> +\n> > >> +General rules\n> > >> +-------------\n> > >> +\n> > >> +The configuration file is looked up in the following locations, in this\n> > >> +order:\n> > >> +\n> > >> +- $XDG_CONFIG_HOME/libcamera/configuration.yaml\n> > >> +- LIBCAMERA_SYSCONF_DIR/configuration.yaml\n> > >> +- /etc/libcamera/configuration.yaml\n> > >> +\n> > >> +The first configuration file found wins, contingent configuration files\n> > >> +in other locations are ignored.\n> > >> +\n> > >> +Settings in environment variables take precedence over settings in\n> > >> +configuration files. This allows overriding behaviour temporarily\n> > >> +without the need to modify configuration files.\n> > >> +\n> > >> +Configuration options\n> > >> +---------------------\n> > >> +\n> > >> +Here is an overview of the available configuration options, in the YAML\n> > >> +file structure:\n> > >> +\n> > >> +::\n> > >> +\n> > >> +  configuration:\n> > >> +     ipa:\n> > >> +       config_paths: # full paths to directories, separated by colons\n> > >> +       force_isolation: # true/false\n> > >> +       module_paths: # full paths to directories, separated by colons\n> > >> +    log:\n> > >> +      color: # true/false for color/no-color\n> > >> +      file: # either `syslog` or a full path\n> > >> +      levels: # see Log levels\n> > >> +    pipelines:\n> > >> +      rkisp1:\n> > >> +        tuning_file: # full path\n> > >> +      rpi:\n> > >> +        config_file: # full path\n> > >> +        tuning_file: # full path\n> > >\n> > > In fact, for the tuning files - I believe these need to be indexed by\n> > > camera id ...\n> > >\n> > > Imagine running qcam on a Raspberry Pi 5 with two cameras. Setting a\n> > > single tuning file would then override and apply for both cameras\n> > > incorrectly (qcam can run either camera selectively, and same with the\n> > > pipewire use cases etc...)\n> >\n> > I see.  This is based on the current code, which looks for a configuration file\n>\n> Oh absolutely. But I think there's a big difference when we move these\n> to a configuration file which outlives a single run of a single binary\n> and will affect /all/ cameras managed by a single pipeline handler.\n>\n> I don't think /you/ specifically have to address this - but it's\n> important to consider here that it affects any camera.\n>\n> > based on the given sensor model but allows overriding it with an environment\n> > variable (and here also the given configuration option).  The corresponding\n> > commit messages don't provide the reason for overriding, perhaps for debugging\n> > or experimentation?\n>\n> Some of Raspberry Pi's cameras have multiple tuning files, so this lets\n> users choose which one to select at present.\n>\n> It's definitely somethign that is worthy of being in a configuration\n> file. But it's a per-camera thing, not a per-pipeline handler thing.\n>\n> I suspect it means even the environment variable is misleading too! The\n> same issue would occur there if you launch qcam with a single tuning\n> file overridden.\n>\n> > Maybe we could leave these configuration environment variables without\n> > configuration file options or we could enhance the configuration as you suggest.\n> > But I don't know what's the intended use case.  Suggestions?\n>\n> Naush - any thoughts here?\n\nThis is indeed an annoying problem - even now with our environment\nvariable workaround.  Obviously you can run with different env\nvariables in different processes to workaround this.\n\nThere is a problem with numbering cameras in the config file though -\nthe order that cameras get enumerated by the kernel is not fully\ndeterministic, which makes per-camera config options a bit more\ncomplicated.\n\nNaush\n\n\n\n>\n> --\n> Kieran\n>\n>\n> >\n> > >> +      simple:\n> > >> +        supported_devices:\n> > >> +        - driver: # driver name, e.g. `mxc-isi`\n> > >> +          software_isp: # true/false\n> > >> +\n> > >> +Configuration file example\n> > >> +--------------------------\n> > >> +\n> > >> +::\n> > >> +\n> > >> +   ---\n> > >> +   version: 1\n> > >> +   configuration:\n> > >> +     ipa:\n> > >> +       config_paths: /home/user/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa\n> > >> +       module_paths: /home/user/.libcamera/lib:/opt/libcamera/vendor/lib\n> > >> +       force_isolation: true\n> > >> +     log:\n> > >> +       color: false\n> > >> +       file: syslog\n> > >> +       levels: 'IPAManager:DEBUG'\n> > >> +     pipelines:\n> > >> +       rkisp1:\n> > >> +         tuning_file: /home/user/.libcamera/rkisp1.yaml\n> > >> +       rpi:\n> > >> +         config_file: /usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml\n> > >> +       simple:\n> > >> +         supported_devices:\n> > >> +         - driver: mxc-isi\n> > >> +           software_isp: true\n> > >>\n> > >>  List of variables\n> > >>  -----------------\n> > >>\n> > >> -LIBCAMERA_LOG_FILE\n> > >> +The corresponding configuration file paths are listed in parentheses.\n> > >> +\n> > >> +LIBCAMERA_LOG_FILE (log.file)\n> > >>     The custom destination for log output.\n> > >>\n> > >>     Example value: ``/home/{user}/camera_log.log``\n> > >>\n> > >> -LIBCAMERA_LOG_LEVELS\n> > >> +LIBCAMERA_LOG_LEVELS (log.levels)\n> > >>     Configure the verbosity of log messages for different categories (`more <Log levels_>`__).\n> > >>\n> > >>     Example value: ``*:DEBUG``\n> > >>\n> > >> -LIBCAMERA_LOG_NO_COLOR\n> > >> +LIBCAMERA_LOG_NO_COLOR (log.color)\n> > >>     Disable coloring of log messages (`more <Notes about debugging_>`__).\n> > >>\n> > >> -LIBCAMERA_IPA_CONFIG_PATH\n> > >> +LIBCAMERA_IPA_CONFIG_PATH (ipa.config_paths)\n> > >>     Define custom search locations for IPA configurations (`more <IPA configuration_>`__).\n> > >>\n> > >>     Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa``\n> > >>\n> > >> -LIBCAMERA_IPA_FORCE_ISOLATION\n> > >> +LIBCAMERA_IPA_FORCE_ISOLATION (ipa.force_isolation)\n> > >>     When set to a non-empty string, force process isolation of all IPA modules.\n> > >>\n> > >>     Example value: ``1``\n> > >>\n> > >> -LIBCAMERA_IPA_MODULE_PATH\n> > >> +LIBCAMERA_IPA_MODULE_PATH (ipa.module_paths)\n> > >>     Define custom search locations for IPA modules (`more <IPA module_>`__).\n> > >>\n> > >>     Example value: ``${HOME}/.libcamera/lib:/opt/libcamera/vendor/lib``\n> > >>\n> > >> -LIBCAMERA_RPI_CONFIG_FILE\n> > >> +LIBCAMERA_RPI_CONFIG_FILE (pipelines.rpi.config_file)\n> > >>     Define a custom configuration file to use in the Raspberry Pi pipeline handler.\n> > >>\n> > >>     Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``\n> > >> @@ -136,7 +210,7 @@ code.\n> > >>  IPA configuration\n> > >>  ~~~~~~~~~~~~~~~~~\n> > >>\n> > >> -IPA modules use configuration files to store parameters. The format and\n> > >> +IPA modules use their own configuration files to store parameters. The format and\n> > >>  contents of the configuration files is specific to the IPA module. They usually\n> > >>  contain tuning parameters for the algorithms, in JSON format.\n> > >>\n> > >> --\n> > >> 2.42.0\n> > >>\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0A5DDC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Apr 2024 14:03:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CF25561B24;\n\tTue, 23 Apr 2024 16:03:36 +0200 (CEST)","from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com\n\t[IPv6:2607:f8b0:4864:20::112a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C49EE61AC1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 16:03:34 +0200 (CEST)","by mail-yw1-x112a.google.com with SMTP id\n\t00721157ae682-61ae6c615aaso60258967b3.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 07:03:34 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"hvB9raEm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1713881013; x=1714485813;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=AGaqNlNYQrzMulbpaZ/1g3FQPVlo7+O4lbM877o3oPg=;\n\tb=hvB9raEmmWCcHMSGBvfzzL/g03Oig7iuJK5r8AUCWb1AS2tLkKG/ov6SAWOpdQwzoI\n\t9V+PDekCzFyr2KPOuanzd6O2eXTA08y/79EX21VDrLuUGosIhjJ/FM+DZpZbao3JD1DZ\n\t9y5NY+zZ1DNxFrCJuSR/s7uOKfmvK9h+tn6eW+hc5esJFaf18KKaHH5cBO+VS2nzAPil\n\throg4iCxT7TK/Ein4t65InVRJx2MtvP09bCzYoOuB7Kg8TQeHOuGVAyjKuozpuYNMXsf\n\tX/6voq4M8pXhOT0gLZ0qb0RwckTq8R8zrda9Zo9JK0VVAZFcbHIyd3NjHN9IDbNi3MaO\n\tGN6A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1713881013; x=1714485813;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=AGaqNlNYQrzMulbpaZ/1g3FQPVlo7+O4lbM877o3oPg=;\n\tb=G6kk7l/qex1spJtsTPT6rdb0NtimlncTg+faiYI3z0VssKHNPMh73a7pA1UT0yi9Xs\n\tcuC0Xqv9+Nf7tMQ9uT8PgFZ3wkxqT8XW6nmkqjjRZN3sHGcyaF6cSdPaDJFkae/GZ/2U\n\tEfQJ+vUIpwhB7+aFlhw8rfhssJiaIlLIPcrXaZkR+Kb/OA4jywmphqLP7Jzh7G4p7/+w\n\tkvMu2BzLOXzfbcMzZ+R5PElcPIIeavWjYqltkhzaQDVp15OAjZFejvDNIx+vFP62EfmA\n\t2T91ANgqI2Oi9T9XprugZXXfBFeDuWLWkueqrgIEajpAYLBPihiWLuw6JxTLbuq0PTVx\n\tg15A==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCVBz8tRQTP5/GTS3opocBbtgwKfiV7O+nIxttc2ikU+9NRhMYGRp6rQ7jKvbyl06maiyw+2LrOno124OOlueLDZQ7e8EsbnwPgGo9T4prpveOTTig==","X-Gm-Message-State":"AOJu0YzIhwWD59FeLTM7XjIPbfX7klQO1oLpKNxO8dmFptvzVlR7tYyl\n\tn7pXYo+FAYQErgGtVK22ft71Zqa6hx8gR5Kr94MdtLfaz0zB2Jcv0QCD01vjjTkD+DDT+6jyoiU\n\tjW+F4C5kC2QtiHIP6WIcAyG64Tuf+0hrGgSpQQg==","X-Google-Smtp-Source":"AGHT+IFkbu3IUL2sa3iQ0m/pBbqgjBPBSPK4F7MU9SUqi4WkQANbqWogcf/efMTEDhWu/Ji9FigbJHMZg/qi9FtecqA=","X-Received":"by 2002:a05:690c:6c92:b0:61a:e910:bfd5 with SMTP id\n\tis18-20020a05690c6c9200b0061ae910bfd5mr15812983ywb.25.1713881013246;\n\tTue, 23 Apr 2024 07:03:33 -0700 (PDT)","MIME-Version":"1.0","References":"<20240423103034.364150-1-mzamazal@redhat.com>\n\t<20240423103034.364150-12-mzamazal@redhat.com>\n\t<171387019899.284777.12957714772072079246@ping.linuxembedded.co.uk>\n\t<877cgocnb9.fsf@redhat.com>\n\t<171387377418.1636495.13646739599535132176@ping.linuxembedded.co.uk>","In-Reply-To":"<171387377418.1636495.13646739599535132176@ping.linuxembedded.co.uk>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 23 Apr 2024 15:02:57 +0100","Message-ID":"<CAEmqJPoT7_rCQQdVGZDBq9qB9LGcRfW3XoY+eGPAk+0Xor4kaA@mail.gmail.com>","Subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29320,"web_url":"https://patchwork.libcamera.org/comment/29320/","msgid":"<171388158037.284777.9173498096684706038@ping.linuxembedded.co.uk>","date":"2024-04-23T14:13:00","subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2024-04-23 15:02:57)\n> On Tue, 23 Apr 2024 at 13:02, Kieran Bingham\n> <kieran.bingham@ideasonboard.com> wrote:\n> >\n> > Quoting Milan Zamazal (2024-04-23 12:48:10)\n> > > Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n> > >\n> > > > Quoting Milan Zamazal (2024-04-23 11:30:26)\n> > > >> Extend (and rename) the documentation of environment variables with\n> > > >> information about the configuration file.\n> > > >\n> > > >>\n> > > >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> > > >> ---\n> > > >>  Documentation/index.rst                       |  2 +-\n> > > >>  Documentation/meson.build                     |  2 +-\n> > > >>  ...ariables.rst => runtime_configuration.rst} | 96 ++++++++++++++++---\n> > > >>  3 files changed, 87 insertions(+), 13 deletions(-)\n> > > >>  rename Documentation/{environment_variables.rst => runtime_configuration.rst} (65%)\n> > > >>\n> > > >> diff --git a/Documentation/index.rst b/Documentation/index.rst\n> > > >> index 5442ae75..aa277b85 100644\n> > > >> --- a/Documentation/index.rst\n> > > >> +++ b/Documentation/index.rst\n> > > >> @@ -19,7 +19,7 @@\n> > > >>     Pipeline Handler Writer's Guide <guides/pipeline-handler>\n> > > >>     IPA Writer's guide <guides/ipa>\n> > > >>     Tracing guide <guides/tracing>\n> > > >> -   Environment variables <environment_variables>\n> > > >> +   Runtime configuration <runtime_configuration>\n> > > >>     Sensor driver requirements <sensor_driver_requirements>\n> > > >>     Lens driver requirements <lens_driver_requirements>\n> > > >>     Python Bindings <python-bindings>\n> > > >> diff --git a/Documentation/meson.build b/Documentation/meson.build\n> > > >> index 3872e0a8..f8ca63eb 100644\n> > > >> --- a/Documentation/meson.build\n> > > >> +++ b/Documentation/meson.build\n> > > >> @@ -70,7 +70,6 @@ if sphinx.found()\n> > > >>          'conf.py',\n> > > >>          'contributing.rst',\n> > > >>          'docs.rst',\n> > > >> -        'environment_variables.rst',\n> > > >>          'guides/application-developer.rst',\n> > > >>          'guides/introduction.rst',\n> > > >>          'guides/ipa.rst',\n> > > >> @@ -79,6 +78,7 @@ if sphinx.found()\n> > > >>          'index.rst',\n> > > >>          'lens_driver_requirements.rst',\n> > > >>          'python-bindings.rst',\n> > > >> +        'runtime_configuration.rst',\n> > > >>          'sensor_driver_requirements.rst',\n> > > >>          'software-isp-benchmarking.rst',\n> > > >>         '../README.rst',\n> > > >> diff --git a/Documentation/environment_variables.rst b/Documentation/runtime_configuration.rst\n> > > >> similarity index 65%\n> > > >> rename from Documentation/environment_variables.rst\n> > > >> rename to Documentation/runtime_configuration.rst\n> > > >> index a9b230bc..d3972363 100644\n> > > >> --- a/Documentation/environment_variables.rst\n> > > >> +++ b/Documentation/runtime_configuration.rst\n> > > >> @@ -1,43 +1,117 @@\n> > > >>  .. SPDX-License-Identifier: CC-BY-SA-4.0\n> > > >>\n> > > >> -Environment variables\n> > > >> +Runtime configuration\n> > > >>  =====================\n> > > >>\n> > > >> -The libcamera behaviour can be tuned through environment variables. This\n> > > >> -document lists all the available variables and describes their usage.\n> > > >> +The libcamera behaviour can be tuned through a configuration file or\n> > > >> +environment variables. This document lists all the configuration options\n> > > >> +and describes their usage.\n> > > >> +\n> > > >> +General rules\n> > > >> +-------------\n> > > >> +\n> > > >> +The configuration file is looked up in the following locations, in this\n> > > >> +order:\n> > > >> +\n> > > >> +- $XDG_CONFIG_HOME/libcamera/configuration.yaml\n> > > >> +- LIBCAMERA_SYSCONF_DIR/configuration.yaml\n> > > >> +- /etc/libcamera/configuration.yaml\n> > > >> +\n> > > >> +The first configuration file found wins, contingent configuration files\n> > > >> +in other locations are ignored.\n> > > >> +\n> > > >> +Settings in environment variables take precedence over settings in\n> > > >> +configuration files. This allows overriding behaviour temporarily\n> > > >> +without the need to modify configuration files.\n> > > >> +\n> > > >> +Configuration options\n> > > >> +---------------------\n> > > >> +\n> > > >> +Here is an overview of the available configuration options, in the YAML\n> > > >> +file structure:\n> > > >> +\n> > > >> +::\n> > > >> +\n> > > >> +  configuration:\n> > > >> +     ipa:\n> > > >> +       config_paths: # full paths to directories, separated by colons\n> > > >> +       force_isolation: # true/false\n> > > >> +       module_paths: # full paths to directories, separated by colons\n> > > >> +    log:\n> > > >> +      color: # true/false for color/no-color\n> > > >> +      file: # either `syslog` or a full path\n> > > >> +      levels: # see Log levels\n> > > >> +    pipelines:\n> > > >> +      rkisp1:\n> > > >> +        tuning_file: # full path\n> > > >> +      rpi:\n> > > >> +        config_file: # full path\n> > > >> +        tuning_file: # full path\n> > > >\n> > > > In fact, for the tuning files - I believe these need to be indexed by\n> > > > camera id ...\n> > > >\n> > > > Imagine running qcam on a Raspberry Pi 5 with two cameras. Setting a\n> > > > single tuning file would then override and apply for both cameras\n> > > > incorrectly (qcam can run either camera selectively, and same with the\n> > > > pipewire use cases etc...)\n> > >\n> > > I see.  This is based on the current code, which looks for a configuration file\n> >\n> > Oh absolutely. But I think there's a big difference when we move these\n> > to a configuration file which outlives a single run of a single binary\n> > and will affect /all/ cameras managed by a single pipeline handler.\n> >\n> > I don't think /you/ specifically have to address this - but it's\n> > important to consider here that it affects any camera.\n> >\n> > > based on the given sensor model but allows overriding it with an environment\n> > > variable (and here also the given configuration option).  The corresponding\n> > > commit messages don't provide the reason for overriding, perhaps for debugging\n> > > or experimentation?\n> >\n> > Some of Raspberry Pi's cameras have multiple tuning files, so this lets\n> > users choose which one to select at present.\n> >\n> > It's definitely somethign that is worthy of being in a configuration\n> > file. But it's a per-camera thing, not a per-pipeline handler thing.\n> >\n> > I suspect it means even the environment variable is misleading too! The\n> > same issue would occur there if you launch qcam with a single tuning\n> > file overridden.\n> >\n> > > Maybe we could leave these configuration environment variables without\n> > > configuration file options or we could enhance the configuration as you suggest.\n> > > But I don't know what's the intended use case.  Suggestions?\n> >\n> > Naush - any thoughts here?\n> \n> This is indeed an annoying problem - even now with our environment\n> variable workaround.  Obviously you can run with different env\n> variables in different processes to workaround this.\n> \n> There is a problem with numbering cameras in the config file though -\n> the order that cameras get enumerated by the kernel is not fully\n> deterministic, which makes per-camera config options a bit more\n> complicated.\n\nOh - absolutely. Any camera referenced in a config file should be\nreferenced by it's camera identifier.\n\npi@beehive:~ $ cam --list\nAvailable cameras:\n1: 'imx283' (/base/axi/pcie@120000/rp1/i2c@88000/imx283@1a)\n2: 'imx335' (/base/axi/pcie@120000/rp1/i2c@80000/imx335@1a)\n\n\nSo that would have to be:\n\n cameras:\n  - \"/base/axi/pcie@120000/rp1/i2c@88000/imx283@1a\":\n    tuning_file: /home/pi/imx283.json\n  - \"/base/axi/pcie@120000/rp1/i2c@80000/imx335@1a\":\n    tuning_file: /home/pi/imx335.json\n\nAssuming the above doesn't break yaml requirements.\n\n\n\n> Naush\n> \n> \n> \n> >\n> > --\n> > Kieran\n> >\n> >\n> > >\n> > > >> +      simple:\n> > > >> +        supported_devices:\n> > > >> +        - driver: # driver name, e.g. `mxc-isi`\n> > > >> +          software_isp: # true/false\n> > > >> +\n> > > >> +Configuration file example\n> > > >> +--------------------------\n> > > >> +\n> > > >> +::\n> > > >> +\n> > > >> +   ---\n> > > >> +   version: 1\n> > > >> +   configuration:\n> > > >> +     ipa:\n> > > >> +       config_paths: /home/user/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa\n> > > >> +       module_paths: /home/user/.libcamera/lib:/opt/libcamera/vendor/lib\n> > > >> +       force_isolation: true\n> > > >> +     log:\n> > > >> +       color: false\n> > > >> +       file: syslog\n> > > >> +       levels: 'IPAManager:DEBUG'\n> > > >> +     pipelines:\n> > > >> +       rkisp1:\n> > > >> +         tuning_file: /home/user/.libcamera/rkisp1.yaml\n> > > >> +       rpi:\n> > > >> +         config_file: /usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml\n> > > >> +       simple:\n> > > >> +         supported_devices:\n> > > >> +         - driver: mxc-isi\n> > > >> +           software_isp: true\n> > > >>\n> > > >>  List of variables\n> > > >>  -----------------\n> > > >>\n> > > >> -LIBCAMERA_LOG_FILE\n> > > >> +The corresponding configuration file paths are listed in parentheses.\n> > > >> +\n> > > >> +LIBCAMERA_LOG_FILE (log.file)\n> > > >>     The custom destination for log output.\n> > > >>\n> > > >>     Example value: ``/home/{user}/camera_log.log``\n> > > >>\n> > > >> -LIBCAMERA_LOG_LEVELS\n> > > >> +LIBCAMERA_LOG_LEVELS (log.levels)\n> > > >>     Configure the verbosity of log messages for different categories (`more <Log levels_>`__).\n> > > >>\n> > > >>     Example value: ``*:DEBUG``\n> > > >>\n> > > >> -LIBCAMERA_LOG_NO_COLOR\n> > > >> +LIBCAMERA_LOG_NO_COLOR (log.color)\n> > > >>     Disable coloring of log messages (`more <Notes about debugging_>`__).\n> > > >>\n> > > >> -LIBCAMERA_IPA_CONFIG_PATH\n> > > >> +LIBCAMERA_IPA_CONFIG_PATH (ipa.config_paths)\n> > > >>     Define custom search locations for IPA configurations (`more <IPA configuration_>`__).\n> > > >>\n> > > >>     Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa``\n> > > >>\n> > > >> -LIBCAMERA_IPA_FORCE_ISOLATION\n> > > >> +LIBCAMERA_IPA_FORCE_ISOLATION (ipa.force_isolation)\n> > > >>     When set to a non-empty string, force process isolation of all IPA modules.\n> > > >>\n> > > >>     Example value: ``1``\n> > > >>\n> > > >> -LIBCAMERA_IPA_MODULE_PATH\n> > > >> +LIBCAMERA_IPA_MODULE_PATH (ipa.module_paths)\n> > > >>     Define custom search locations for IPA modules (`more <IPA module_>`__).\n> > > >>\n> > > >>     Example value: ``${HOME}/.libcamera/lib:/opt/libcamera/vendor/lib``\n> > > >>\n> > > >> -LIBCAMERA_RPI_CONFIG_FILE\n> > > >> +LIBCAMERA_RPI_CONFIG_FILE (pipelines.rpi.config_file)\n> > > >>     Define a custom configuration file to use in the Raspberry Pi pipeline handler.\n> > > >>\n> > > >>     Example value: ``/usr/local/share/libcamera/pipeline/rpi/vc4/minimal_mem.yaml``\n> > > >> @@ -136,7 +210,7 @@ code.\n> > > >>  IPA configuration\n> > > >>  ~~~~~~~~~~~~~~~~~\n> > > >>\n> > > >> -IPA modules use configuration files to store parameters. The format and\n> > > >> +IPA modules use their own configuration files to store parameters. The format and\n> > > >>  contents of the configuration files is specific to the IPA module. They usually\n> > > >>  contain tuning parameters for the algorithms, in JSON format.\n> > > >>\n> > > >> --\n> > > >> 2.42.0\n> > > >>\n> > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8ED5EC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Apr 2024 14:13:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BD35561B24;\n\tTue, 23 Apr 2024 16:13:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DCB5361AC1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Apr 2024 16:13:02 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 868D91A2;\n\tTue, 23 Apr 2024 16:12:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"luDNQ9Gj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1713881531;\n\tbh=iEkqrmaY7durzY0OpZXG/obBRuy/W/IYzpa1a/zVU4w=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=luDNQ9GjRo7dGzDwEzF7VZZytQrN+x6LEbbiI2EmNS8sCFf31tCXWNtCqiQg6n42h\n\taiuH8GgGb7AoKP3ZvlZFiB0lIA0kTroFDpkWsazHajPZ2z7kgPqKdZpEsbiiMEm4gc\n\tLvX4+l3NBxK+kIl4AX8rVA2Rv2o3Kdp/Ap2+0dHU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<CAEmqJPoT7_rCQQdVGZDBq9qB9LGcRfW3XoY+eGPAk+0Xor4kaA@mail.gmail.com>","References":"<20240423103034.364150-1-mzamazal@redhat.com>\n\t<20240423103034.364150-12-mzamazal@redhat.com>\n\t<171387019899.284777.12957714772072079246@ping.linuxembedded.co.uk>\n\t<877cgocnb9.fsf@redhat.com>\n\t<171387377418.1636495.13646739599535132176@ping.linuxembedded.co.uk>\n\t<CAEmqJPoT7_rCQQdVGZDBq9qB9LGcRfW3XoY+eGPAk+0Xor4kaA@mail.gmail.com>","Subject":"Re: [PATCH v2 11/13] config: Add global configuration file\n\tdocumentation","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","To":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 23 Apr 2024 15:13:00 +0100","Message-ID":"<171388158037.284777.9173498096684706038@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]