[{"id":34879,"web_url":"https://patchwork.libcamera.org/comment/34879/","msgid":"<175248732782.50296.11825354647230209710@ping.linuxembedded.co.uk>","date":"2025-07-14T10:02:07","subject":"Re: [PATCH v13 00/12] Add global configuration file","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Milan,\n\nI'm not sure where - but it seems this is breaking CI on the virtual or\nvimc cameras ?\n\n6/80 libcamera:camera / camera_reconfigure                      FAIL\n0.97s   (exit status 255 or signal 127 SIGinvalid)\n\n\nhttps://gitlab.freedesktop.org/camera/libcamera/-/jobs/80404217\n\nCould you run the unit tests locally and/or check the CI results please?\n\n--\nKieran\n\n\nQuoting Milan Zamazal (2025-07-11 21:12:19)\n> This patch series introduces global configuration file for libcamera, to\n> provide runtime configuration means other than environment variables.\n> Instead of, or in addition to, the growing list of configuration\n> environment variables, the whole configuration can be specified in a\n> single configuration file.  This is both simpler and more flexible.\n> \n> This is not a replacement for specific configuration files already\n> present in libcamera, with the exception of rpi configuration file (see\n> “Look up rpi configuration in the configuration file” patch).\n> \n> The patches implement what is needed to introduce a configuration file\n> that can handle the current environment variables and software ISP\n> TODOs.  They demonstrate how to deal with the key points that must be\n> considered.  Logging is omitted from the configuration file for\n> technical reasons.  See commit messages for more details.\n> \n> The configuration file is a YAML file.  It is looked up in user’s home\n> directory or, if not present, in system-wide libcamera directories.\n> Both the directories and file name of the configuration file can be\n> overridden using newly introduced environment variables.\n> \n> The current configuration environment variables are still supported and\n> take precedence, if defined, over the corresponding entries in the YAML\n> file.\n> \n> This patch series is not exhaustive, there can be future enhancements,\n> most notably configuration file validation to avoid confusions caused by\n> typos etc.\n> \n> Not everything has been tested because some of the patches are related\n> to specific hardware.\n> \n> Changes in v13:\n> - If LIBCAMERA_CONFIG_NAME is defined but empty, no configuration is\n>   loaded.\n> - Standard user configuration directory has no longer precedence over\n>   LIBCAMERA_CONFIG_DIR.\n> - Improvements to the rpi code suggested by Barnabás.\n> - Documentation fixes suggested by Barnabás.\n> - Make sure yamlConfiguration_ is initialized.\n> \n> Changes in v12:\n> - The commit message of \"Make GlobalConfiguration instance\" updated\n>   according to the recent discussions.\n> - Use initializer_list rather than a string with separators for\n>   GlobalConfiguration option path arguments.\n> - char *const qualifiers dropped.\n> - rpi can have separate configurations for different targets.\n> - GlobalConfiguration::option template is not type limited anymore.\n> - utils::join used instead of manual string concatenation.\n> - envListOption and listOption return std::optional now.\n> - Configuration corresponding to LIBCAMERA_*_TUNING_FILE dropped.\n> - Isolation configuration stored to IPAManager to avoid passing the\n>   whole configuraton to isSignatureValid.\n> - Similarly to paths in IPAProxy.\n> - `delimiter' argument added to GlobalConfiguration::envListOption and\n>   used for LIBCAMERA_PIPELINES_MATCH_LIST processing.\n> - Configuration no longer looked up in /etc/libcamera and additionally\n>   looked up in LIBCAMERA_DATA_DIR.\n> - Cosmetic changes suggested by Barnabás.\n> \n> Changes in v11:\n> - global_configuration.cpp moved out of base and yaml_parser.cpp left in\n>   its original place.\n> - Configuration initialized as empty if there is no configuration file,\n>   preventing a segfault on later access.\n> - Cosmetic changes suggested by Laurent.\n> - GlobalConfiguration::get() removed, *yamlConfiguration_ used directly.\n> - Failing to read an existent configuration file is an error, rather\n>   than warning, now.  (It should be also fatal, but how to propagate it?)\n> - Slash is used instead of dot to separate configuration names.\n> - rpi configuration read is in the global configuration directly (unless\n>   overridden by LIBCAMERA_RPI_CONFIG_FILE) now.\n> \n> Changes in v10:\n> - Minor improvements suggested by Barnabás.\n> \n> Changes in v9:\n> - The configuration instance is now stored in CameraManager and accessed\n>   from there rather than being a separate singleton wrapped by global\n>   accessors.  This solves the ugly problem of delayed initialization but\n>   I don’t like anything else about it.  I played a bit with the idea of\n>   attaching it to Logger instead, see the commit message of patch 03 for\n>   some discussion, but stayed with the CameraManager proposal\n>   eventually.\n> - I’ve given up on the logging configuration now when the configuration\n>   is stored in CameraManager and removed the corresponding patches.  I\n>   think it’s possible to add it later, but for now, it’s already\n>   complicated enough.\n> - Not much tested, let’s see first if the current implementation gets in\n>   an acceptable direction.\n> \n> Changes in v8:\n> - Rebased on current master.\n> - Anniversary edition: 400 days since v1 posted. ;-)\n> \n> Changes in v7:\n> - Rebased on current master.\n> - Tuning file path configuration updated for recent changes.\n>   A significant change is that the tuning file configuration is no\n>   longer sensor dependent as there is apparently no access to the sensor\n>   info in the IPA proxy.\n> - Minor improvements of some commit messages.\n> \n> Changes in v6:\n> - Rebased on master.\n> - File names from file header descriptions removed.\n> - Indentation fix in moved code as requested by checkstyle.py.\n> - Unneeded const_cast's removed.\n> - Using GlobalConfiguration namespace rather than a class.\n> - Path configuration options are defined as sequences in YAML.\n> - A patch introducing LIBCAMERA_CONFIG_NAME added.\n> - A patch introducing LIBCAMERA_CONFIG_DIR added.\n> - Miscellaneous minor code changes suggested by Barnabás.\n> \n> Changes in v5:\n> - A pointer is used to store the global configuration singleton rather\n>   than a static variable.  This makes the things more robust and fixes\n>   the problem with re-entrancy on logging and a failing\n>   camera_reconfigure test.\n> - In relation to the change above, a new initialization method\n>   GlobalConfiguration::initialize() was introduced that replaces the\n>   initialization calls in CameraManager and IPAManager.\n> - Logging YAML errors when reading the configuration was also fixed.\n> - Global configuration is placed to base directly, without an\n>   intermediate patch.\n> - An `optional' value comparison simplified.\n> - A temporary typo in a comment fixed.\n> - Unused stdint.h include removed.\n> \n> Changes in v4:\n> - Rebased on current master.\n> - Configuration option for LIBCAMERA_IPA_PROXY_PATH added.\n> - Added a patch to include stdlib.h instead of cstdlib in yaml_parser.cpp.\n> \n> Changes in v3:\n> - Added a configuration item for the newly introduced\n>   LIBCAMERA_PIPELINES_MATCH_LIST variable.\n> - A minor indentation fix.\n> - Fixed `pipelines.' x `pipeline.' configuration item naming mismatch.\n> - Tuning files are looked up now by particular cameras attached rather than\n>   being specified for the whole pipeline.\n> - Helpers use std::string& instead of char* for confPath arguments.\n> - Protection against returning YamlObject::empty as a regular value (the\n>   problem has been probably exposed by addition of\n>   LIBCAMERA_PIPELINES_MATCH_LIST).\n> \n> Changes in v2:\n> - Rebased on master.\n> - Various cleanups, documentation improvements and minor fixes.\n> - Configuration option for LIBCAMERA_RPI_TUNING_FILE added (Naush).\n> - Two more patches for software ISP configuration added.\n> \n> Milan Zamazal (12):\n>   config: Introduce global runtime configuration\n>   config: Make GlobalConfiguration instance\n>   config: Add configuration retrieval helpers\n>   config: Look up rpi configuration in the configuration file\n>   config: Look up IPA configurables in configuration file\n>   config: Look up pipelines match list in configuration file\n>   config: Allow enabling software ISP in runtime\n>   config: Add global configuration file documentation\n>   libcamera: software_isp: Make input buffer copying configurable\n>   libcamera: software_isp: Make measurement configurable\n>   config: Make configuration file configurable\n>   config: Make configuration directories configurable\n> \n>  Documentation/documentation-contents.rst      |   2 +-\n>  Documentation/index.rst                       |   2 +-\n>  Documentation/meson.build                     |   2 +-\n>  ...ariables.rst => runtime_configuration.rst} | 129 ++++++++-\n>  include/libcamera/internal/camera_manager.h   |   8 +\n>  .../libcamera/internal/global_configuration.h |  62 +++++\n>  include/libcamera/internal/ipa_manager.h      |   7 +-\n>  include/libcamera/internal/ipa_proxy.h        |   8 +-\n>  include/libcamera/internal/meson.build        |   1 +\n>  src/libcamera/camera_manager.cpp              |  20 +-\n>  src/libcamera/global_configuration.cpp        | 259 ++++++++++++++++++\n>  src/libcamera/ipa_manager.cpp                 |  39 ++-\n>  src/libcamera/ipa_proxy.cpp                   |  51 ++--\n>  src/libcamera/meson.build                     |   1 +\n>  .../pipeline/rpi/common/pipeline_base.cpp     |  62 +++--\n>  .../pipeline/rpi/common/pipeline_base.h       |   3 +-\n>  src/libcamera/pipeline/rpi/pisp/pisp.cpp      |  26 +-\n>  src/libcamera/pipeline/rpi/vc4/vc4.cpp        |  26 +-\n>  src/libcamera/pipeline/simple/simple.cpp      |  13 +\n>  src/libcamera/software_isp/TODO               |  36 ---\n>  src/libcamera/software_isp/debayer_cpu.cpp    |  32 ++-\n>  src/libcamera/software_isp/debayer_cpu.h      |  10 +-\n>  src/libcamera/software_isp/software_isp.cpp   |   3 +-\n>  .../module_ipa_proxy.cpp.tmpl                 |   4 +-\n>  .../module_ipa_proxy.h.tmpl                   |   2 +-\n>  25 files changed, 633 insertions(+), 175 deletions(-)\n>  rename Documentation/{environment_variables.rst => runtime_configuration.rst} (59%)\n>  create mode 100644 include/libcamera/internal/global_configuration.h\n>  create mode 100644 src/libcamera/global_configuration.cpp\n> \n> -- \n> 2.50.1\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 A3368BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Jul 2025 10:02:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 553B668F39;\n\tMon, 14 Jul 2025 12:02:12 +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 95F4B68F36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Jul 2025 12:02:10 +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 DA60E1B24;\n\tMon, 14 Jul 2025 12:01:38 +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=\"IL3JsidW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1752487299;\n\tbh=rd4NHlHtzsF8TjX6oVTmlPhjvLcD1yYwN/jDb44E0t4=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=IL3JsidWiYLozdRCO+pkXoP+adBZDFjPx3wKCbVn6jSM7c61u2+HijvU5h+ywlhqa\n\tH5EdiVPNgyJpWjp6UZZOWcdOj6G6e/Fi5j2SNUzmRQDpkpyZ1UpB9bpKIwwihi6zZw\n\tvIhXbHp0EDpWRFcCuMG3ui9mIlIYj0qnW3hJ1bUY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250711201232.129264-1-mzamazal@redhat.com>","References":"<20250711201232.129264-1-mzamazal@redhat.com>","Subject":"Re: [PATCH v13 00/12] Add global configuration file","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <barnabas.pocze@ideasonboard.com>, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Mon, 14 Jul 2025 11:02:07 +0100","Message-ID":"<175248732782.50296.11825354647230209710@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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":34881,"web_url":"https://patchwork.libcamera.org/comment/34881/","msgid":"<1aa6c291-80db-4503-ac18-ed758d324727@ideasonboard.com>","date":"2025-07-14T10:46:59","subject":"Re: [PATCH v13 00/12] Add global configuration file","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 07. 14. 12:02 keltezéssel, Kieran Bingham írta:\n> Hi Milan,\n> \n> I'm not sure where - but it seems this is breaking CI on the virtual or\n> vimc cameras ?\n> \n> 6/80 libcamera:camera / camera_reconfigure                      FAIL\n> 0.97s   (exit status 255 or signal 127 SIGinvalid)\n> \n> \n> https://gitlab.freedesktop.org/camera/libcamera/-/jobs/80404217\n> \n> Could you run the unit tests locally and/or check the CI results please?\n\nNow the `LIBCAMERA_IPA_FORCE_ISOLATION` env var is checked during construction, so\nit has to be set before a `CameraManager` is constructed.\n\ndiff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\nindex fe13d6acf..6fb44989d 100644\n--- a/test/libtest/camera_test.cpp\n+++ b/test/libtest/camera_test.cpp\n@@ -15,11 +15,11 @@ using namespace std;\n  \n  CameraTest::CameraTest(const char *name, bool isolate)\n  {\n-       cm_ = new CameraManager();\n-\n         if (isolate)\n                 setenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"1\", 1);\n  \n+       cm_ = new CameraManager();\n+\n         if (cm_->start()) {\n                 cerr << \"Failed to start camera manager\" << endl;\n                 status_ = TestFail;\n\n\nRegards,\nBarnabás Pőcze\n\n> \n> --\n> Kieran\n> \n> \n> Quoting Milan Zamazal (2025-07-11 21:12:19)\n>> This patch series introduces global configuration file for libcamera, to\n>> provide runtime configuration means other than environment variables.\n>> Instead of, or in addition to, the growing list of configuration\n>> environment variables, the whole configuration can be specified in a\n>> single configuration file.  This is both simpler and more flexible.\n>>\n>> This is not a replacement for specific configuration files already\n>> present in libcamera, with the exception of rpi configuration file (see\n>> “Look up rpi configuration in the configuration file” patch).\n>>\n>> The patches implement what is needed to introduce a configuration file\n>> that can handle the current environment variables and software ISP\n>> TODOs.  They demonstrate how to deal with the key points that must be\n>> considered.  Logging is omitted from the configuration file for\n>> technical reasons.  See commit messages for more details.\n>>\n>> The configuration file is a YAML file.  It is looked up in user’s home\n>> directory or, if not present, in system-wide libcamera directories.\n>> Both the directories and file name of the configuration file can be\n>> overridden using newly introduced environment variables.\n>>\n>> The current configuration environment variables are still supported and\n>> take precedence, if defined, over the corresponding entries in the YAML\n>> file.\n>>\n>> This patch series is not exhaustive, there can be future enhancements,\n>> most notably configuration file validation to avoid confusions caused by\n>> typos etc.\n>>\n>> Not everything has been tested because some of the patches are related\n>> to specific hardware.\n>>\n>> Changes in v13:\n>> - If LIBCAMERA_CONFIG_NAME is defined but empty, no configuration is\n>>    loaded.\n>> - Standard user configuration directory has no longer precedence over\n>>    LIBCAMERA_CONFIG_DIR.\n>> - Improvements to the rpi code suggested by Barnabás.\n>> - Documentation fixes suggested by Barnabás.\n>> - Make sure yamlConfiguration_ is initialized.\n>>\n>> Changes in v12:\n>> - The commit message of \"Make GlobalConfiguration instance\" updated\n>>    according to the recent discussions.\n>> - Use initializer_list rather than a string with separators for\n>>    GlobalConfiguration option path arguments.\n>> - char *const qualifiers dropped.\n>> - rpi can have separate configurations for different targets.\n>> - GlobalConfiguration::option template is not type limited anymore.\n>> - utils::join used instead of manual string concatenation.\n>> - envListOption and listOption return std::optional now.\n>> - Configuration corresponding to LIBCAMERA_*_TUNING_FILE dropped.\n>> - Isolation configuration stored to IPAManager to avoid passing the\n>>    whole configuraton to isSignatureValid.\n>> - Similarly to paths in IPAProxy.\n>> - `delimiter' argument added to GlobalConfiguration::envListOption and\n>>    used for LIBCAMERA_PIPELINES_MATCH_LIST processing.\n>> - Configuration no longer looked up in /etc/libcamera and additionally\n>>    looked up in LIBCAMERA_DATA_DIR.\n>> - Cosmetic changes suggested by Barnabás.\n>>\n>> Changes in v11:\n>> - global_configuration.cpp moved out of base and yaml_parser.cpp left in\n>>    its original place.\n>> - Configuration initialized as empty if there is no configuration file,\n>>    preventing a segfault on later access.\n>> - Cosmetic changes suggested by Laurent.\n>> - GlobalConfiguration::get() removed, *yamlConfiguration_ used directly.\n>> - Failing to read an existent configuration file is an error, rather\n>>    than warning, now.  (It should be also fatal, but how to propagate it?)\n>> - Slash is used instead of dot to separate configuration names.\n>> - rpi configuration read is in the global configuration directly (unless\n>>    overridden by LIBCAMERA_RPI_CONFIG_FILE) now.\n>>\n>> Changes in v10:\n>> - Minor improvements suggested by Barnabás.\n>>\n>> Changes in v9:\n>> - The configuration instance is now stored in CameraManager and accessed\n>>    from there rather than being a separate singleton wrapped by global\n>>    accessors.  This solves the ugly problem of delayed initialization but\n>>    I don’t like anything else about it.  I played a bit with the idea of\n>>    attaching it to Logger instead, see the commit message of patch 03 for\n>>    some discussion, but stayed with the CameraManager proposal\n>>    eventually.\n>> - I’ve given up on the logging configuration now when the configuration\n>>    is stored in CameraManager and removed the corresponding patches.  I\n>>    think it’s possible to add it later, but for now, it’s already\n>>    complicated enough.\n>> - Not much tested, let’s see first if the current implementation gets in\n>>    an acceptable direction.\n>>\n>> Changes in v8:\n>> - Rebased on current master.\n>> - Anniversary edition: 400 days since v1 posted. ;-)\n>>\n>> Changes in v7:\n>> - Rebased on current master.\n>> - Tuning file path configuration updated for recent changes.\n>>    A significant change is that the tuning file configuration is no\n>>    longer sensor dependent as there is apparently no access to the sensor\n>>    info in the IPA proxy.\n>> - Minor improvements of some commit messages.\n>>\n>> Changes in v6:\n>> - Rebased on master.\n>> - File names from file header descriptions removed.\n>> - Indentation fix in moved code as requested by checkstyle.py.\n>> - Unneeded const_cast's removed.\n>> - Using GlobalConfiguration namespace rather than a class.\n>> - Path configuration options are defined as sequences in YAML.\n>> - A patch introducing LIBCAMERA_CONFIG_NAME added.\n>> - A patch introducing LIBCAMERA_CONFIG_DIR added.\n>> - Miscellaneous minor code changes suggested by Barnabás.\n>>\n>> Changes in v5:\n>> - A pointer is used to store the global configuration singleton rather\n>>    than a static variable.  This makes the things more robust and fixes\n>>    the problem with re-entrancy on logging and a failing\n>>    camera_reconfigure test.\n>> - In relation to the change above, a new initialization method\n>>    GlobalConfiguration::initialize() was introduced that replaces the\n>>    initialization calls in CameraManager and IPAManager.\n>> - Logging YAML errors when reading the configuration was also fixed.\n>> - Global configuration is placed to base directly, without an\n>>    intermediate patch.\n>> - An `optional' value comparison simplified.\n>> - A temporary typo in a comment fixed.\n>> - Unused stdint.h include removed.\n>>\n>> Changes in v4:\n>> - Rebased on current master.\n>> - Configuration option for LIBCAMERA_IPA_PROXY_PATH added.\n>> - Added a patch to include stdlib.h instead of cstdlib in yaml_parser.cpp.\n>>\n>> Changes in v3:\n>> - Added a configuration item for the newly introduced\n>>    LIBCAMERA_PIPELINES_MATCH_LIST variable.\n>> - A minor indentation fix.\n>> - Fixed `pipelines.' x `pipeline.' configuration item naming mismatch.\n>> - Tuning files are looked up now by particular cameras attached rather than\n>>    being specified for the whole pipeline.\n>> - Helpers use std::string& instead of char* for confPath arguments.\n>> - Protection against returning YamlObject::empty as a regular value (the\n>>    problem has been probably exposed by addition of\n>>    LIBCAMERA_PIPELINES_MATCH_LIST).\n>>\n>> Changes in v2:\n>> - Rebased on master.\n>> - Various cleanups, documentation improvements and minor fixes.\n>> - Configuration option for LIBCAMERA_RPI_TUNING_FILE added (Naush).\n>> - Two more patches for software ISP configuration added.\n>>\n>> Milan Zamazal (12):\n>>    config: Introduce global runtime configuration\n>>    config: Make GlobalConfiguration instance\n>>    config: Add configuration retrieval helpers\n>>    config: Look up rpi configuration in the configuration file\n>>    config: Look up IPA configurables in configuration file\n>>    config: Look up pipelines match list in configuration file\n>>    config: Allow enabling software ISP in runtime\n>>    config: Add global configuration file documentation\n>>    libcamera: software_isp: Make input buffer copying configurable\n>>    libcamera: software_isp: Make measurement configurable\n>>    config: Make configuration file configurable\n>>    config: Make configuration directories configurable\n>>\n>>   Documentation/documentation-contents.rst      |   2 +-\n>>   Documentation/index.rst                       |   2 +-\n>>   Documentation/meson.build                     |   2 +-\n>>   ...ariables.rst => runtime_configuration.rst} | 129 ++++++++-\n>>   include/libcamera/internal/camera_manager.h   |   8 +\n>>   .../libcamera/internal/global_configuration.h |  62 +++++\n>>   include/libcamera/internal/ipa_manager.h      |   7 +-\n>>   include/libcamera/internal/ipa_proxy.h        |   8 +-\n>>   include/libcamera/internal/meson.build        |   1 +\n>>   src/libcamera/camera_manager.cpp              |  20 +-\n>>   src/libcamera/global_configuration.cpp        | 259 ++++++++++++++++++\n>>   src/libcamera/ipa_manager.cpp                 |  39 ++-\n>>   src/libcamera/ipa_proxy.cpp                   |  51 ++--\n>>   src/libcamera/meson.build                     |   1 +\n>>   .../pipeline/rpi/common/pipeline_base.cpp     |  62 +++--\n>>   .../pipeline/rpi/common/pipeline_base.h       |   3 +-\n>>   src/libcamera/pipeline/rpi/pisp/pisp.cpp      |  26 +-\n>>   src/libcamera/pipeline/rpi/vc4/vc4.cpp        |  26 +-\n>>   src/libcamera/pipeline/simple/simple.cpp      |  13 +\n>>   src/libcamera/software_isp/TODO               |  36 ---\n>>   src/libcamera/software_isp/debayer_cpu.cpp    |  32 ++-\n>>   src/libcamera/software_isp/debayer_cpu.h      |  10 +-\n>>   src/libcamera/software_isp/software_isp.cpp   |   3 +-\n>>   .../module_ipa_proxy.cpp.tmpl                 |   4 +-\n>>   .../module_ipa_proxy.h.tmpl                   |   2 +-\n>>   25 files changed, 633 insertions(+), 175 deletions(-)\n>>   rename Documentation/{environment_variables.rst => runtime_configuration.rst} (59%)\n>>   create mode 100644 include/libcamera/internal/global_configuration.h\n>>   create mode 100644 src/libcamera/global_configuration.cpp\n>>\n>> -- \n>> 2.50.1\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 59EA6BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Jul 2025 10:47:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 94B3868F3D;\n\tMon, 14 Jul 2025 12:47: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 D4E2C6186C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Jul 2025 12:47:02 +0200 (CEST)","from [192.168.33.16] (185.221.140.39.nat.pool.zt.hu\n\t[185.221.140.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C8C75109A;\n\tMon, 14 Jul 2025 12:46: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=\"HzwhBcR9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1752489991;\n\tbh=hNWku6Q3WPPn94KSCeEwurbawSZs3LPCMXXtekLY3xs=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=HzwhBcR9+ZN2y7P8cjGPm9t8i9RF9cj8Bx6r/c6xaAL4ag1KgyB5yCHVH53Brmk7O\n\tv98vv6+sLOPlki8JWJsDMArcjcXCuWscSwQDWAFY4Zm+NoN6gg5/C7+8yZ+/Qnc0vS\n\tgnt6VJon71Q35rJRvMgrvuqkxOddyp1+8o/99jR8=","Message-ID":"<1aa6c291-80db-4503-ac18-ed758d324727@ideasonboard.com>","Date":"Mon, 14 Jul 2025 12:46:59 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v13 00/12] Add global configuration file","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20250711201232.129264-1-mzamazal@redhat.com>\n\t<175248732782.50296.11825354647230209710@ping.linuxembedded.co.uk>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<175248732782.50296.11825354647230209710@ping.linuxembedded.co.uk>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":34882,"web_url":"https://patchwork.libcamera.org/comment/34882/","msgid":"<20250714110305.GC8243@pendragon.ideasonboard.com>","date":"2025-07-14T11:03:05","subject":"Re: [PATCH v13 00/12] Add global configuration file","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Jul 14, 2025 at 12:46:59PM +0200, Barnabás Pőcze wrote:\n> 2025. 07. 14. 12:02 keltezéssel, Kieran Bingham írta:\n> > Hi Milan,\n> > \n> > I'm not sure where - but it seems this is breaking CI on the virtual or\n> > vimc cameras ?\n> > \n> > 6/80 libcamera:camera / camera_reconfigure                      FAIL\n> > 0.97s   (exit status 255 or signal 127 SIGinvalid)\n> > \n> > \n> > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/80404217\n> > \n> > Could you run the unit tests locally and/or check the CI results please?\n> \n> Now the `LIBCAMERA_IPA_FORCE_ISOLATION` env var is checked during construction, so\n> it has to be set before a `CameraManager` is constructed.\n> \n> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\n> index fe13d6acf..6fb44989d 100644\n> --- a/test/libtest/camera_test.cpp\n> +++ b/test/libtest/camera_test.cpp\n> @@ -15,11 +15,11 @@ using namespace std;\n>   \n>   CameraTest::CameraTest(const char *name, bool isolate)\n>   {\n> -       cm_ = new CameraManager();\n> -\n>          if (isolate)\n>                  setenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"1\", 1);\n>   \n> +       cm_ = new CameraManager();\n> +\n>          if (cm_->start()) {\n>                  cerr << \"Failed to start camera manager\" << endl;\n>                  status_ = TestFail;\n> \n\nThat looks like a worthy change on its own. Could you please send a\npatch ?\n\n> > Quoting Milan Zamazal (2025-07-11 21:12:19)\n> >> This patch series introduces global configuration file for libcamera, to\n> >> provide runtime configuration means other than environment variables.\n> >> Instead of, or in addition to, the growing list of configuration\n> >> environment variables, the whole configuration can be specified in a\n> >> single configuration file.  This is both simpler and more flexible.\n> >>\n> >> This is not a replacement for specific configuration files already\n> >> present in libcamera, with the exception of rpi configuration file (see\n> >> “Look up rpi configuration in the configuration file” patch).\n> >>\n> >> The patches implement what is needed to introduce a configuration file\n> >> that can handle the current environment variables and software ISP\n> >> TODOs.  They demonstrate how to deal with the key points that must be\n> >> considered.  Logging is omitted from the configuration file for\n> >> technical reasons.  See commit messages for more details.\n> >>\n> >> The configuration file is a YAML file.  It is looked up in user’s home\n> >> directory or, if not present, in system-wide libcamera directories.\n> >> Both the directories and file name of the configuration file can be\n> >> overridden using newly introduced environment variables.\n> >>\n> >> The current configuration environment variables are still supported and\n> >> take precedence, if defined, over the corresponding entries in the YAML\n> >> file.\n> >>\n> >> This patch series is not exhaustive, there can be future enhancements,\n> >> most notably configuration file validation to avoid confusions caused by\n> >> typos etc.\n> >>\n> >> Not everything has been tested because some of the patches are related\n> >> to specific hardware.\n> >>\n> >> Changes in v13:\n> >> - If LIBCAMERA_CONFIG_NAME is defined but empty, no configuration is\n> >>    loaded.\n> >> - Standard user configuration directory has no longer precedence over\n> >>    LIBCAMERA_CONFIG_DIR.\n> >> - Improvements to the rpi code suggested by Barnabás.\n> >> - Documentation fixes suggested by Barnabás.\n> >> - Make sure yamlConfiguration_ is initialized.\n> >>\n> >> Changes in v12:\n> >> - The commit message of \"Make GlobalConfiguration instance\" updated\n> >>    according to the recent discussions.\n> >> - Use initializer_list rather than a string with separators for\n> >>    GlobalConfiguration option path arguments.\n> >> - char *const qualifiers dropped.\n> >> - rpi can have separate configurations for different targets.\n> >> - GlobalConfiguration::option template is not type limited anymore.\n> >> - utils::join used instead of manual string concatenation.\n> >> - envListOption and listOption return std::optional now.\n> >> - Configuration corresponding to LIBCAMERA_*_TUNING_FILE dropped.\n> >> - Isolation configuration stored to IPAManager to avoid passing the\n> >>    whole configuraton to isSignatureValid.\n> >> - Similarly to paths in IPAProxy.\n> >> - `delimiter' argument added to GlobalConfiguration::envListOption and\n> >>    used for LIBCAMERA_PIPELINES_MATCH_LIST processing.\n> >> - Configuration no longer looked up in /etc/libcamera and additionally\n> >>    looked up in LIBCAMERA_DATA_DIR.\n> >> - Cosmetic changes suggested by Barnabás.\n> >>\n> >> Changes in v11:\n> >> - global_configuration.cpp moved out of base and yaml_parser.cpp left in\n> >>    its original place.\n> >> - Configuration initialized as empty if there is no configuration file,\n> >>    preventing a segfault on later access.\n> >> - Cosmetic changes suggested by Laurent.\n> >> - GlobalConfiguration::get() removed, *yamlConfiguration_ used directly.\n> >> - Failing to read an existent configuration file is an error, rather\n> >>    than warning, now.  (It should be also fatal, but how to propagate it?)\n> >> - Slash is used instead of dot to separate configuration names.\n> >> - rpi configuration read is in the global configuration directly (unless\n> >>    overridden by LIBCAMERA_RPI_CONFIG_FILE) now.\n> >>\n> >> Changes in v10:\n> >> - Minor improvements suggested by Barnabás.\n> >>\n> >> Changes in v9:\n> >> - The configuration instance is now stored in CameraManager and accessed\n> >>    from there rather than being a separate singleton wrapped by global\n> >>    accessors.  This solves the ugly problem of delayed initialization but\n> >>    I don’t like anything else about it.  I played a bit with the idea of\n> >>    attaching it to Logger instead, see the commit message of patch 03 for\n> >>    some discussion, but stayed with the CameraManager proposal\n> >>    eventually.\n> >> - I’ve given up on the logging configuration now when the configuration\n> >>    is stored in CameraManager and removed the corresponding patches.  I\n> >>    think it’s possible to add it later, but for now, it’s already\n> >>    complicated enough.\n> >> - Not much tested, let’s see first if the current implementation gets in\n> >>    an acceptable direction.\n> >>\n> >> Changes in v8:\n> >> - Rebased on current master.\n> >> - Anniversary edition: 400 days since v1 posted. ;-)\n> >>\n> >> Changes in v7:\n> >> - Rebased on current master.\n> >> - Tuning file path configuration updated for recent changes.\n> >>    A significant change is that the tuning file configuration is no\n> >>    longer sensor dependent as there is apparently no access to the sensor\n> >>    info in the IPA proxy.\n> >> - Minor improvements of some commit messages.\n> >>\n> >> Changes in v6:\n> >> - Rebased on master.\n> >> - File names from file header descriptions removed.\n> >> - Indentation fix in moved code as requested by checkstyle.py.\n> >> - Unneeded const_cast's removed.\n> >> - Using GlobalConfiguration namespace rather than a class.\n> >> - Path configuration options are defined as sequences in YAML.\n> >> - A patch introducing LIBCAMERA_CONFIG_NAME added.\n> >> - A patch introducing LIBCAMERA_CONFIG_DIR added.\n> >> - Miscellaneous minor code changes suggested by Barnabás.\n> >>\n> >> Changes in v5:\n> >> - A pointer is used to store the global configuration singleton rather\n> >>    than a static variable.  This makes the things more robust and fixes\n> >>    the problem with re-entrancy on logging and a failing\n> >>    camera_reconfigure test.\n> >> - In relation to the change above, a new initialization method\n> >>    GlobalConfiguration::initialize() was introduced that replaces the\n> >>    initialization calls in CameraManager and IPAManager.\n> >> - Logging YAML errors when reading the configuration was also fixed.\n> >> - Global configuration is placed to base directly, without an\n> >>    intermediate patch.\n> >> - An `optional' value comparison simplified.\n> >> - A temporary typo in a comment fixed.\n> >> - Unused stdint.h include removed.\n> >>\n> >> Changes in v4:\n> >> - Rebased on current master.\n> >> - Configuration option for LIBCAMERA_IPA_PROXY_PATH added.\n> >> - Added a patch to include stdlib.h instead of cstdlib in yaml_parser.cpp.\n> >>\n> >> Changes in v3:\n> >> - Added a configuration item for the newly introduced\n> >>    LIBCAMERA_PIPELINES_MATCH_LIST variable.\n> >> - A minor indentation fix.\n> >> - Fixed `pipelines.' x `pipeline.' configuration item naming mismatch.\n> >> - Tuning files are looked up now by particular cameras attached rather than\n> >>    being specified for the whole pipeline.\n> >> - Helpers use std::string& instead of char* for confPath arguments.\n> >> - Protection against returning YamlObject::empty as a regular value (the\n> >>    problem has been probably exposed by addition of\n> >>    LIBCAMERA_PIPELINES_MATCH_LIST).\n> >>\n> >> Changes in v2:\n> >> - Rebased on master.\n> >> - Various cleanups, documentation improvements and minor fixes.\n> >> - Configuration option for LIBCAMERA_RPI_TUNING_FILE added (Naush).\n> >> - Two more patches for software ISP configuration added.\n> >>\n> >> Milan Zamazal (12):\n> >>    config: Introduce global runtime configuration\n> >>    config: Make GlobalConfiguration instance\n> >>    config: Add configuration retrieval helpers\n> >>    config: Look up rpi configuration in the configuration file\n> >>    config: Look up IPA configurables in configuration file\n> >>    config: Look up pipelines match list in configuration file\n> >>    config: Allow enabling software ISP in runtime\n> >>    config: Add global configuration file documentation\n> >>    libcamera: software_isp: Make input buffer copying configurable\n> >>    libcamera: software_isp: Make measurement configurable\n> >>    config: Make configuration file configurable\n> >>    config: Make configuration directories configurable\n> >>\n> >>   Documentation/documentation-contents.rst      |   2 +-\n> >>   Documentation/index.rst                       |   2 +-\n> >>   Documentation/meson.build                     |   2 +-\n> >>   ...ariables.rst => runtime_configuration.rst} | 129 ++++++++-\n> >>   include/libcamera/internal/camera_manager.h   |   8 +\n> >>   .../libcamera/internal/global_configuration.h |  62 +++++\n> >>   include/libcamera/internal/ipa_manager.h      |   7 +-\n> >>   include/libcamera/internal/ipa_proxy.h        |   8 +-\n> >>   include/libcamera/internal/meson.build        |   1 +\n> >>   src/libcamera/camera_manager.cpp              |  20 +-\n> >>   src/libcamera/global_configuration.cpp        | 259 ++++++++++++++++++\n> >>   src/libcamera/ipa_manager.cpp                 |  39 ++-\n> >>   src/libcamera/ipa_proxy.cpp                   |  51 ++--\n> >>   src/libcamera/meson.build                     |   1 +\n> >>   .../pipeline/rpi/common/pipeline_base.cpp     |  62 +++--\n> >>   .../pipeline/rpi/common/pipeline_base.h       |   3 +-\n> >>   src/libcamera/pipeline/rpi/pisp/pisp.cpp      |  26 +-\n> >>   src/libcamera/pipeline/rpi/vc4/vc4.cpp        |  26 +-\n> >>   src/libcamera/pipeline/simple/simple.cpp      |  13 +\n> >>   src/libcamera/software_isp/TODO               |  36 ---\n> >>   src/libcamera/software_isp/debayer_cpu.cpp    |  32 ++-\n> >>   src/libcamera/software_isp/debayer_cpu.h      |  10 +-\n> >>   src/libcamera/software_isp/software_isp.cpp   |   3 +-\n> >>   .../module_ipa_proxy.cpp.tmpl                 |   4 +-\n> >>   .../module_ipa_proxy.h.tmpl                   |   2 +-\n> >>   25 files changed, 633 insertions(+), 175 deletions(-)\n> >>   rename Documentation/{environment_variables.rst => runtime_configuration.rst} (59%)\n> >>   create mode 100644 include/libcamera/internal/global_configuration.h\n> >>   create mode 100644 src/libcamera/global_configuration.cpp","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 1EDBDC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Jul 2025 11:03:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 44AD068F3D;\n\tMon, 14 Jul 2025 13:03:38 +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 D43986186C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Jul 2025 13:03:36 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id E82ED1127; \n\tMon, 14 Jul 2025 13:03:04 +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=\"E27+0H1y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1752490985;\n\tbh=O8BSpLBMhr3BrVVXtoP2QtETjIBNouhWDT+i6ibb0eY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=E27+0H1yjNqYYjep89KF6QU3E2oMObox6ebcYQssaz1O9YwpmEKlufhiQiSzoqFNZ\n\tE5TjR2iS+1msiH1Gv7zaSrpfo38b2o76yET1R3Zndf9wdVI3MhBeX8QewUtu7B9QvP\n\tAaXsipEkDfhnd9JwRg5c02v63tP1V7Rfso2tWK/Q=","Date":"Mon, 14 Jul 2025 14:03:05 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v13 00/12] Add global configuration file","Message-ID":"<20250714110305.GC8243@pendragon.ideasonboard.com>","References":"<20250711201232.129264-1-mzamazal@redhat.com>\n\t<175248732782.50296.11825354647230209710@ping.linuxembedded.co.uk>\n\t<1aa6c291-80db-4503-ac18-ed758d324727@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<1aa6c291-80db-4503-ac18-ed758d324727@ideasonboard.com>","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":34894,"web_url":"https://patchwork.libcamera.org/comment/34894/","msgid":"<854ived4qt.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-07-14T18:08:58","subject":"Re: [PATCH v13 00/12] Add global configuration file","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Barnabás,\n\nthank you for the fix, it passes now:\nhttps://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1470485\n\nBarnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> Hi\n>\n> 2025. 07. 14. 12:02 keltezéssel, Kieran Bingham írta:\n>> Hi Milan,\n>> I'm not sure where - but it seems this is breaking CI on the virtual or\n>> vimc cameras ?\n>> 6/80 libcamera:camera / camera_reconfigure                      FAIL\n>> 0.97s   (exit status 255 or signal 127 SIGinvalid)\n>> https://gitlab.freedesktop.org/camera/libcamera/-/jobs/80404217\n>> Could you run the unit tests locally and/or check the CI results please?\n>\n> Now the `LIBCAMERA_IPA_FORCE_ISOLATION` env var is checked during construction, so\n> it has to be set before a `CameraManager` is constructed.\n>\n> diff --git a/test/libtest/camera_test.cpp b/test/libtest/camera_test.cpp\n> index fe13d6acf..6fb44989d 100644\n> --- a/test/libtest/camera_test.cpp\n> +++ b/test/libtest/camera_test.cpp\n> @@ -15,11 +15,11 @@ using namespace std;\n>    CameraTest::CameraTest(const char *name, bool isolate)\n>  {\n> -       cm_ = new CameraManager();\n> -\n>         if (isolate)\n>                 setenv(\"LIBCAMERA_IPA_FORCE_ISOLATION\", \"1\", 1);\n>  +       cm_ = new CameraManager();\n> +\n>         if (cm_->start()) {\n>                 cerr << \"Failed to start camera manager\" << endl;\n>                 status_ = TestFail;\n>\n>\n> Regards,\n> Barnabás Pőcze\n>\n>> --\n>> Kieran\n>> Quoting Milan Zamazal (2025-07-11 21:12:19)\n>>> This patch series introduces global configuration file for libcamera, to\n>>> provide runtime configuration means other than environment variables.\n>>> Instead of, or in addition to, the growing list of configuration\n>>> environment variables, the whole configuration can be specified in a\n>>> single configuration file.  This is both simpler and more flexible.\n>>>\n>>> This is not a replacement for specific configuration files already\n>>> present in libcamera, with the exception of rpi configuration file (see\n>>> “Look up rpi configuration in the configuration file” patch).\n>>>\n>>> The patches implement what is needed to introduce a configuration file\n>>> that can handle the current environment variables and software ISP\n>>> TODOs.  They demonstrate how to deal with the key points that must be\n>>> considered.  Logging is omitted from the configuration file for\n>>> technical reasons.  See commit messages for more details.\n>>>\n>>> The configuration file is a YAML file.  It is looked up in user’s home\n>>> directory or, if not present, in system-wide libcamera directories.\n>>> Both the directories and file name of the configuration file can be\n>>> overridden using newly introduced environment variables.\n>>>\n>>> The current configuration environment variables are still supported and\n>>> take precedence, if defined, over the corresponding entries in the YAML\n>>> file.\n>>>\n>>> This patch series is not exhaustive, there can be future enhancements,\n>>> most notably configuration file validation to avoid confusions caused by\n>>> typos etc.\n>>>\n>>> Not everything has been tested because some of the patches are related\n>>> to specific hardware.\n>>>\n>>> Changes in v13:\n>>> - If LIBCAMERA_CONFIG_NAME is defined but empty, no configuration is\n>>>    loaded.\n>>> - Standard user configuration directory has no longer precedence over\n>>>    LIBCAMERA_CONFIG_DIR.\n>>> - Improvements to the rpi code suggested by Barnabás.\n>>> - Documentation fixes suggested by Barnabás.\n>>> - Make sure yamlConfiguration_ is initialized.\n>>>\n>>> Changes in v12:\n>>> - The commit message of \"Make GlobalConfiguration instance\" updated\n>>>    according to the recent discussions.\n>>> - Use initializer_list rather than a string with separators for\n>>>    GlobalConfiguration option path arguments.\n>>> - char *const qualifiers dropped.\n>>> - rpi can have separate configurations for different targets.\n>>> - GlobalConfiguration::option template is not type limited anymore.\n>>> - utils::join used instead of manual string concatenation.\n>>> - envListOption and listOption return std::optional now.\n>>> - Configuration corresponding to LIBCAMERA_*_TUNING_FILE dropped.\n>>> - Isolation configuration stored to IPAManager to avoid passing the\n>>>    whole configuraton to isSignatureValid.\n>>> - Similarly to paths in IPAProxy.\n>>> - `delimiter' argument added to GlobalConfiguration::envListOption and\n>>>    used for LIBCAMERA_PIPELINES_MATCH_LIST processing.\n>>> - Configuration no longer looked up in /etc/libcamera and additionally\n>>>    looked up in LIBCAMERA_DATA_DIR.\n>>> - Cosmetic changes suggested by Barnabás.\n>>>\n>>> Changes in v11:\n>>> - global_configuration.cpp moved out of base and yaml_parser.cpp left in\n>>>    its original place.\n>>> - Configuration initialized as empty if there is no configuration file,\n>>>    preventing a segfault on later access.\n>>> - Cosmetic changes suggested by Laurent.\n>>> - GlobalConfiguration::get() removed, *yamlConfiguration_ used directly.\n>>> - Failing to read an existent configuration file is an error, rather\n>>>    than warning, now.  (It should be also fatal, but how to propagate it?)\n>>> - Slash is used instead of dot to separate configuration names.\n>>> - rpi configuration read is in the global configuration directly (unless\n>>>    overridden by LIBCAMERA_RPI_CONFIG_FILE) now.\n>>>\n>>> Changes in v10:\n>>> - Minor improvements suggested by Barnabás.\n>>>\n>>> Changes in v9:\n>>> - The configuration instance is now stored in CameraManager and accessed\n>>>    from there rather than being a separate singleton wrapped by global\n>>>    accessors.  This solves the ugly problem of delayed initialization but\n>>>    I don’t like anything else about it.  I played a bit with the idea of\n>>>    attaching it to Logger instead, see the commit message of patch 03 for\n>>>    some discussion, but stayed with the CameraManager proposal\n>>>    eventually.\n>>> - I’ve given up on the logging configuration now when the configuration\n>>>    is stored in CameraManager and removed the corresponding patches.  I\n>>>    think it’s possible to add it later, but for now, it’s already\n>>>    complicated enough.\n>>> - Not much tested, let’s see first if the current implementation gets in\n>>>    an acceptable direction.\n>>>\n>>> Changes in v8:\n>>> - Rebased on current master.\n>>> - Anniversary edition: 400 days since v1 posted. ;-)\n>>>\n>>> Changes in v7:\n>>> - Rebased on current master.\n>>> - Tuning file path configuration updated for recent changes.\n>>>    A significant change is that the tuning file configuration is no\n>>>    longer sensor dependent as there is apparently no access to the sensor\n>>>    info in the IPA proxy.\n>>> - Minor improvements of some commit messages.\n>>>\n>>> Changes in v6:\n>>> - Rebased on master.\n>>> - File names from file header descriptions removed.\n>>> - Indentation fix in moved code as requested by checkstyle.py.\n>>> - Unneeded const_cast's removed.\n>>> - Using GlobalConfiguration namespace rather than a class.\n>>> - Path configuration options are defined as sequences in YAML.\n>>> - A patch introducing LIBCAMERA_CONFIG_NAME added.\n>>> - A patch introducing LIBCAMERA_CONFIG_DIR added.\n>>> - Miscellaneous minor code changes suggested by Barnabás.\n>>>\n>>> Changes in v5:\n>>> - A pointer is used to store the global configuration singleton rather\n>>>    than a static variable.  This makes the things more robust and fixes\n>>>    the problem with re-entrancy on logging and a failing\n>>>    camera_reconfigure test.\n>>> - In relation to the change above, a new initialization method\n>>>    GlobalConfiguration::initialize() was introduced that replaces the\n>>>    initialization calls in CameraManager and IPAManager.\n>>> - Logging YAML errors when reading the configuration was also fixed.\n>>> - Global configuration is placed to base directly, without an\n>>>    intermediate patch.\n>>> - An `optional' value comparison simplified.\n>>> - A temporary typo in a comment fixed.\n>>> - Unused stdint.h include removed.\n>>>\n>>> Changes in v4:\n>>> - Rebased on current master.\n>>> - Configuration option for LIBCAMERA_IPA_PROXY_PATH added.\n>>> - Added a patch to include stdlib.h instead of cstdlib in yaml_parser.cpp.\n>>>\n>>> Changes in v3:\n>>> - Added a configuration item for the newly introduced\n>>>    LIBCAMERA_PIPELINES_MATCH_LIST variable.\n>>> - A minor indentation fix.\n>>> - Fixed `pipelines.' x `pipeline.' configuration item naming mismatch.\n>>> - Tuning files are looked up now by particular cameras attached rather than\n>>>    being specified for the whole pipeline.\n>>> - Helpers use std::string& instead of char* for confPath arguments.\n>>> - Protection against returning YamlObject::empty as a regular value (the\n>>>    problem has been probably exposed by addition of\n>>>    LIBCAMERA_PIPELINES_MATCH_LIST).\n>>>\n>>> Changes in v2:\n>>> - Rebased on master.\n>>> - Various cleanups, documentation improvements and minor fixes.\n>>> - Configuration option for LIBCAMERA_RPI_TUNING_FILE added (Naush).\n>>> - Two more patches for software ISP configuration added.\n>>>\n>>> Milan Zamazal (12):\n>>>    config: Introduce global runtime configuration\n>>>    config: Make GlobalConfiguration instance\n>>>    config: Add configuration retrieval helpers\n>>>    config: Look up rpi configuration in the configuration file\n>>>    config: Look up IPA configurables in configuration file\n>>>    config: Look up pipelines match list in configuration file\n>>>    config: Allow enabling software ISP in runtime\n>>>    config: Add global configuration file documentation\n>>>    libcamera: software_isp: Make input buffer copying configurable\n>>>    libcamera: software_isp: Make measurement configurable\n>>>    config: Make configuration file configurable\n>>>    config: Make configuration directories configurable\n>>>\n>>>   Documentation/documentation-contents.rst      |   2 +-\n>>>   Documentation/index.rst                       |   2 +-\n>>>   Documentation/meson.build                     |   2 +-\n>>>   ...ariables.rst => runtime_configuration.rst} | 129 ++++++++-\n>>>   include/libcamera/internal/camera_manager.h   |   8 +\n>>>   .../libcamera/internal/global_configuration.h |  62 +++++\n>>>   include/libcamera/internal/ipa_manager.h      |   7 +-\n>>>   include/libcamera/internal/ipa_proxy.h        |   8 +-\n>>>   include/libcamera/internal/meson.build        |   1 +\n>>>   src/libcamera/camera_manager.cpp              |  20 +-\n>>>   src/libcamera/global_configuration.cpp        | 259 ++++++++++++++++++\n>>>   src/libcamera/ipa_manager.cpp                 |  39 ++-\n>>>   src/libcamera/ipa_proxy.cpp                   |  51 ++--\n>>>   src/libcamera/meson.build                     |   1 +\n>>>   .../pipeline/rpi/common/pipeline_base.cpp     |  62 +++--\n>>>   .../pipeline/rpi/common/pipeline_base.h       |   3 +-\n>>>   src/libcamera/pipeline/rpi/pisp/pisp.cpp      |  26 +-\n>>>   src/libcamera/pipeline/rpi/vc4/vc4.cpp        |  26 +-\n>>>   src/libcamera/pipeline/simple/simple.cpp      |  13 +\n>>>   src/libcamera/software_isp/TODO               |  36 ---\n>>>   src/libcamera/software_isp/debayer_cpu.cpp    |  32 ++-\n>>>   src/libcamera/software_isp/debayer_cpu.h      |  10 +-\n>>>   src/libcamera/software_isp/software_isp.cpp   |   3 +-\n>>>   .../module_ipa_proxy.cpp.tmpl                 |   4 +-\n>>>   .../module_ipa_proxy.h.tmpl                   |   2 +-\n>>>   25 files changed, 633 insertions(+), 175 deletions(-)\n>>>   rename Documentation/{environment_variables.rst => runtime_configuration.rst} (59%)\n>>>   create mode 100644 include/libcamera/internal/global_configuration.h\n>>>   create mode 100644 src/libcamera/global_configuration.cpp\n>>>\n>>> -- 2.50.1\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 5B9B4C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Jul 2025 18:09:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4FEA468F4C;\n\tMon, 14 Jul 2025 20:09:08 +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 9F97D68F3F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Jul 2025 20:09:06 +0200 (CEST)","from mail-ej1-f70.google.com (mail-ej1-f70.google.com\n\t[209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-678-J52XWeInMSenaQDzV3ZhGQ-1; Mon, 14 Jul 2025 14:09:02 -0400","by mail-ej1-f70.google.com with SMTP id\n\ta640c23a62f3a-ae3c8477f1fso433669566b.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Jul 2025 11:09:01 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-ae6e826461esm859877166b.100.2025.07.14.11.08.58\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 14 Jul 2025 11:08:59 -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=\"X3+JKbxC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1752516545;\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\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=INQyAIfu5mRrtwCPh3NW/9TNdXpdysRRY0lw45gw7UI=;\n\tb=X3+JKbxCyr9WGPVcqYq5RoY/tmQXjm6FiYtT5qXDEP4pXJr/0rmHjBwazxMC6MvNIsawWC\n\tG8EpgXHyhl8pFaM++SPAyBZn+EealAW/OCT7wuGW8yPEAGI8QByOlmiFCZOW1YOg181fjV\n\tKedfv5GMMm4V/wlKO3f+cFpm9qjYbSA=","X-MC-Unique":"J52XWeInMSenaQDzV3ZhGQ-1","X-Mimecast-MFC-AGG-ID":"J52XWeInMSenaQDzV3ZhGQ_1752516541","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1752516540; x=1753121340;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=4+t1wczEYq1kCrgJGyGcXnOZObxRRFQ52lC5RNHzpZU=;\n\tb=cQRRGTfIAnrbDy0JhPdZGSmXE3AIIHItW3aGjrqAeQadeqUjEUGDyxhCUXn4ZcJ1Yv\n\t86fgWSuAe33tx5dmtqGzoKQe5dLoODYp67NZLgp9hNg1a8CTaWHIvychkMw5g9CMKhR6\n\tpuKrM0lWhdh5DTqbykuF6nUZ5rzAY/LlH3lJaKilUXmZvlBeD66ChKZa8RvmRvCGO9nL\n\tuM4kilG7VJo9XIK05YqDPQOTku7/8z4CQuV+42HvMfUQjnjPFVGjhkP/cgq4W3QNJwpc\n\tCprBDlG96xX+35v9GYlDWfji6o1OeS3BNFY0TWb4LL5egnjDUj6+22VsCjcaLZWUzOHo\n\t1uCw==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCU8qXUll2a9nTaLNxEiBo3Gs5ymCY5wRd5FnO7PmSnLj4s4RBms+i0fCHUKYqEE36rBlME9050cx3Jk2fVUMks=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YwHHbUALCNRRdeMCP++0LWqkoe8skbtNAGtzYE6Dy1YMG1pjntU\n\tOf/+kM/u+q8qKRKOezkbsXnyiRRb9nYj1+f2pekmjgOdXVg2la6NUOfL0pCTeFzNAewON66nqA9\n\tPc66DDnicAPrgAhyyIWmCG19Aa8MzTmvBdHvf5jX4H/bpSijnZVkWSbK2NM8BOuKI49oUM76ymx\n\tHREac8Xyc=","X-Gm-Gg":"ASbGncs1j/8Yzk4vgi1KwI5/0ykpo6ht5i6wv0EpEu/Yr9mG19NDa7fNkH7IXCQYALr\n\tmXkZcCt+0s9s3pryoBvZyV6P2FNH5bIJdolD5swnbLrlgWzn1fLaU3zI7zAv3OasyJ+nhzi6cy+\n\tvoDhfnZOwq5WDQ9jWgcWvHMqJA31HsUysBmz0Lifv2COR3PGiTduF/UfD1uBvRcEkVNjU8V/H2a\n\th53XtFG47JmfTzEnB0pewCdQbt+qE0cnAdIhaj0QN+0+I45Xk4kHpRDOa65jzJjmZ3exVw7Q7Pu\n\tYtITXPUePuL6QiHWiDfc75cRj/aDljIzFrxs74aLFCX4zDPmZfGw0JAMtU9jFcna5SbEfcoOMW6\n\tr498P1FAfR8DzZRN2","X-Received":["by 2002:a17:907:9707:b0:ad5:42bd:dfab with SMTP id\n\ta640c23a62f3a-ae70125f342mr1232792766b.30.1752516540236; \n\tMon, 14 Jul 2025 11:09:00 -0700 (PDT)","by 2002:a17:907:9707:b0:ad5:42bd:dfab with SMTP id\n\ta640c23a62f3a-ae70125f342mr1232790066b.30.1752516539720; \n\tMon, 14 Jul 2025 11:08:59 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IH/cRy+lUbrcy+U+kyydgU6d/XGSL0JPzCI9hPTEoirOaAMTZv3ucIBkCZsnhsHWTsK+EsSaw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v13 00/12] Add global configuration file","In-Reply-To":"<1aa6c291-80db-4503-ac18-ed758d324727@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Mon,\n\t14 Jul 2025  12:46:59 +0200\")","References":"<20250711201232.129264-1-mzamazal@redhat.com>\n\t<175248732782.50296.11825354647230209710@ping.linuxembedded.co.uk>\n\t<1aa6c291-80db-4503-ac18-ed758d324727@ideasonboard.com>","Date":"Mon, 14 Jul 2025 20:08:58 +0200","Message-ID":"<854ived4qt.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"VUdmJvH1nXaOb4cf3w6HyBt0PUbwoXAlJ54GppNZL18_1752516541","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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>"}}]