From patchwork Thu Oct 27 05:55:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17699 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A000FC3289 for ; Thu, 27 Oct 2022 05:55:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 202B462F96; Thu, 27 Oct 2022 07:55:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666850135; bh=vB7GFZymoL/T+wDxOK4BoqQ250zMh4YOocOVu1a8b2w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Lzg8qDpb1OVpcyy238pBH8DIBYT4J+2KvkOFYkTd1gInSHPT95oL9NyEbXKseuZsX xrvJjV3vrywt5qvap7S63L+LA+IGiAQEtIfiqPpjvRHdNHFZoGehBbxLawBdmM+SKH 1gfVfwdsoETNlu7waIFMus8mkBbPammUbll8v4k5xzVg7xu2oe542fSvNU4+Jwkg7h bGtzo/EcpVrtoFnq+SMcGkdGSUkZra2Q7VlKFRGpWDIUCjb3p+7JUrGlzZNCyXpEeA VnRV9CFHv2Kpm3m3jZn6OZioC4AKn0bxAlZe7zsM8+hB920euYG3u0ip9IHsZy6KB4 AH0AkDYYzftGw== Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D38C162F7F for ; Thu, 27 Oct 2022 07:55:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="Q2jialjC"; dkim-atps=neutral Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1322d768ba7so686452fac.5 for ; Wed, 26 Oct 2022 22:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=r//BNFv0JKpWLYHL6Ed8JakGGX9uv7kxTeTtZsETSDk=; b=Q2jialjCOIGl0Ihrve+WBh/zu3BR6DN2LPy9PpEDl/bc2Ym8ufhKnFM7x0qM441dsj x/KpW5I6v4YK4TUqj8bdNCFtxblazdxeXgWNbFd1rR7km/7IlebCcBuWw33CosKI5IzO QwgVN382wDa1Mop4TCpktOG0q/tK0wjnce862p4MPc6t0+g1bhTuevfkXBNfizg9TKLk iUmK1Hr4zsHAlffP78CoWEwLY6uRMHMT6qDlq8BVVihKnrxTJSvIaBYbf4DuH1cQV4iC y4h6qpk8nJQxauzJRI7g4htzhTey69IoHSIY5u4bQzEfpN6L/QAu7mCZZVk0t1rE9++D dxMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=r//BNFv0JKpWLYHL6Ed8JakGGX9uv7kxTeTtZsETSDk=; b=E2uBgWf6RI1V0H4fnrtAYfroklbJpe1ZGKiSJSi9hOHSRuRkit6qioFeJVU7pGNgyJ 6uH1Y4Vk0ZY+KvErLJUxltG7isVkN+Pn/kEfMhDnVe1ACJG3RG0GNl+zxDCNi5AFWWrD wBtREj8HGPw5+xjcxg6Scnu3IvSeRrsHn9LELBikvx7G0p5UhZkNDBKHdqDmVpyUFqqc uX1gaVHKMYWVyZi90Ev+06B2KRS667LlrGmbrKw5NzL9MJuUV0TqPKw5d08Tra3E9/M4 S4c09YHHC6SBdMI24siK/PD/hRIrWuzQCqsc9/SVU6OKvCE5ItSFsovJFCzdHceW9YzO mUcg== X-Gm-Message-State: ACrzQf0iGGK5M8/kYyLXgvN+tuQWQ8DTEmEc7c7JcWbJDxFgXCr489Ay wNfwLwX1Tt+kpifBLEjc06k9prnJrWMJKp5q X-Google-Smtp-Source: AMsMyM6eJDnbt8eabAuP2i4SOXN2XjuyE+dKjbYpgWQ/h4qqE1IYoJ/b5nCcPO1zp9wE5GDw8GwV5A== X-Received: by 2002:a05:6870:6324:b0:13b:455:9408 with SMTP id s36-20020a056870632400b0013b04559408mr4535073oao.97.1666850127174; Wed, 26 Oct 2022 22:55:27 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6406:fc7a:e46d:1666]) by smtp.gmail.com with ESMTPSA id 9-20020a9d0c09000000b00661a05691fasm140021otr.79.2022.10.26.22.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 22:55:26 -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: <20221027055515.321791-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/10] android: libcamera: add useful debug prints X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth I identified opportunities to make libcamera's log output easier to understand while working to get it working on my Android device as a HAL. These additional logging statements came out of that and will hopefully prove useful to Android distribution maintainers with the same goal as mine and to users who attempt to debug tools like Waydroid. Signed-off-by: Nicholas Roth --- src/android/camera_capabilities.cpp | 12 +++++++++--- src/android/camera_hal_manager.cpp | 3 ++- src/libcamera/base/log.cpp | 4 +++- src/libcamera/v4l2_subdevice.cpp | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 64bd8dde..ef0d10d0 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -374,14 +374,20 @@ void CameraCapabilities::computeHwLevel( camera_metadata_enum_android_info_supported_hardware_level hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL; - if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)) + if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)) { + LOG(HAL, Info) << noFull << "missing manual sensor"; hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + } - if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) + if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) { + LOG(HAL, Info) << noFull << "missing manual post processing"; hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + } - if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)) + if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)) { + LOG(HAL, Info) << noFull << "missing burst capture"; hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + } found = staticMetadata_->getEntry(ANDROID_SYNC_MAX_LATENCY, &entry); if (!found || *entry.data.i32 != 0) { diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp index 7512cc4e..7fac4e3f 100644 --- a/src/android/camera_hal_manager.cpp +++ b/src/android/camera_hal_manager.cpp @@ -140,7 +140,8 @@ void CameraHalManager::cameraAdded(std::shared_ptr cam) */ if (!isCameraExternal && !halConfig_.exists()) { LOG(HAL, Error) - << "HAL configuration file is mandatory for internal cameras"; + << "HAL configuration file is mandatory for internal cameras." + << " Camera NOT loaded: \"" << cam->id() << "\""; return; } diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp index 55fbd7b0..88800158 100644 --- a/src/libcamera/base/log.cpp +++ b/src/libcamera/base/log.cpp @@ -625,8 +625,10 @@ void Logger::parseLogFile() void Logger::parseLogLevels() { const char *debug = utils::secure_getenv("LIBCAMERA_LOG_LEVELS"); - if (!debug) + if (!debug) { + syslog(LOG_INFO, "Could not find LIBCAMERA_LOG_LEVELS in env"); return; + } for (const char *pair = debug; *debug != '\0'; pair = debug) { const char *comma = strchrnul(debug, ','); diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 15e8206a..f3e25b86 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -392,7 +392,7 @@ int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target, if (ret < 0) { LOG(V4L2, Error) << "Unable to get rectangle " << target << " on pad " - << pad << ": " << strerror(-ret); + << pad << ": " << strerror(-ret) << "."; return ret; }