From patchwork Fri Oct 17 09:00:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 24696 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 E176CC3331 for ; Fri, 17 Oct 2025 09:00:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 34639606AB; Fri, 17 Oct 2025 11:00:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="FLH/GLMN"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 68754606A2 for ; Fri, 17 Oct 2025 11:00:16 +0200 (CEST) Received: from [192.168.1.182] (93-46-82-201.ip106.fastwebnet.it [93.46.82.201]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 06A931E33; Fri, 17 Oct 2025 10:58:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1760691516; bh=sPGToOju6+KA4WdoxnrOT31eTQJcw2spNsMittaieDY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FLH/GLMNe5/k099IVUSJ6vKtmBqQ2/n9oICid042Y0QzqVr5xQqVW+57KyM65IRgW c2hAdQL1YOefUU3FxEPuNqHc1Ku3Y5lJ910yFkBXS6F7gRiGMYNC3ZAwYcGRnf7J4F jamJZ+zTACQaoypN3yjK6EsHlJsJkTwJri6gMef4= From: Jacopo Mondi Date: Fri, 17 Oct 2025 11:00:07 +0200 Subject: [PATCH 3/3] DNI: cam: Test Camera::controls() update with capture script MIME-Version: 1.0 Message-Id: <20251017-exposure-limits-v1-3-6288cd86e719@ideasonboard.com> References: <20251017-exposure-limits-v1-0-6288cd86e719@ideasonboard.com> In-Reply-To: <20251017-exposure-limits-v1-0-6288cd86e719@ideasonboard.com> To: =?utf-8?q?Niklas_S=C3=B6derlund?= , libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2583; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=sPGToOju6+KA4WdoxnrOT31eTQJcw2spNsMittaieDY=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBo8gWfAoB9TVMVFIttj+YIZx1Q8mpMvfxG93C3G OXXNUohSMGJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaPIFnwAKCRByNAaPFqFW PCE9D/9Zl5RfOPvkaEkRp2qIhCVFKdu1FuQO4p8zTm70AqeoTkBKQJVigJctiizbZCcpwzdjemh Io3xfZzZH9n7kmnzwQn0DOlBYmFvB94qWx8AOsujLXKAfz+uWOF4Oj9FqfjnH+dAuHv1PiDa0ou Gvj7kn2RbuxnwxFJVdj1OqS4M55WCA5+CD52aJMesU4Td8koq6MBZKWHOO4rjxrngnRv/YGhVzL Y77hv8lXDZj8+sCryLMBxwL7cMDy/Ow+b9147vEddGY1Bndbxw6YI5l1hCXCrxq2LzHtQpXaG1S qi4bkDj9pgB0ls6sQguRqgLHs3IMedcH39WSPFiBsHUM3bSx3woQaackeVv+GqhDRM9kRPKJnFN YGE567MYelhXWdrtpeRNbZp1WIONt71d6VB5cIzqiCopR8FDA9Z5U2sV32M/uMlhCjHYNZ/C4SY 4HFO+UU/uH0r4bH6vfFhYZEdVJvUMyTFkcARMDRqmXF9hZcorMuM1rjbBQGiXtea9OpXyBKuJ+L bk92Ur9JXr/jfp23qyYt6i8joNkSuVnWJoBDymvNEblj8lqeB+PBTdRxOBPOp1pm/X7mAFI6AMP eyWitXrcomusJFCROHWEPZE7ijHsb4KZz2e8eC6YAi7uWkKIuZEZonV1p/wZvQR/aYcikutEXaM hlLGjkmDx+ToqbA== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a per-frame printout of the ExposureTime and FrameDurationLimits controls to the 'cam' tool and change the FrameDurationLimits value during a capture session using a capture script. $ cam -c1 -C100 --script ./capture-script.yaml up to frame 50: (30.07 fps) cam0-stream0 seq: 000050 bytesused: 2073600/1036800 FrameDurationLimits: [21751, 1281893] Exposure max: 33238 The FrameDuration is unbound and Exposure is limited by the driver programmed vblank of 627 lines (configuration for full-resolution 30 fps) to 33,238 msecs. After frame 50: (15.00 fps) cam0-stream0 seq: 000055 bytesused: 2073600/1036800 FrameDurationLimits: [66666, 66666] Exposure max: 66652 FrameDurationLimits is set to [66666, 66666] by the capture script and the control limits as fetched from the Camera are updated accordingly. The Exposure time is now bounded by a larger vblank of 2335 lines to 66,652 msecs. Signed-off-by: Jacopo Mondi --- change-frame-duration.yaml | 4 ++++ src/apps/cam/camera_session.cpp | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/change-frame-duration.yaml b/change-frame-duration.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b73d85b9a2625067e4955a7c1a15756ee08aec32 --- /dev/null +++ b/change-frame-duration.yaml @@ -0,0 +1,4 @@ +frames: + - 50: + FrameDurationLimits: [66666, 66666] + diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index 1596a25a3abed9c2d93e6657b92e35fdfd3d1a26..dde4b7b5a7bb907192e6a0d3b5fd7d097a719cb9 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -544,6 +544,27 @@ void CameraSession::processRequest(Request *request) if (!requeue) return; + auto camera = this->camera(); + const auto controlInfo = camera->controls(); + for (const auto &[id, ctrlInfo] : controlInfo) { + if (id->id() != libcamera::controls::EXPOSURE_TIME && + id->id() != libcamera::controls::FRAME_DURATION_LIMITS) + continue; + + switch (id->id()) { + case libcamera::controls::EXPOSURE_TIME: + std::cout << "Exposure max: " + << ctrlInfo.max().get() << std::endl; + break; + case libcamera::controls::FRAME_DURATION_LIMITS: + std::cout << "FrameDurationLimits: [" + << ctrlInfo.min().get() << ", " + << ctrlInfo.max().get() << "]" + << std::endl; + break; + } + } + request->reuse(Request::ReuseBuffers); queueRequest(request); }