From patchwork Thu Sep 10 16:03:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28220 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 45A09BDCBE for ; Thu, 10 Sep 2026 16:03:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B03C468658; Thu, 10 Sep 2026 18:03:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fdbJrF4I"; 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 00F9F68615 for ; Thu, 10 Sep 2026 18:03:13 +0200 (CEST) Received: from pb-laptop.local (185.221.140.18.nat.pool.zt.hu [185.221.140.18]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 501C15B3; Thu, 10 Sep 2026 18:01:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789056096; bh=42+tqSzgex8Q1sgLrB5vEK6IIlqzVtK//7STPSa7ACs=; h=From:To:Cc:Subject:Date:From; b=fdbJrF4IsB4ewXJYSgvFWTJdPNpwkFt11n+uy9kP+m0GSB44UMp2ykkS5qaG4hr4L JUALVNPm+9BrqqI5J9VZ4Z/HlRFCp13+R1bBnv7eF0BaWl2tY3JxWmptL/EmqOjW/9 zrTJQaFtgj4gumdNqap6c7OIlwHEApe4oEN1xelY= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham Subject: [PATCH v2 1/5] libcamera: v4l2_videodevice: V4L2DeviceFormat: Expand formatting Date: Thu, 10 Sep 2026 18:03:05 +0200 Message-ID: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 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" Currently, only the size, the pixel format, and the color space is included when a `V4L2DeviceFormat` is formatted into a stream. Print the data about the planes as well (size and bytes-per-line), as it can immensely help debugging if it is readily available in the log. Example: 640x480-YUYV[614400/1280]/Rec709/Rec709/Rec601/Limited where the / pairs are printed inside the "[]" separated by ':'. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham --- src/libcamera/v4l2_videodevice.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 41dc5d0f65..bc539884e5 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -447,8 +447,19 @@ std::string V4L2DeviceFormat::toString() const */ std::ostream &operator<<(std::ostream &out, const V4L2DeviceFormat &f) { - out << f.size << "-" << f.fourcc << "/" - << ColorSpace::toString(f.colorSpace); + out << f.size << '-' << f.fourcc << '['; + + for (size_t i = 0; i < f.planesCount; i++) { + const auto &p = f.planes[i]; + + out << p.size << '/' << p.bpl; + + if (i + 1 < f.planesCount) + out << ':'; + } + + out << "]/" << ColorSpace::toString(f.colorSpace); + return out; } From patchwork Thu Sep 10 16:03:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28221 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 72D1ABDCBE for ; Thu, 10 Sep 2026 16:03:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9979E68660; Thu, 10 Sep 2026 18:03:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="g+CACuj1"; 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 32B0C68655 for ; Thu, 10 Sep 2026 18:03:14 +0200 (CEST) Received: from pb-laptop.local (185.221.140.18.nat.pool.zt.hu [185.221.140.18]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0B0626DF for ; Thu, 10 Sep 2026 18:01:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789056097; bh=sCJuvZsnGkqJWuexS03ZhwlGY38zHdNufcKs/Hcl9ic=; h=From:To:Subject:Date:In-Reply-To:References:From; b=g+CACuj125Jwzm8cqDsIgxYedG9T2UaYwOHUgn1dCygr8sbqP6Y+XzKq5DAh4wjDI lWF2g3GPNb8g/OS+aEuZwKaQ38cAZlFUE0gVbqrk7fy+s+bOOalpH80lqeyYpGtT8N u/Y92bHDSxRDV6Ikf6rxbzv7BlSSWyx2Odp0JgDc= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 2/5] libcamera: v4l2_{video, sub}device: {get, set, try}Format(): Log format Date: Thu, 10 Sep 2026 18:03:06 +0200 Message-ID: <20260910160309.940584-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> References: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 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" These functions have not been logging the v4l2 formats that they receive and the ones that the device actually returns. This makes debugging much more difficult. And multiple pipeline handlers work around this by adding logging around `setFormat()` calls, but those can be missed, and they don't necessarily include the path of the device node. So add these log messages into the `{get,set,try}Format()` methods themselves. Example: DEBUG V4L2 v4l2_videodevice.cpp:859 /dev/video0[13:cap]: trying format: 640x480-YUYV[]/Unset DEBUG V4L2 v4l2_videodevice.cpp:882 /dev/video0[13:cap]: returned format: 640x480-YUYV[614400/1280]/Rec709/Rec709/Rec601/Limited DEBUG V4L2 v4l2_subdevice.cpp:1424 'imx708': setting format on 0/0: 4608x2592-SRGGB10_1X10/Unset DEBUG V4L2 v4l2_subdevice.cpp:1439 'imx708': returned format on 0/0: 4608x2592-SRGGB10_1X10/RAW Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham --- changes in v2: * same changes in `V4L2Subdevice` --- src/libcamera/v4l2_subdevice.cpp | 6 ++++ src/libcamera/v4l2_videodevice.cpp | 48 +++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 8 deletions(-) -- 2.55.0 diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index a69de154e8..511cc12e2f 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -1374,6 +1374,8 @@ int V4L2Subdevice::getFormat(const Stream &stream, V4L2SubdeviceFormat *format, format->code = subdevFmt.format.code; format->colorSpace = toColorSpace(subdevFmt.format); + LOG(V4L2, Debug) << "returned format on " << stream << ": " << *format; + return 0; } @@ -1419,6 +1421,8 @@ int V4L2Subdevice::setFormat(const Stream &stream, V4L2SubdeviceFormat *format, subdevFmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC; } + LOG(V4L2, Debug) << "setting format on " << stream << ": " << *format; + int ret = ioctl(VIDIOC_SUBDEV_S_FMT, &subdevFmt); if (ret) { LOG(V4L2, Error) @@ -1432,6 +1436,8 @@ int V4L2Subdevice::setFormat(const Stream &stream, V4L2SubdeviceFormat *format, format->code = subdevFmt.format.code; format->colorSpace = toColorSpace(subdevFmt.format); + LOG(V4L2, Debug) << "returned format on " << stream << ": " << *format; + return 0; } diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index bc539884e5..ea6270fdf2 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -814,19 +814,32 @@ std::string V4L2VideoDevice::logPrefix() const */ int V4L2VideoDevice::getFormat(V4L2DeviceFormat *format) { + int ret; + switch (bufferType_) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: case V4L2_BUF_TYPE_VIDEO_OUTPUT: - return getFormatSingleplane(format); + ret = getFormatSingleplane(format); + break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - return getFormatMultiplane(format); + ret = getFormatMultiplane(format); + break; case V4L2_BUF_TYPE_META_CAPTURE: case V4L2_BUF_TYPE_META_OUTPUT: - return getFormatMeta(format); + ret = getFormatMeta(format); + break; default: - return -EINVAL; + ret = -EINVAL; + break; } + + if (ret) + return ret; + + LOG(V4L2, Debug) << "returned format: " << *format; + + return 0; } /** @@ -841,19 +854,34 @@ int V4L2VideoDevice::getFormat(V4L2DeviceFormat *format) */ int V4L2VideoDevice::tryFormat(V4L2DeviceFormat *format) { + int ret; + + LOG(V4L2, Debug) << "trying format: " << *format; + switch (bufferType_) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: case V4L2_BUF_TYPE_VIDEO_OUTPUT: - return trySetFormatSingleplane(format, false); + ret = trySetFormatSingleplane(format, false); + break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - return trySetFormatMultiplane(format, false); + ret = trySetFormatMultiplane(format, false); + break; case V4L2_BUF_TYPE_META_CAPTURE: case V4L2_BUF_TYPE_META_OUTPUT: - return trySetFormatMeta(format, false); + ret = trySetFormatMeta(format, false); + break; default: - return -EINVAL; + ret = -EINVAL; + break; } + + if (ret) + return ret; + + LOG(V4L2, Debug) << "returned format: " << *format; + + return 0; } /** @@ -869,6 +897,8 @@ int V4L2VideoDevice::setFormat(V4L2DeviceFormat *format) { int ret; + LOG(V4L2, Debug) << "setting format: " << *format; + switch (bufferType_) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: case V4L2_BUF_TYPE_VIDEO_OUTPUT: @@ -894,6 +924,8 @@ int V4L2VideoDevice::setFormat(V4L2DeviceFormat *format) format_ = *format; formatInfo_ = &PixelFormatInfo::info(format_.fourcc); + LOG(V4L2, Debug) << "returned format: " << *format; + return 0; } From patchwork Thu Sep 10 16:03:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28222 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 DBBE3BDCBE for ; Thu, 10 Sep 2026 16:03:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3F3216866A; Thu, 10 Sep 2026 18:03:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mZhVjzGX"; 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 A297168655 for ; Thu, 10 Sep 2026 18:03:14 +0200 (CEST) Received: from pb-laptop.local (185.221.140.18.nat.pool.zt.hu [185.221.140.18]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 703A25B3; Thu, 10 Sep 2026 18:01:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789056097; bh=2JK0g6LP/kNx7CRavmNjbOt9xn8+gluGOWv7WBz1lOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mZhVjzGXUCyBKibXPZ3/zY8zuWYE7CzwxZ5EK++8GQSrz7llw3z4iN6Y5TXZeC9JM oLZxhus6kP6A/5h1b5SvZEE4kbdCKWe3e/vOycSTp7YKA03AvfEnrfuL4W0mFhNHJU CLzBa2ed1o6f8dbB5hmWnmpTXAnuRn9iwlQnIG+c= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham Subject: [PATCH v2 3/5] libcamera: stream: StreamConfiguration: Adjust formatting Date: Thu, 10 Sep 2026 18:03:07 +0200 Message-ID: <20260910160309.940584-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> References: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 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" Adjust the formatting of how a `StreamConfiguration` is formatted to a stream. Specifically, print the `frameSize` and `stride` members in a format similar to how it is done for `V4L2DeviceFormat`. Example: configuring streams: (0) 640x480-YUYV[614400/1280]/Rec709/Rec709/Rec601/Limited Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham --- src/libcamera/stream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index be0c80cbcf..af730ff8a5 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -407,8 +407,9 @@ std::string StreamConfiguration::toString() const */ std::ostream &operator<<(std::ostream &out, const StreamConfiguration &cfg) { - out << cfg.size << "-" << cfg.pixelFormat << "/" - << ColorSpace::toString(cfg.colorSpace); + out << cfg.size << '-' << cfg.pixelFormat + << '[' << cfg.frameSize << '/' << cfg.stride << ']' + << '/' << ColorSpace::toString(cfg.colorSpace); return out; } From patchwork Thu Sep 10 16:03:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28223 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 AB63EBDCBE for ; Thu, 10 Sep 2026 16:03:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3E4E16866D; Thu, 10 Sep 2026 18:03:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Xx/xxmzS"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 284CF68655 for ; Thu, 10 Sep 2026 18:03:15 +0200 (CEST) Received: from pb-laptop.local (185.221.140.18.nat.pool.zt.hu [185.221.140.18]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DCD286DF for ; Thu, 10 Sep 2026 18:01:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789056098; bh=svJ3stCC03m4jFUh61B1M7sRXgTicWRKO+yjeYMDJJU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Xx/xxmzSAIQwXJ73fK6uz2i+6tcE/OaQc4I1GTd6OdZ0a8Ja0E1bk0x9omQy+1Cki YfmYhd0IvAaWlXopDo1coyZVJS5I9I5NNmOW/sdIn7nuU0XF5mJ7lmewe/VY0ysF+9 MuegQmKdL6YFytiIRcOUJwCeKjMuwnUEAlpFh7Ls= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 4/5] libcamera: v4l2_videodevice: Expand d/qbuf logging Date: Thu, 10 Sep 2026 18:03:08 +0200 Message-ID: <20260910160309.940584-4-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> References: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 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" In addition to the index, make sure that the address of the `FrameBuffer` object is present in the log message. This is useful for debugging to be able to correlate requests with specific buffer queue/dequeue operations. Furthermore, also log exactly which buffers are implicitly cancelled when streaming is stopped. Example: DEBUG V4L2 v4l2_videodevice.cpp:1915 /dev/video16[22:cap]: Dequeuing buffer 1 0x50200008b970 DEBUG V4L2 v4l2_videodevice.cpp:1826 /dev/video16[22:cap]: Queueing buffer 1 0x50200008b970 DEBUG V4L2 v4l2_videodevice.cpp:2088 /dev/video16[22:cap]: Cancelling buffer 1 0x50200008b970 Signed-off-by: Barnabás Pőcze --- src/libcamera/v4l2_videodevice.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index ea6270fdf2..19ac758888 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1823,7 +1823,7 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer, const V4L2Request *request buf.timestamp.tv_usec = (metadata.timestamp / 1000) % 1000000; } - LOG(V4L2, Debug) << "Queueing buffer " << buf.index; + LOG(V4L2, Debug) << "Queueing buffer " << buf.index << ' ' << buffer; ret = ioctl(VIDIOC_QBUF, &buf); if (ret < 0) { @@ -1895,8 +1895,6 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() return nullptr; } - LOG(V4L2, Debug) << "Dequeuing buffer " << buf.index; - /* * If the video node fails to stream-on successfully (which can occur * when queuing a buffer), a vb2 kernel bug can lead to the buffer which @@ -1909,8 +1907,14 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() * safely ignore buffers which are unexpected to prevent crashes on * older kernels. */ - auto it = queuedBuffers_.find(buf.index); - if (it == queuedBuffers_.end()) { + + FrameBuffer *buffer = nullptr; + if (auto nh = queuedBuffers_.extract(buf.index)) + buffer = nh.mapped(); + + LOG(V4L2, Debug) << "Dequeuing buffer " << buf.index << ' ' << buffer; + + if (!buffer) { LOG(V4L2, Error) << "Dequeued unexpected buffer index " << buf.index; @@ -1919,9 +1923,6 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() cache_->put(buf.index); - FrameBuffer *buffer = it->second; - queuedBuffers_.erase(it); - if (queuedBuffers_.empty()) { fdBufferNotifier_->setEnabled(false); watchdog_.stop(); @@ -2084,6 +2085,8 @@ int V4L2VideoDevice::streamOff() /* Send back all queued buffers. */ for (const auto &[id, buffer] : queuedBuffers_) { + LOG(V4L2, Debug) << "Cancelling buffer " << id << ' ' << buffer; + cache_->put(id); buffer->_d()->cancel(); bufferReady.emit(buffer); From patchwork Thu Sep 10 16:03:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28224 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 59063C3272 for ; Thu, 10 Sep 2026 16:03:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2E4D368665; Thu, 10 Sep 2026 18:03:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nRDaThtS"; 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 372D768657 for ; Thu, 10 Sep 2026 18:03:16 +0200 (CEST) Received: from pb-laptop.local (185.221.140.18.nat.pool.zt.hu [185.221.140.18]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BD3295B3 for ; Thu, 10 Sep 2026 18:01:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789056098; bh=w5a9qiqoDR6NsEdz9033xNItJUFqab0L/gS3A1P0WcA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nRDaThtSVrxtw1nDFtrEVXrHRzsw+abcxLZqjfRJvjoVs5VT6CdUQ5SXy3JcrFKsW VwjiYdWOHqBpDKE5uk6eTmnHkAZZNXGBQABtIWehkgKkzIJRFVlDC8RKdPU0Q2/SY6 LcDhuINlLhHY7H0o6GmIMW7wmwKmClKLSyvvsArg= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 5/5] libcamera: v4l2_subdevice: Make log prefix similar to V4L2VideoDevice Date: Thu, 10 Sep 2026 18:03:09 +0200 Message-ID: <20260910160309.940584-5-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> References: <20260910160309.940584-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 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" Make the log prefix of `V4L2Subdevice` more similar to that of `V4L2VideoDevice`. Specifically, add the path of the device and the file descriptor to the log prefix. Having the path in the log message helps debugging if the device needs to be inspected by e.g. {v4l2,media}-ctl. The file descriptor is added for consistency with `V4L2VideoDevice`. Example: DEBUG V4L2 v4l2_device.cpp:741 /dev/v4l-subdev5[19:'imx708']: Control: Exposure (0x00980911) Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham --- src/libcamera/v4l2_subdevice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 511cc12e2f..fd5fb51bbf 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -1786,7 +1786,8 @@ V4L2Subdevice::fromEntityName(const MediaDevice *media, std::string V4L2Subdevice::logPrefix() const { - return "'" + entity_->name() + "'"; + return deviceNode() + '[' + std::to_string(fd()) + + ":'" + entity_->name() + "']"; } std::vector V4L2Subdevice::enumPadCodes(const Stream &stream)