[{"id":34168,"web_url":"https://patchwork.libcamera.org/comment/34168/","msgid":"<20250509132029.GK28896@pendragon.ideasonboard.com>","date":"2025-05-09T13:20:29","subject":"Re: [PATCH] libcamera: v4l2_videodevice: Log buffer count on error","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Sven,\n\nThank you for the patch.\n\n\n\nOn Fri, May 09, 2025 at 02:57:46PM +0200, Sven Püschel wrote:\n> Log the actual and requested buffer count in the v4l2 error,\n> when not the requested buffer count could was allocated by V4L2.\n\n\"was\" or \"could be\", but not \"could was\". Unless you would prefer\notherwise, I'll rewrite this as\n\nLog the actual and requested buffers count in case of a V4L2 buffers\nallocation error, when the requested buffers count could not be\nallocated.\n\n> Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>\n> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> \n> ---\n> \n> Extracted from a [1], as it is independent of it.\n> \n> [1] https://lists.libcamera.org/pipermail/libcamera-devel/2025-April/050024.html\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index f5b3fa09..d6f8c3cd 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1326,7 +1326,8 @@ int V4L2VideoDevice::requestBuffers(unsigned int count,\n>  \n>  \tif (rb.count < count) {\n>  \t\tLOG(V4L2, Error)\n> -\t\t\t<< \"Not enough buffers provided by V4L2VideoDevice\";\n> +\t\t\t<< \"Not enough buffers provided by V4L2VideoDevice. Wanted: \"\n> +\t\t\t<< count << \", got: \" << rb.count;\n\n\t\t\t<< \"Not enough buffers provided by V4L2VideoDevice. Wanted \"\n\t\t\t<< count << \", got \" << rb.count;\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nIf you're fine with those small changes, there's no need to submit a v2,\nI'll handle it when applying the patch.\n\n>  \t\trequestBuffers(0, memoryType);\n>  \t\treturn -ENOMEM;\n>  \t}","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 48870C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 May 2025 13:20:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9343C68B42;\n\tFri,  9 May 2025 15:20:40 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AEF1968B25\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 May 2025 15:20:38 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(noh63-h01-176-133-119-130.dsl.sta.abo.bbox.fr [176.133.119.130])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A935A8DB;\n\tFri,  9 May 2025 15:20:25 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"kJVXsi4t\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1746796825;\n\tbh=f42DJC+kQGxPyVUmOB5DBnnQs4wKQ1iYvOUxHhcxrzU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=kJVXsi4tt+CvuWYZ9D/gtJYXwt64Z0n9N0Sdx1mtBQWYIUC0G6xmeNvPT+xlXf0Rl\n\to6ISRVHuB/b2bkozk6DeXrF80p689s1WwEgdCZvRdHqebqrG21r1oiRcAhBPcDihkT\n\tjHu9vJ00MOH1h9CLJj5gPtht1FRKF8F8LlYxsXv4=","Date":"Fri, 9 May 2025 15:20:29 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Sven =?utf-8?q?P=C3=BCschel?= <s.pueschel@pengutronix.de>","Cc":"libcamera-devel@lists.libcamera.org, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <barnabas.pocze@ideasonboard.com>","Subject":"Re: [PATCH] libcamera: v4l2_videodevice: Log buffer count on error","Message-ID":"<20250509132029.GK28896@pendragon.ideasonboard.com>","References":"<20250509125746.49898-1-s.pueschel@pengutronix.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250509125746.49898-1-s.pueschel@pengutronix.de>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":34169,"web_url":"https://patchwork.libcamera.org/comment/34169/","msgid":"<3433d1db-831a-489d-8466-9877db9865af@pengutronix.de>","date":"2025-05-09T13:32:04","subject":"Re: [PATCH] libcamera: v4l2_videodevice: Log buffer count on error","submitter":{"id":225,"url":"https://patchwork.libcamera.org/api/people/225/","name":"Sven Püschel","email":"s.pueschel@pengutronix.de"},"content":"Hi Laurent,\n\nOn 5/9/25 15:20, Laurent Pinchart wrote:\n> Hi Sven,\n>\n> Thank you for the patch.\n>\n>\n>\n> On Fri, May 09, 2025 at 02:57:46PM +0200, Sven Püschel wrote:\n>> Log the actual and requested buffer count in the v4l2 error,\n>> when not the requested buffer count could was allocated by V4L2.\n> \"was\" or \"could be\", but not \"could was\". Unless you would prefer\n> otherwise, I'll rewrite this as\n>\n> Log the actual and requested buffers count in case of a V4L2 buffers\n> allocation error, when the requested buffers count could not be\n> allocated.\noh, thanks. Feel free to rewrite it like this\n>> Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>\n>> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>>\n>> ---\n>>\n>> Extracted from a [1], as it is independent of it.\n>>\n>> [1] https://lists.libcamera.org/pipermail/libcamera-devel/2025-April/050024.html\n>> ---\n>>   src/libcamera/v4l2_videodevice.cpp | 3 ++-\n>>   1 file changed, 2 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n>> index f5b3fa09..d6f8c3cd 100644\n>> --- a/src/libcamera/v4l2_videodevice.cpp\n>> +++ b/src/libcamera/v4l2_videodevice.cpp\n>> @@ -1326,7 +1326,8 @@ int V4L2VideoDevice::requestBuffers(unsigned int count,\n>>   \n>>   \tif (rb.count < count) {\n>>   \t\tLOG(V4L2, Error)\n>> -\t\t\t<< \"Not enough buffers provided by V4L2VideoDevice\";\n>> +\t\t\t<< \"Not enough buffers provided by V4L2VideoDevice. Wanted: \"\n>> +\t\t\t<< count << \", got: \" << rb.count;\n> \t\t\t<< \"Not enough buffers provided by V4L2VideoDevice. Wanted \"\n> \t\t\t<< count << \", got \" << rb.count;\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> If you're fine with those small changes, there's no need to submit a v2,\n> I'll handle it when applying the patch.\n>\n>>   \t\trequestBuffers(0, memoryType);\n>>   \t\treturn -ENOMEM;\n>>   \t}","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 D511AC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 May 2025 13:32:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C998C68B45;\n\tFri,  9 May 2025 15:32:06 +0200 (CEST)","from metis.whiteo.stw.pengutronix.de\n\t(metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B2E4168B25\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 May 2025 15:32:05 +0200 (CEST)","from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77]\n\thelo=[127.0.0.1])\n\tby metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92)\n\t(envelope-from <s.pueschel@pengutronix.de>)\n\tid 1uDNpd-00004q-76; Fri, 09 May 2025 15:32:05 +0200"],"Message-ID":"<3433d1db-831a-489d-8466-9877db9865af@pengutronix.de>","Date":"Fri, 9 May 2025 15:32:04 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] libcamera: v4l2_videodevice: Log buffer count on error","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <barnabas.pocze@ideasonboard.com>","References":"<20250509125746.49898-1-s.pueschel@pengutronix.de>\n\t<20250509132029.GK28896@pendragon.ideasonboard.com>","Content-Language":"en-US","From":"=?utf-8?q?Sven_P=C3=BCschel?= <s.pueschel@pengutronix.de>","In-Reply-To":"<20250509132029.GK28896@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-SA-Exim-Connect-IP":"2a0a:edc0:0:900:1d::77","X-SA-Exim-Mail-From":"s.pueschel@pengutronix.de","X-SA-Exim-Scanned":"No (on metis.whiteo.stw.pengutronix.de);\n\tSAEximRunCond expanded to false","X-PTX-Original-Recipient":"libcamera-devel@lists.libcamera.org","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]