[RFC,11/11] config: Add global configuration documentation
diff mbox series

Message ID 20240326112419.503286-12-mzamazal@redhat.com
State New
Headers show
Series
  • Add global configuration file
Related show

Commit Message

Milan Zamazal March 26, 2024, 11:24 a.m. UTC
WIP

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
---
 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%)

Patch
diff mbox series

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 <guides/pipeline-handler>
    IPA Writer's guide <guides/ipa>
    Tracing guide <guides/tracing>
-   Environment variables <environment_variables>
+   Runtime configuration <runtime_configuration>
    Sensor driver requirements <sensor_driver_requirements>
    Lens driver requirements <lens_driver_requirements>
    Python Bindings <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.