[{"id":34361,"web_url":"https://patchwork.libcamera.org/comment/34361/","msgid":"<20250527153732.39348-1-s.pueschel@pengutronix.de>","date":"2025-05-27T15:14:07","subject":"Don't be limited by the 8 statistic buffers","submitter":{"id":225,"url":"https://patchwork.libcamera.org/api/people/225/","name":"Sven Püschel","email":"s.pueschel@pengutronix.de"},"content":"The RFC patchset from Stefan works to enable an application to request\nmore than 4 buffers for the rkisp1. But when using a number higher than\n8 it breaks, as the bufferCount value is also used to determine the\namount of parameter/statistic buffers to allocate.\n\nBut as the patchset already limits the number of queued buffers, the\namount of parameter/statistic buffers can can also be just this fixed\nvalue. Therefore adapt Nicolas patch, which already did this from my\nrebased patch series [1].\n\nThis allows (on my hardware setup) up to 32 buffers to be allocated.\n\n@Stefan: With this patch included, feel free to add a\nTested-By: Sven Püschel <s.pueschel@pengutronix.de>\n\n[1] https://lists.libcamera.org/pipermail/libcamera-devel/2025-April/050029.html","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 DB2BCC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 May 2025 15:38:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 11B0568DA0;\n\tTue, 27 May 2025 17:38:16 +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 D14BA68D94\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 May 2025 17:38:14 +0200 (CEST)","from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77]\n\thelo=peter.mobile.pengutronix.de)\n\tby metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92)\n\t(envelope-from <s.pueschel@pengutronix.de>)\n\tid 1uJwNa-0007VS-9x; Tue, 27 May 2025 17:38:14 +0200"],"From":"=?utf-8?q?Sven_P=C3=BCschel?= <s.pueschel@pengutronix.de>","To":"libcamera-devel@lists.libcamera.org","Cc":"graphics@pengutronix.de, stefan.klug@ideasonboard.com, =?utf-8?q?Sven_?=\n\t=?utf-8?q?P=C3=BCschel?= <s.pueschel@pengutronix.de>","Subject":"Don't be limited by the 8 statistic buffers","Date":"Tue, 27 May 2025 17:14:07 +0200","Message-ID":"<20250527153732.39348-1-s.pueschel@pengutronix.de>","X-Mailer":"git-send-email 2.49.0","In-Reply-To":"<20250526214224.13631-1-stefan.klug@ideasonboard.com>","References":"<20250526214224.13631-1-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","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>"}},{"id":34558,"web_url":"https://patchwork.libcamera.org/comment/34558/","msgid":"<3b0515e9-e700-4aff-898f-a3e9846fcca0@pengutronix.de>","date":"2025-06-19T10:39:29","subject":"Re: [RFC PATCH 0/4] rkisp1: Allow usage of more than 4 buffers","submitter":{"id":225,"url":"https://patchwork.libcamera.org/api/people/225/","name":"Sven Püschel","email":"s.pueschel@pengutronix.de"},"content":"Hi Stefan,\n\ndo you plan to send a v2 patchset?\n\nSincerely\n     Sven\n\nOn 5/26/25 23:42, Stefan Klug wrote:\n> Hi all,\n>\n> In the rkisp1 pipeline the value of StreamConfiuration.bufferCount is\n> reset to 4 on validate(). This effectively limits the number of buffers\n> that are in the loop to 4. As soon as the consumers\n> (gstream/pipewire...) of the buffers need more than 1 buffer at a time,\n> we start to see frame drops. Sven resurrected an old series [1] that\n> solves the issue at the expense of an additional control and breaking\n> changes in the API.\n>\n> In the IoB code camp two weeks ago there were some discussions regarding\n> improvements in the rkisp1 regulation and per-frame-control (PFC). PFC\n> has been an ongoing topic for quite some time now and it seems to slowly\n> converge. Still we were hesitant in breaking the API or introducing new\n> controls before the overall concepts have stabilized enough.\n>\n> To mitigate the pain mentioned above we came up with a minimal changeset\n> that allows to request more than 4 buffers. Only 4 (or the pipeline\n> depth reported by the pipeline) buffers are queued into the device.\n> This has the same benefits as [1] but doesn't require an API break.\n>\n> I'm not available this week so I post the patches as RFC only for others\n> to try out as these were not thoroughly tested. Any feedback is greatly\n> appreciated.\n>\n> Best regards,\n> Stefan\n>\n>\n> [1] https://patchwork.libcamera.org/project/libcamera/list/?series=5148\n>\n> Stefan Klug (4):\n>    libcamera: pipeline_handler: Move waitingRequests_ into camera class\n>    libcamera: internal: Allow to limit the number of queued requests\n>    pipeline: rkisp1: Limit the maximum number of buffers queued in\n>    pipeline: rkisp1: Prperly handle the bufferCount set in the stream\n>      configuration\n>\n>   include/libcamera/internal/camera.h           |  2 +\n>   include/libcamera/internal/pipeline_handler.h |  8 ++--\n>   src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 12 +++++-\n>   src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  6 +--\n>   src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  4 +-\n>   src/libcamera/pipeline_handler.cpp            | 37 +++++++++++++------\n>   6 files changed, 46 insertions(+), 23 deletions(-)\n>","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 6C698BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Jun 2025 10:39:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 85BCB68DE1;\n\tThu, 19 Jun 2025 12:39:31 +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 39B4C68DDB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Jun 2025 12:39:30 +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 1uSCg5-0006cu-Li; Thu, 19 Jun 2025 12:39:29 +0200"],"Message-ID":"<3b0515e9-e700-4aff-898f-a3e9846fcca0@pengutronix.de>","Date":"Thu, 19 Jun 2025 12:39:29 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH 0/4] rkisp1: Allow usage of more than 4 buffers","To":"libcamera-devel@lists.libcamera.org,\n\tStefan Klug <stefan.klug@ideasonboard.com>","References":"<20250526214224.13631-1-stefan.klug@ideasonboard.com>","Content-Language":"en-US","From":"=?utf-8?q?Sven_P=C3=BCschel?= <s.pueschel@pengutronix.de>","In-Reply-To":"<20250526214224.13631-1-stefan.klug@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>"}},{"id":34618,"web_url":"https://patchwork.libcamera.org/comment/34618/","msgid":"<175069139170.159456.4750408242368329568@localhost>","date":"2025-06-23T15:09:51","subject":"Re: [RFC PATCH 0/4] rkisp1: Allow usage of more than 4 buffers","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Sven,\n\nI'm quite busy with other topics atm. I plan to send a v2 within this\nweek.\n\nBest regards,\nStefan\n\nQuoting Sven Püschel (2025-06-19 12:39:29)\n> Hi Stefan,\n> \n> do you plan to send a v2 patchset?\n> \n> Sincerely\n>      Sven\n> \n> On 5/26/25 23:42, Stefan Klug wrote:\n> > Hi all,\n> >\n> > In the rkisp1 pipeline the value of StreamConfiuration.bufferCount is\n> > reset to 4 on validate(). This effectively limits the number of buffers\n> > that are in the loop to 4. As soon as the consumers\n> > (gstream/pipewire...) of the buffers need more than 1 buffer at a time,\n> > we start to see frame drops. Sven resurrected an old series [1] that\n> > solves the issue at the expense of an additional control and breaking\n> > changes in the API.\n> >\n> > In the IoB code camp two weeks ago there were some discussions regarding\n> > improvements in the rkisp1 regulation and per-frame-control (PFC). PFC\n> > has been an ongoing topic for quite some time now and it seems to slowly\n> > converge. Still we were hesitant in breaking the API or introducing new\n> > controls before the overall concepts have stabilized enough.\n> >\n> > To mitigate the pain mentioned above we came up with a minimal changeset\n> > that allows to request more than 4 buffers. Only 4 (or the pipeline\n> > depth reported by the pipeline) buffers are queued into the device.\n> > This has the same benefits as [1] but doesn't require an API break.\n> >\n> > I'm not available this week so I post the patches as RFC only for others\n> > to try out as these were not thoroughly tested. Any feedback is greatly\n> > appreciated.\n> >\n> > Best regards,\n> > Stefan\n> >\n> >\n> > [1] https://patchwork.libcamera.org/project/libcamera/list/?series=5148\n> >\n> > Stefan Klug (4):\n> >    libcamera: pipeline_handler: Move waitingRequests_ into camera class\n> >    libcamera: internal: Allow to limit the number of queued requests\n> >    pipeline: rkisp1: Limit the maximum number of buffers queued in\n> >    pipeline: rkisp1: Prperly handle the bufferCount set in the stream\n> >      configuration\n> >\n> >   include/libcamera/internal/camera.h           |  2 +\n> >   include/libcamera/internal/pipeline_handler.h |  8 ++--\n> >   src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 12 +++++-\n> >   src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  6 +--\n> >   src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  4 +-\n> >   src/libcamera/pipeline_handler.cpp            | 37 +++++++++++++------\n> >   6 files changed, 46 insertions(+), 23 deletions(-)\n> >","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 EC941C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Jun 2025 15:09:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A52B068DE8;\n\tMon, 23 Jun 2025 17:09:55 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D76E468DDB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Jun 2025 17:09:54 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:8dc5:f4ae:2b23:86a3])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 348FF8DB;\n\tMon, 23 Jun 2025 17:09:38 +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=\"TKzqmYV2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1750691378;\n\tbh=ABaNfM3Fj/jWMtQ/2v3AnJ8+CN8DbrCEn0EOYuWXEYQ=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=TKzqmYV2HiOFouahm/OBxPmZEKLn75PWOXpVtbZwX6tzLl2Txrw7+kWklYMQ7gYAD\n\tM5jSCGD57nf26og/KZLG1NI9085uwd2T076XNGJHnUvKi0c0GtY/xiOIncdbvOT3yz\n\t3GormVe91SyGeb0bNWVt42uZ8/Qmn/ktsRxyZx7Q=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<3b0515e9-e700-4aff-898f-a3e9846fcca0@pengutronix.de>","References":"<20250526214224.13631-1-stefan.klug@ideasonboard.com>\n\t<3b0515e9-e700-4aff-898f-a3e9846fcca0@pengutronix.de>","Subject":"Re: [RFC PATCH 0/4] rkisp1: Allow usage of more than 4 buffers","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Sven =?utf-8?q?P=C3=BCschel?= <s.pueschel@pengutronix.de>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 23 Jun 2025 17:09:51 +0200","Message-ID":"<175069139170.159456.4750408242368329568@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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>"}}]