From e367cd9c742b6edab3c853333d71680502994431 Mon Sep 17 00:00:00 2001 From: Milan Zamazal Date: Fri, 12 Sep 2025 16:29:10 +0200 Subject: [PATCH] Documentation: Add global configuration file documentation Extend (and rename) the documentation of environment variables with information about the configuration file. Signed-off-by: Milan Zamazal Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- Documentation/index.rst | 2 +- Documentation/meson.build | 2 +- ...ariables.rst => runtime_configuration.rst} | 102 +++++++++++++++--- 3 files changed, 91 insertions(+), 15 deletions(-) rename Documentation/{environment_variables.rst => runtime_configuration.rst} (66%) diff --git a/Documentation/index.rst b/Documentation/index.rst index 7f762bbc..febd4e13 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -8,9 +8,9 @@ Introduction Feature Requirements + Runtime configuration Application Writer's Guide Python Bindings - Environment variables Public API .. toctree:: diff --git a/Documentation/meson.build b/Documentation/meson.build index a5d8c20c..28d616aa 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -156,7 +156,6 @@ if sphinx.found() sphinx_conf, 'contributing.rst', 'design/ae.rst', - 'environment_variables.rst', 'feature_requirements.rst', 'guides/application-developer.rst', 'guides/ipa.rst', @@ -170,6 +169,7 @@ if sphinx.found() 'mali-c55.dot', 'public-api/index.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 66% rename from Documentation/environment_variables.rst rename to Documentation/runtime_configuration.rst index 099769ea..bad0297c 100644 --- a/Documentation/environment_variables.rst +++ b/Documentation/runtime_configuration.rst @@ -1,13 +1,82 @@ .. 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. -List of variables ------------------ +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 +- LIBCAMERA_DATA_DIR/libcamera/configuration.yaml + +The first configuration file found wins, 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 +--------------------- + +Here is an overview of the available configuration options, in the YAML +file structure: + +:: + + configuration: + ipa: + force_isolation: # true/false + config_paths: + - ... # full path to a directory + module_paths: + - ... # full path to a directory + pipelines_match_list: + - ... # pipeline name + pipelines: + simple: + supported_devices: + - driver: # driver name, e.g. `mxc-isi` + software_isp: # true/false + +Configuration file example +-------------------------- + +:: + + --- + version: 1 + configuration: + ipa: + config_paths: + - /home/user/.libcamera/share/ipa + - /opt/libcamera/vendor/share/ipa + module_paths: + - /home/user/.libcamera/lib + - /opt/libcamera/vendor/lib + proxy_paths: + - /home/user/.libcamera/proxy/worker + - /opt/libcamera/vendor/proxy/worker + force_isolation: true + pipelines_match_list: + - rkisp1 + - simple + pipelines: + simple: + supported_devices: + - driver: mxc-isi + software_isp: true + +List of variables and configuration options +------------------------------------------- LIBCAMERA_LOG_FILE The custom destination for log output. @@ -22,27 +91,27 @@ LIBCAMERA_LOG_LEVELS LIBCAMERA_LOG_NO_COLOR Disable coloring of log messages (`more `__). -LIBCAMERA_IPA_CONFIG_PATH +LIBCAMERA_IPA_CONFIG_PATH, ipa.config_paths Define custom search locations for IPA configurations (`more `__). Example value: ``${HOME}/.libcamera/share/ipa:/opt/libcamera/vendor/share/ipa`` -LIBCAMERA_IPA_FORCE_ISOLATION +LIBCAMERA_IPA_FORCE_ISOLATION, ipa.force_isolation When set to a non-empty string, force process isolation of all IPA modules. Example value: ``1`` -LIBCAMERA_IPA_MODULE_PATH +LIBCAMERA_IPA_MODULE_PATH, ipa.module_paths Define custom search locations for IPA modules (`more `__). Example value: ``${HOME}/.libcamera/lib:/opt/libcamera/vendor/lib`` -LIBCAMERA_IPA_PROXY_PATH +LIBCAMERA_IPA_PROXY_PATH, ipa.proxy_paths Define custom full path for a proxy worker for a given executable name. Example value: ``${HOME}/.libcamera/proxy/worker:/opt/libcamera/vendor/proxy/worker`` -LIBCAMERA_PIPELINES_MATCH_LIST +LIBCAMERA_PIPELINES_MATCH_LIST, pipelines_match_list Define an ordered list of pipeline names to be used to match the media devices in the system. The pipeline handler names used to populate the variable are the ones passed to the REGISTER_PIPELINE_HANDLER() macro in the @@ -60,6 +129,13 @@ LIBCAMERA__TUNING_FILE Example value: ``/usr/local/share/libcamera/ipa/rpi/vc4/custom_sensor.json`` +pipelines.simple.supported_devices.driver, pipelines.simple.supported_devices.software_isp + Override whether software ISP is enabled for the given driver. + + Example `driver` value: ``mxc-isi`` + + Example `software_isp` value: ``true`` + Further details --------------- @@ -154,9 +230,9 @@ code. IPA configuration ~~~~~~~~~~~~~~~~~ -IPA modules use 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. +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. The ``LIBCAMERA_IPA_CONFIG_PATH`` variable can be used to specify custom storage locations to search for those configuration files.