Patch Detail
Show a patch.
GET /api/patches/10336/?format=api
{ "id": 10336, "url": "https://patchwork.libcamera.org/api/patches/10336/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10336/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20201104184848.14235-1-sebastian.fricke.linux@gmail.com>", "date": "2020-11-04T18:48:48", "name": "[libcamera-devel,v3] Documentation: Add descriptions for env. variables", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "207c9b6061ed03b171d9c19f14c5a7f39db6987a", "submitter": { "id": 73, "url": "https://patchwork.libcamera.org/api/people/73/?format=api", "name": "Sebastian Fricke", "email": "sebastian.fricke.linux@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/10336/mbox/", "series": [ { "id": 1446, "url": "https://patchwork.libcamera.org/api/series/1446/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1446", "date": "2020-11-04T18:48:48", "name": "[libcamera-devel,v3] Documentation: Add descriptions for env. variables", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1446/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10336/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10336/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 1139ABE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 4 Nov 2020 18:48:56 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4D5B062C8E;\n\tWed, 4 Nov 2020 19:48:55 +0100 (CET)", "from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C4AC62C74\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 4 Nov 2020 19:48:54 +0100 (CET)", "by mail-wr1-x42f.google.com with SMTP id c17so3829886wrc.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 04 Nov 2020 10:48:54 -0800 (PST)", "from basti.fritz.box\n\t(p200300d1ff00cb008c3fbf8c28455671.dip0.t-ipconnect.de.\n\t[2003:d1:ff00:cb00:8c3f:bf8c:2845:5671])\n\tby smtp.gmail.com with ESMTPSA id\n\tl3sm4266013wmg.32.2020.11.04.10.48.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 04 Nov 2020 10:48:51 -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=\"loiW+Oih\"; 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=e96h3O9ARWVneucbqMgb+tEg2sKJjQkNczYT9NFHSqQ=;\n\tb=loiW+OihnEUA9M5Man8N7gWKtvcY4SuqiOkRgXfd/M4VWxL23bIQIxsub4yA/N5YrJ\n\tB/ktCAXXwdJAjYv8+S0dY3OhN4bjyjsGp2j0+8XbOfrwdNvKwCeLEYTNkfrpz/nYDtVe\n\tsDhsumvUbFNf5LdqCTegnZ9Iynue6lUPyKxjLZA1eq6n/thVmjdQBLCjT+2huHk4iC2g\n\tdLAyeQKSp99KQvGUgrw2Va7cclutLy0mS6UWAbcdYEphiS+IOzJiTL19vV+QvaZi9QzL\n\tplyY+cI30gtRrEUmQdpeuHzEPMqedfD6bWpoeiMhSj4DNvD+qQYpztORVqnsLePwmbMb\n\tSaDA==", "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=e96h3O9ARWVneucbqMgb+tEg2sKJjQkNczYT9NFHSqQ=;\n\tb=XPFJlpfuUP8uw3qJwY1ng6XKwu2E2g2VuhebX+3iDmnGEt4BaebGuN61n6/cbviMK6\n\tmq7dg/CVNswJKiRjZlEwcmpDlPjiW35o5e4d14A8l+kxZD4pkUCbGGlzKFxLwXuwVr6D\n\tEGPwXUMWI9vSPEKlthpLH3uEcognjGSDgujdw/iMvbFKJecm4zelcZVPSXYh8XCZdycp\n\tdRSC3dC9Yo3msPlHfmFCNAxO52RRwFIt+x2M1xUjj584gzyURRw2lvA5K+hS/yVcTmTI\n\tLeHoqco2nu2f9XxlgsWhAFSONBYyIdH8z7wWizzVudLJN3B3w+KIEFBar62zmpeT/xN8\n\ttFbQ==", "X-Gm-Message-State": "AOAM531YtyqZul22yjFdX9hUb2M/bSO4tdIq+HQrNAaUyEnyM6VZHTsR\n\tZhFTJbnzMUg0HpDizLbvDVrDbkVDZQI=", "X-Google-Smtp-Source": "ABdhPJyxYox32RVcYvJtytk4ueSCW2phYhRj8UMooLb7uqdW81ROCWD0iyIVjjYB3g+HDMLGtoBjGw==", "X-Received": "by 2002:a5d:404f:: with SMTP id\n\tw15mr35511440wrp.39.1604515733066; \n\tWed, 04 Nov 2020 10:48:53 -0800 (PST)", "From": "Sebastian Fricke <sebastian.fricke.linux@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 4 Nov 2020 19:48:48 +0100", "Message-Id": "<20201104184848.14235-1-sebastian.fricke.linux@gmail.com>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v3] 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\nfor how to use them for debugging.\n\nSigned-off-by: Sebastian Fricke <sebastian.fricke.linux@gmail.com>\n\n---\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 explaination\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 Documentation/environment_variables.rst | 129 ++++++++++++++++++++++++\n Documentation/index.rst | 1 +\n Documentation/meson.build | 1 +\n 3 files changed, 131 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..a03412b\n--- /dev/null\n+++ b/Documentation/environment_variables.rst\n@@ -0,0 +1,129 @@\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+the libcamera API.\n+\n+The `LIBCAMERA_LOG_LEVELS` variable expects a comma-separated list of\n+'category:level' pairs. The `level <#log-levels>`__ part can either be given\n+as the index or the name in uppercase letters.\n+While `category <#log-categories>`__ should either be the exact name of the\n+category, the '*' wildcard symbol or no value, which targets every category.\n+\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 represent 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 API:\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+\tseparately compiled files.\n+\n+Both macros have to be used within the namespace part of the C++ source code.\n+\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 data that optimize\n+the behavior of the algorithms stored in JSON format. The\n+`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", "v3" ] }