[{"id":34826,"web_url":"https://patchwork.libcamera.org/comment/34826/","msgid":"<71215b0e-2d7a-43c5-9196-5cd38ed77175@pengutronix.de>","date":"2025-07-08T13:07:52","subject":"Re: [PATCH v2 0/5] 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":"On 7/7/25 09:53, Stefan Klug wrote:\n\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> Updates in Version 1 of the series (after the RFC):\n> - Included the feedback from reviews of the RFC (For etails see the chaneglog in\n>    the individual patches)\n> - Included two patches with fixes from Sven an Kieran\n> - I modified patch (6/6) from Kieran a bit after the review comment from\n>    Laurent. @Kieran could you have a look at that as I don't have a easy way to\n>    replicate the issue? Ideally I would like to merge that patch into patch 2/6\n>    as it fixes an issue introduced there. For now I left it separate for easier\n>    review.\n>\n> Updates in v2:\n> - Fixed segfault due to wrong lambda capturing\n> - Fixed ASSERT dues to recursive call of doQueueRequests in virtual pipeline\n> - Improved documentation\n> - Squashed patch 6 into patch 2\n\nI've tested this v2 and it works fine. Feel free to add\n\nTested-By: Sven Püschel<s.pueschel@pengutronix.de>\n\n\nSincerely\n     Sven\n\n>\n> Best regards,\n> Stefan\n>\n> Nícolas F. R. A. Prado (1):\n>    libcamera: pipeline: rkisp1: Don't rely on bufferCount\n>\n> Stefan Klug (4):\n>    libcamera: pipeline_handler: Move waitingRequests_ into camera class\n>    libcamera: pipeline_handler: Allow to limit the number of queued\n>      requests\n>    pipeline: rkisp1: Limit the maximum number of buffers queued in\n>    pipeline: rkisp1: Properly handle the bufferCount set in the stream\n>      configuration\n>\n>   include/libcamera/internal/camera.h           |  2 +\n>   include/libcamera/internal/pipeline_handler.h |  9 ++-\n>   src/libcamera/camera.cpp                      |  9 +++\n>   src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 28 +++++---\n>   src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  7 +-\n>   src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  4 +-\n>   src/libcamera/pipeline_handler.cpp            | 70 +++++++++++++++----\n>   7 files changed, 90 insertions(+), 39 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 72913C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Jul 2025 13:07:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EFB3168EE6;\n\tTue,  8 Jul 2025 15:07:55 +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 A7F1261519\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Jul 2025 15:07:53 +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>) id 1uZ837-0002Di-2b\n\tfor libcamera-devel@lists.libcamera.org;\n\tTue, 08 Jul 2025 15:07:53 +0200"],"Message-ID":"<71215b0e-2d7a-43c5-9196-5cd38ed77175@pengutronix.de>","Date":"Tue, 8 Jul 2025 15:07:52 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 0/5] rkisp1: Allow usage of more than 4 buffers","To":"libcamera-devel@lists.libcamera.org","References":"<20250707075400.9079-1-stefan.klug@ideasonboard.com>","Content-Language":"en-US","From":"=?utf-8?q?Sven_P=C3=BCschel?= <s.pueschel@pengutronix.de>","In-Reply-To":"<20250707075400.9079-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>"}}]