{"id":10458,"url":"https://patchwork.libcamera.org/api/1.1/patches/10458/?format=json","web_url":"https://patchwork.libcamera.org/patch/10458/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201120155234.29903-1-sebastian.fricke.linux@gmail.com>","date":"2020-11-20T15:52:34","name":"[libcamera-devel,v4] Documentation: Add descriptions for env. variables","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"d452ca74e136dacb057e325a890105c2b69f1086","submitter":{"id":73,"url":"https://patchwork.libcamera.org/api/1.1/people/73/?format=json","name":"Sebastian Fricke","email":"sebastian.fricke.linux@gmail.com"},"delegate":{"id":14,"url":"https://patchwork.libcamera.org/api/1.1/users/14/?format=json","username":"pinchartl","first_name":"Laurent","last_name":"Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/10458/mbox/","series":[{"id":1474,"url":"https://patchwork.libcamera.org/api/1.1/series/1474/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1474","date":"2020-11-20T15:52:34","name":"[libcamera-devel,v4] Documentation: Add descriptions for env. variables","version":4,"mbox":"https://patchwork.libcamera.org/series/1474/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10458/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10458/checks/","tags":{},"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 4666FBE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Nov 2020 15:52:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BF2E062221;\n\tFri, 20 Nov 2020 16:52:41 +0100 (CET)","from mail-ed1-x532.google.com (mail-ed1-x532.google.com\n\t[IPv6:2a00:1450:4864:20::532])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC28C6220D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Nov 2020 16:52:39 +0100 (CET)","by mail-ed1-x532.google.com with SMTP id q3so9976591edr.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Nov 2020 07:52:39 -0800 (PST)","from basti.fritz.box\n\t(p200300d1ff28820039a2a82822a82fc5.dip0.t-ipconnect.de.\n\t[2003:d1:ff28:8200:39a2:a828:22a8:2fc5])\n\tby smtp.gmail.com with ESMTPSA id\n\tw2sm1248704ejc.109.2020.11.20.07.52.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 20 Nov 2020 07:52:38 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"QsyA2KMa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=O58F1/mWbcPB6PMXrya+HRm14qGETf9BWPn8jEr/nmA=;\n\tb=QsyA2KMacwB7NG+99zEuLqfOkiZnSCDuorZ1hhqNi/oTJ8m8T0NrJDEXpy6hi8pKHM\n\tcWgckXw/G4L77H5BX7PHy8k71vXfY9iUdJe9RE/fFsGGp0RDD4IIh8r3+2SEWBB53n7v\n\tVxsyk8Cp+Kw2IGlQbeK1IoCugGJQt5oSRKyP1zLwMo3sUmmlmWpgHx9FAd2gWe40Mh0D\n\tboM0R0WUIuULHkDK3dVoArgowVkHaWQ+R0xQ41iF5v3JEHkaNJA7L/boyqFNwHDqrExe\n\tPnyIpeNnwm8EzG6lXUCI1nB6l4sxkJ9K93fh+a3KoKfQHJtC3daEqQYa+ODUaPXz1uce\n\tsEGQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=O58F1/mWbcPB6PMXrya+HRm14qGETf9BWPn8jEr/nmA=;\n\tb=bYKmXru4Np8PxPkEAvfG0scRGm5IKFPoa2ge44nl5IF6JCz4FcbFBziRKlVFS6hDal\n\tFaHoMgKcFYJ1Ltns+KcDmHoCwSolNv//s6I5cXhiGZpooF7oSsuyL/EP6EEYvbixkyt/\n\tT+B82MRtydAzuxUlT9jwQRbk0VrkxDD4FjpdKwUkoUHQ9NuGz7X8LpONZBOZBviSGsNy\n\tnv+zreBfkDS41bgk6pCQ11xL4pxLJK+PFSh/KbAcE0ZKI+GCsVgPVieN1H8rD3LqXo5X\n\tta7qxELtzYLsBzxiFRKrLmU4X5I3YjmRJr1fAl2d+osiLxVcmFacXH8GeEvrwLytw3mg\n\tNt8w==","X-Gm-Message-State":"AOAM532gN6XOKAImJ9mn484nDckOtb3bk6XS9CW64LJ8wzRYVJvW1ds7\n\t8Dvbmhxt6TczQqEZPnBSwyAled3jZYs=","X-Google-Smtp-Source":"ABdhPJwQNFamLGiDdg+2uMAYGittqXWuDxkAvxHj0Bkga2ylQinL8La8mQicWLbUkY0OPC5KvYI7AA==","X-Received":"by 2002:a50:a105:: with SMTP id 5mr35035441edj.165.1605887559078;\n\tFri, 20 Nov 2020 07:52:39 -0800 (PST)","From":"Sebastian Fricke <sebastian.fricke.linux@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 20 Nov 2020 16:52:34 +0100","Message-Id":"<20201120155234.29903-1-sebastian.fricke.linux@gmail.com>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4] Documentation: Add descriptions for\n\tenv. variables","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Describe the environment variables used in libcamera, excluded\nvariables are `LIBCAMERA_IPA_FORCE_C_API` and `LIBCAMERA_IPA_PROXY_PATH`,\nthe former because it is likely to be removed and the later because\nit has no current use-case.\n\nAdd a brief explanation for the IPA configuration and IPA modules.\nList all the available Log levels and categories and add a short guide\non how to use them for debugging.\n\nSigned-off-by: Sebastian Fricke <sebastian.fricke.linux@gmail.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n---\n\nChanges since V3:\n* Rework the LIBCAMERA_LOG_LEVELS explanation\n* improve wording at various places\n* Move the changelog out of the commit description into the email\n\nChanges since V2:\n* replace bullet point list with definition list\n* Remove the category list as it is too difficult to maintain, instead\n  explain how the categories are set with the LOG_DECLARE_CATEGORY &\n  LOG_DEFINE_CATEGORY macros\n* Remove the short summary for the IPA module, as it can be misleading\n  and probably not accurate enough\n* Improve the notes for debugging part by linking to a full explanation\n  while extending the description in the documentation as well\n* Add an example for the Log level setting\n* Remove the documentation from guides and add it to the documentation\n  base path\n\nChanges since V1:\n* abandon the usage of tables as they are too clunky and difficult to\nmaintain\n* Fix a wrong example that does not work on most distributions and setups\n* Improve structure of log categories\n\n---\n\n Documentation/environment_variables.rst | 132 ++++++++++++++++++++++++\n Documentation/index.rst                 |   1 +\n Documentation/meson.build               |   1 +\n 3 files changed, 134 insertions(+)\n create mode 100644 Documentation/environment_variables.rst","diff":"diff --git a/Documentation/environment_variables.rst b/Documentation/environment_variables.rst\nnew file mode 100644\nindex 0000000..85346af\n--- /dev/null\n+++ b/Documentation/environment_variables.rst\n@@ -0,0 +1,132 @@\n+Environment variables\n+=====================\n+\n+List of variables\n+-----------------\n+\n+LIBCAMERA_LOG_FILE\n+   The custom destination for log output.\n+\n+   Example value: ``/home/{user}/camera_log.log``\n+\n+LIBCAMERA_LOG_LEVELS\n+   Configure the verbosity of log messages for different categories (`more <#log-levels>`__)\n+\n+   Example value: ``*:DEBUG``\n+\n+LIBCAMERA_IPA_CONFIG_PATH\n+   Define custom search locations for IPA configurations (`more <#ipa-configuration>`__)\n+\n+   Example value: ``/usr/path/one:/tmp/path/two``\n+\n+LIBCAMERA_IPA_MODULE_PATH\n+   Define custom search locations for IPA modules (`more <#ipa-module>`__)\n+\n+   Example value: ``/usr/path/one:/tmp/path/two``\n+\n+Further details\n+---------------\n+\n+Notes about debugging\n+~~~~~~~~~~~~~~~~~~~~~\n+\n+The environment variables `LIBCAMERA_LOG_FILE` and `LIBCAMERA_LOG_LEVELS`\n+are used to modify the destination and verbosity of messages provided by\n+libcamera.\n+\n+The `LIBCAMERA_LOG_LEVELS` variable accepts a comma-separated list of\n+'category:level' pairs.\n+\n+The `level <#log-levels>`__ part is mandatory and can either be\n+specified by name or by numerical index associated with each level.\n+\n+The optional `category <#log-categories>`__ part is a regular\n+expression, which is matched against the categories defined by each\n+file in the source base using the logging infrastructure.\n+\n+For more information refer to the `API-documentation <http://libcamera.org/api-html/log_8h.html#details>`__\n+\n+Examples:\n+\n+Enable full debug output to a separate file, for every `category <#log-categories>`__\n+within a local environment:\n+\n+.. code:: bash\n+\n+        :~$ LIBCAMERA_LOG_FILE='/tmp/example_log.log' \\\n+            LIBCAMERA_LOG_LEVELS=0 \\\n+            cam --list\n+\n+Enable full debug output for the categories Camera & V4L2 within a\n+global environment:\n+\n+.. code:: bash\n+\n+   :~$ export LIBCAMERA_LOG_LEVELS='Camera:DEBUG,V4L2:DEBUG'\n+   :~$ cam --list\n+\n+Log levels\n+~~~~~~~~~~~\n+\n+This is the list of available log levels, notice that all levels below\n+the chosen one are printed, while those above are discarded.\n+\n+-  DEBUG (0)\n+-  INFO (1)\n+-  WARN (2)\n+-  ERROR (3)\n+-  FATAL (4)\n+\n+Example:\n+If you choose WARN (2), you will be able to see WARN (2), ERROR (3) & FATAL (4)\n+but not DEBUG (0) & INFO (1).\n+\n+Log categories\n+~~~~~~~~~~~~~~~\n+\n+Every category represents a specific area of the libcamera codebase,\n+the names can be located within the source code, for example:\n+`src/libcamera/camera_manager.cpp <https://git.libcamera.org/libcamera/libcamera.git/tree/src/libcamera/camera_manager.cpp#n35>`__\n+\n+.. code:: bash\n+\n+   LOG_DEFINE_CATEGORY(Camera)\n+\n+There are 2 available macros used to assign a category name to a part of the\n+libcamera codebase:\n+\n+LOG_DEFINE_CATEGORY\n+        This macro is required, in order to use the `LOGC` macro for a\n+\tparticular category.  It can only be used once for each category.\n+\tIf you want to create log messages within multiple compilation\n+\tunits for the same category utilize the `LOG_DECLARE_CATEGORY` macro,\n+\tin every file except the definition file.\n+LOG_DECLARE_CATEGORY\n+        Used for sharing an already defined category in between multiple\n+\tseparate compilation units.\n+\n+Both macros have to be used within the libcamera namespace of the C++ source\n+code.\n+\n+IPA configuration\n+~~~~~~~~~~~~~~~~~~\n+\n+The format and contents of the configuration file are specific to the\n+IPA (Image Processing Algorithm). It usually contains tuning parameters\n+for the IPA algorithms stored in JSON format.\n+The `LIBCAMERA_IPA_CONFIG_PATH` variable can be used to specify custom\n+storage locations to search for those configuration files.\n+\n+`Examples <https://git.libcamera.org/libcamera/libcamera.git/tree/src/ipa/raspberrypi/data>`__\n+\n+IPA module\n+~~~~~~~~~~~\n+\n+In order to locate the correct IPA module for your hardware, libcamera gathers\n+existing IPA modules from multiple locations. The default locations for this\n+operation are the installed system path (for example on Debian:\n+``/usr/local/x86_64-pc-linux-gnu/libcamera``) and the build directory.\n+With the `LIBCAMERA_IPA_MODULE_PATH`, you can specify a non-default\n+location to search for IPA modules.\n+\n+`Examples for existing IPA modules <https://git.libcamera.org/libcamera/libcamera.git/tree/src/ipa>`__\ndiff --git a/Documentation/index.rst b/Documentation/index.rst\nindex ff697d4..c49db18 100644\n--- a/Documentation/index.rst\n+++ b/Documentation/index.rst\n@@ -17,3 +17,4 @@\n    Application Writer's Guide <guides/application-developer>\n    Pipeline Handler Writer's Guide <guides/pipeline-handler>\n    Tracing guide <guides/tracing>\n+   Environment variables <environment_variables>\ndiff --git a/Documentation/meson.build b/Documentation/meson.build\nindex 26a12fc..8086abf 100644\n--- a/Documentation/meson.build\n+++ b/Documentation/meson.build\n@@ -53,6 +53,7 @@ if sphinx.found()\n         'contributing.rst',\n         'docs.rst',\n         'index.rst',\n+        'environment_variables.rst',\n         'guides/introduction.rst',\n         'guides/application-developer.rst',\n         'guides/pipeline-handler.rst',\n","prefixes":["libcamera-devel","v4"]}