{"id":17699,"url":"https://patchwork.libcamera.org/api/1.1/patches/17699/?format=json","web_url":"https://patchwork.libcamera.org/patch/17699/","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":"<20221027055515.321791-11-nicholas@rothemail.net>","date":"2022-10-27T05:55:15","name":"[libcamera-devel,10/10] android: libcamera: add useful debug prints","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"185764e49888c31ca80c81639201d1ca4c4b549a","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/1.1/people/97/?format=json","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17699/mbox/","series":[{"id":3579,"url":"https://patchwork.libcamera.org/api/1.1/series/3579/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3579","date":"2022-10-27T05:55:08","name":"[libcamera-devel,01/10] ipa: workaround libcxx duration limitation","version":1,"mbox":"https://patchwork.libcamera.org/series/3579/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17699/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17699/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 A000FC3289\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Oct 2022 05:55:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 202B462F96;\n\tThu, 27 Oct 2022 07:55:35 +0200 (CEST)","from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com\n\t[IPv6:2001:4860:4864:20::2c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D38C162F7F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Oct 2022 07:55:27 +0200 (CEST)","by mail-oa1-x2c.google.com with SMTP id\n\t586e51a60fabf-1322d768ba7so686452fac.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Oct 2022 22:55:27 -0700 (PDT)","from nroth-pc.attlocal.net\n\t([2600:1700:20:20c0:6406:fc7a:e46d:1666])\n\tby smtp.gmail.com with ESMTPSA id\n\t9-20020a9d0c09000000b00661a05691fasm140021otr.79.2022.10.26.22.55.26\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 26 Oct 2022 22:55:26 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666850135;\n\tbh=vB7GFZymoL/T+wDxOK4BoqQ250zMh4YOocOVu1a8b2w=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Lzg8qDpb1OVpcyy238pBH8DIBYT4J+2KvkOFYkTd1gInSHPT95oL9NyEbXKseuZsX\n\txrvJjV3vrywt5qvap7S63L+LA+IGiAQEtIfiqPpjvRHdNHFZoGehBbxLawBdmM+SKH\n\t1gfVfwdsoETNlu7waIFMus8mkBbPammUbll8v4k5xzVg7xu2oe542fSvNU4+Jwkg7h\n\tbGtzo/EcpVrtoFnq+SMcGkdGSUkZra2Q7VlKFRGpWDIUCjb3p+7JUrGlzZNCyXpEeA\n\tVnRV9CFHv2Kpm3m3jZn6OZioC4AKn0bxAlZe7zsM8+hB920euYG3u0ip9IHsZy6KB4\n\tAH0AkDYYzftGw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=rothemail-net.20210112.gappssmtp.com; s=20210112;\n\th=content-transfer-encoding:mime-version:reply-to:references\n\t:in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=r//BNFv0JKpWLYHL6Ed8JakGGX9uv7kxTeTtZsETSDk=;\n\tb=Q2jialjCOIGl0Ihrve+WBh/zu3BR6DN2LPy9PpEDl/bc2Ym8ufhKnFM7x0qM441dsj\n\tx/KpW5I6v4YK4TUqj8bdNCFtxblazdxeXgWNbFd1rR7km/7IlebCcBuWw33CosKI5IzO\n\tQwgVN382wDa1Mop4TCpktOG0q/tK0wjnce862p4MPc6t0+g1bhTuevfkXBNfizg9TKLk\n\tiUmK1Hr4zsHAlffP78CoWEwLY6uRMHMT6qDlq8BVVihKnrxTJSvIaBYbf4DuH1cQV4iC\n\ty4h6qpk8nJQxauzJRI7g4htzhTey69IoHSIY5u4bQzEfpN6L/QAu7mCZZVk0t1rE9++D\n\tdxMw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=rothemail-net.20210112.gappssmtp.com\n\theader.i=@rothemail-net.20210112.gappssmtp.com header.b=\"Q2jialjC\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:reply-to:references\n\t:in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=r//BNFv0JKpWLYHL6Ed8JakGGX9uv7kxTeTtZsETSDk=;\n\tb=E2uBgWf6RI1V0H4fnrtAYfroklbJpe1ZGKiSJSi9hOHSRuRkit6qioFeJVU7pGNgyJ\n\t6uH1Y4Vk0ZY+KvErLJUxltG7isVkN+Pn/kEfMhDnVe1ACJG3RG0GNl+zxDCNi5AFWWrD\n\twBtREj8HGPw5+xjcxg6Scnu3IvSeRrsHn9LELBikvx7G0p5UhZkNDBKHdqDmVpyUFqqc\n\tuX1gaVHKMYWVyZi90Ev+06B2KRS667LlrGmbrKw5NzL9MJuUV0TqPKw5d08Tra3E9/M4\n\tS4c09YHHC6SBdMI24siK/PD/hRIrWuzQCqsc9/SVU6OKvCE5ItSFsovJFCzdHceW9YzO\n\tmUcg==","X-Gm-Message-State":"ACrzQf0iGGK5M8/kYyLXgvN+tuQWQ8DTEmEc7c7JcWbJDxFgXCr489Ay\n\twNfwLwX1Tt+kpifBLEjc06k9prnJrWMJKp5q","X-Google-Smtp-Source":"AMsMyM6eJDnbt8eabAuP2i4SOXN2XjuyE+dKjbYpgWQ/h4qqE1IYoJ/b5nCcPO1zp9wE5GDw8GwV5A==","X-Received":"by 2002:a05:6870:6324:b0:13b:455:9408 with SMTP id\n\ts36-20020a056870632400b0013b04559408mr4535073oao.97.1666850127174; \n\tWed, 26 Oct 2022 22:55:27 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 27 Oct 2022 00:55:15 -0500","Message-Id":"<20221027055515.321791-11-nicholas@rothemail.net>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20221027055515.321791-1-nicholas@rothemail.net>","References":"<libcamera Android Enhancements>\n\t<20221027055515.321791-1-nicholas@rothemail.net>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 10/10] android: libcamera: add useful\n\tdebug prints","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>","From":"Nicholas Roth via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"libcamera-devel@lists.libcamera.org","Cc":"nicholas@rothemail.net","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Nicholas Roth <nicholas@rothemail.net>\n\nI identified opportunities to make libcamera's log output easier to\nunderstand while working to get it working on my Android device as a\nHAL. These additional logging statements came out of that and will\nhopefully prove useful to Android distribution maintainers with the same\ngoal as mine and to users who attempt to debug tools like Waydroid.\n\nSigned-off-by: Nicholas Roth <nicholas@rothemail.net>\n---\n src/android/camera_capabilities.cpp | 12 +++++++++---\n src/android/camera_hal_manager.cpp  |  3 ++-\n src/libcamera/base/log.cpp          |  4 +++-\n src/libcamera/v4l2_subdevice.cpp    |  2 +-\n 4 files changed, 15 insertions(+), 6 deletions(-)","diff":"diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex 64bd8dde..ef0d10d0 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -374,14 +374,20 @@ void CameraCapabilities::computeHwLevel(\n \tcamera_metadata_enum_android_info_supported_hardware_level\n \t\thwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL;\n \n-\tif (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR))\n+\tif (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)) {\n+\t\tLOG(HAL, Info) << noFull << \"missing manual sensor\";\n \t\thwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;\n+\t}\n \n-\tif (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING))\n+\tif (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) {\n+\t\tLOG(HAL, Info) << noFull << \"missing manual post processing\";\n \t\thwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;\n+\t}\n \n-\tif (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE))\n+\tif (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)) {\n+\t\tLOG(HAL, Info) << noFull << \"missing burst capture\";\n \t\thwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;\n+\t}\n \n \tfound = staticMetadata_->getEntry(ANDROID_SYNC_MAX_LATENCY, &entry);\n \tif (!found || *entry.data.i32 != 0) {\ndiff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp\nindex 7512cc4e..7fac4e3f 100644\n--- a/src/android/camera_hal_manager.cpp\n+++ b/src/android/camera_hal_manager.cpp\n@@ -140,7 +140,8 @@ void CameraHalManager::cameraAdded(std::shared_ptr<Camera> cam)\n \t */\n \tif (!isCameraExternal && !halConfig_.exists()) {\n \t\tLOG(HAL, Error)\n-\t\t\t<< \"HAL configuration file is mandatory for internal cameras\";\n+\t\t\t<< \"HAL configuration file is mandatory for internal cameras.\"\n+\t\t\t<< \" Camera NOT loaded: \\\"\" << cam->id() << \"\\\"\";\n \t\treturn;\n \t}\n \ndiff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\nindex 55fbd7b0..88800158 100644\n--- a/src/libcamera/base/log.cpp\n+++ b/src/libcamera/base/log.cpp\n@@ -625,8 +625,10 @@ void Logger::parseLogFile()\n void Logger::parseLogLevels()\n {\n \tconst char *debug = utils::secure_getenv(\"LIBCAMERA_LOG_LEVELS\");\n-\tif (!debug)\n+\tif (!debug) {\n+\t\tsyslog(LOG_INFO, \"Could not find LIBCAMERA_LOG_LEVELS in env\");\n \t\treturn;\n+\t}\n \n \tfor (const char *pair = debug; *debug != '\\0'; pair = debug) {\n \t\tconst char *comma = strchrnul(debug, ',');\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 15e8206a..f3e25b86 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -392,7 +392,7 @@ int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,\n \tif (ret < 0) {\n \t\tLOG(V4L2, Error)\n \t\t\t<< \"Unable to get rectangle \" << target << \" on pad \"\n-\t\t\t<< pad << \": \" << strerror(-ret);\n+\t\t\t<< pad << \": \" << strerror(-ret) << \".\";\n \t\treturn ret;\n \t}\n \n","prefixes":["libcamera-devel","10/10"]}