[{"id":34845,"web_url":"https://patchwork.libcamera.org/comment/34845/","msgid":"<rcyyudg34ud3wm35f3icqsms43sdbokdelyx5k5i2gmminsq5y@wktfe3qtmbnj>","date":"2025-07-10T14:21:25","subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"Hi Milan,\n\nThank you for the patch.\n\nOn Mon, Jul 07, 2025 at 05:58:47PM +0200, Milan Zamazal wrote:\n> When software ISP is enabled, we want to be able to provide a raw stream\n> in addition to the processed stream.  For this purpose, we need two\n> streams.  If only the processed stream is requested, it doesn't harm to\n> allocate two.\n> \n> This is a hack for the lack of a better easy option.  The number of\n> streams is determined as a camera property in the pipeline matching.\n\nIt is determined only for the converters case right? For\nSoftwareISP=true, it can be determined later in the stage, no? Are there\nany downsides of doing that?\n\n> The actual number of streams needed (one or two) is determined only when\n> examining roles in SimplePipelineHandler::generateConfiguration.\n\nI don't think numStreams it's set in stone from the start, except for\nthe converters case. If SoftISP is enabled, we should be able to\nresize the streams_ vector / determine the actual no. of streams\nrequired.\n\n> \n> In theory, software ISP could produce multiple processed streams but\n> this is out of scope of this patch series.  Hence two streams are\n> sufficient at the moment.\n> \n> When software ISP is not enabled, the camera won't be able to produce\n> multiple streams (assuming there's no hardware converter) and only\n> single stream should be allocated as before.  The simple pipeline\n> handler assumes there's a linear pipeline from the camera sensor to a\n> video capture device, and only supports a single stream.  Branches in\n> the hardware pipeline that would allow capturing multiple streams from\n> the same camera sensor are not supported.  We have no plan to change\n> that, as a device that can produce multiple streams will likely be\n> better supported by a dedicated pipeline handler.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 11 ++++++++++-\n>  1 file changed, 10 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index d45480fe7..a900918db 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -1723,7 +1723,16 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n>  \t\t}\n>  \t}\n>  \n> -\tswIspEnabled_ = info->swIspEnabled;\n> +\tif (info->swIspEnabled) {\n> +\t\t/*\n> +\t\t * When the software ISP is enabled, the simple pipeline handler\n> +\t\t * exposes the raw stream, giving a total of two streams. This\n> +\t\t * is mutally exclusive with the presence of a converter.\n> +\t\t */\n> +\t\tASSERT(!converter_);\n> +\t\tnumStreams = 2;\n> +\t\tswIspEnabled_ = true;\n> +\t}\n\nWon't swIspEnabled_ will remain un-initialized if, info->swIspEnabled=false ?\nI don't see getting it initialised elsewhere.\n\n>  \n>  \t/* Locate the sensors. */\n>  \tstd::vector<MediaEntity *> sensors = locateSensors(media);\n> -- \n> 2.50.0\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 265D1C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Jul 2025 14:21:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 13A5268EFF;\n\tThu, 10 Jul 2025 16:21:29 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E4AE568EE7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jul 2025 16:21:26 +0200 (CEST)","from [49.36.69.85] (helo=uajain) by fanzine2.igalia.com with\n\tesmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uZs9M-00ExsF-D2; Thu, 10 Jul 2025 16:21:24 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"k2AgqtBH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=g4RWNCtmDtqhqNSIHNOQaeGZV/dnK/UEOU8kXyMdmBA=;\n\tb=k2AgqtBHD4K+46Y7mSUsq1l5eO\n\tsetV7utH4opjvIvZ+pYytHi3bUgWc5obVDLBPFs8TDe8RmC6S6/y00MKWsh4ie/JowIlhV1zOh7NH\n\t0x1w2UBH1RWqlXIg+9pOG1LhsMLzyMccpFdXw1Ti5O5JtUt+uxicFxm7ab8MnVxvNXRnjdkEup941\n\t1cv+eV2B73NGJ7jseuR8NUlZnogfIsNVPtfneeiu7MyG0lcf9jyDfF8G48/piCDZ+T/yP55m0lU/S\n\tsUXHzY87cHGobi4OYDeLv+olrw2A5MjLcGCB1aJMLdOdNRr6kdXwXoT3s/XIsZGqYZzQNvMlAzxwD\n\tc484OWaQ==;","Date":"Thu, 10 Jul 2025 19:51:25 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","Message-ID":"<rcyyudg34ud3wm35f3icqsms43sdbokdelyx5k5i2gmminsq5y@wktfe3qtmbnj>","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-3-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20250707155856.33436-3-mzamazal@redhat.com>","User-Agent":"NeoMutt/20250510-dirty","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":34849,"web_url":"https://patchwork.libcamera.org/comment/34849/","msgid":"<857c0fditi.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-07-10T18:03:37","subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Umang,\n\nthank you for review.\n\nUmang Jain <uajain@igalia.com> writes:\n\n> Hi Milan,\n>\n> Thank you for the patch.\n>\n> On Mon, Jul 07, 2025 at 05:58:47PM +0200, Milan Zamazal wrote:\n>> When software ISP is enabled, we want to be able to provide a raw stream\n>> in addition to the processed stream.  For this purpose, we need two\n>> streams.  If only the processed stream is requested, it doesn't harm to\n>> allocate two.\n>> \n>> This is a hack for the lack of a better easy option.  The number of\n>> streams is determined as a camera property in the pipeline matching.\n>\n> It is determined only for the converters case right? For\n> SoftwareISP=true, it can be determined later in the stage, no? Are there\n> any downsides of doing that?\n\nIt's a tempting idea but I'm not sure it can be done this way.\nCurrently, it fails in Camera::generateConfiguration on\n\n  if (roles.size() > streams().size())\n  \treturn nullptr;\n\n>> The actual number of streams needed (one or two) is determined only when\n>> examining roles in SimplePipelineHandler::generateConfiguration.\n>\n> I don't think numStreams it's set in stone from the start, except for\n> the converters case. If SoftISP is enabled, we should be able to\n> resize the streams_ vector / determine the actual no. of streams\n> required.\n>\n>> \n>> In theory, software ISP could produce multiple processed streams but\n>> this is out of scope of this patch series.  Hence two streams are\n>> sufficient at the moment.\n>> \n>> When software ISP is not enabled, the camera won't be able to produce\n>> multiple streams (assuming there's no hardware converter) and only\n>> single stream should be allocated as before.  The simple pipeline\n>> handler assumes there's a linear pipeline from the camera sensor to a\n>> video capture device, and only supports a single stream.  Branches in\n>> the hardware pipeline that would allow capturing multiple streams from\n>> the same camera sensor are not supported.  We have no plan to change\n>> that, as a device that can produce multiple streams will likely be\n>> better supported by a dedicated pipeline handler.\n>> \n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>  src/libcamera/pipeline/simple/simple.cpp | 11 ++++++++++-\n>>  1 file changed, 10 insertions(+), 1 deletion(-)\n>> \n>> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>> index d45480fe7..a900918db 100644\n>> --- a/src/libcamera/pipeline/simple/simple.cpp\n>> +++ b/src/libcamera/pipeline/simple/simple.cpp\n>> @@ -1723,7 +1723,16 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n>>  \t\t}\n>>  \t}\n>>  \n>> -\tswIspEnabled_ = info->swIspEnabled;\n>> +\tif (info->swIspEnabled) {\n>> +\t\t/*\n>> +\t\t * When the software ISP is enabled, the simple pipeline handler\n>> +\t\t * exposes the raw stream, giving a total of two streams. This\n>> +\t\t * is mutally exclusive with the presence of a converter.\n>> +\t\t */\n>> +\t\tASSERT(!converter_);\n>> +\t\tnumStreams = 2;\n>> +\t\tswIspEnabled_ = true;\n>> +\t}\n>\n> Won't swIspEnabled_ will remain un-initialized if, info->swIspEnabled=false ?\n> I don't see getting it initialised elsewhere.\n\nRight, it should be initialised here, will fix.\n\n>>  \n>>  \t/* Locate the sensors. */\n>>  \tstd::vector<MediaEntity *> sensors = locateSensors(media);\n>> -- \n>> 2.50.0\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 2B318BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Jul 2025 18:03:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 478C368F06;\n\tThu, 10 Jul 2025 20:03:46 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E01F068EE7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jul 2025 20:03:43 +0200 (CEST)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-368-oMP__0HmO_uHznTW1RhBhA-1; Thu, 10 Jul 2025 14:03:41 -0400","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-450d64026baso7063905e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jul 2025 11:03:41 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-454cd485059sm81666945e9.0.2025.07.10.11.03.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Jul 2025 11:03:38 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"PXdeONUv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1752170622;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=ngHsuHbhsg3AbwcZrG3mqheeotSOXWbbgJC78TPbx8o=;\n\tb=PXdeONUvzUXkYKXqwY7AiX2EliuHt9RhnDIaVV+/eILrFj/pu/cgQfCPps8Ve4v27b8w9c\n\tsxTccCr7QQQ+SL51SKn+Pt9ACc2yU6wMB3BWK4k/tnr7GWM8mepPTswDBWpEbVHig6SSbX\n\t0olNe+keccObM5f4As5Fljy8EwsYj1k=","X-MC-Unique":"oMP__0HmO_uHznTW1RhBhA-1","X-Mimecast-MFC-AGG-ID":"oMP__0HmO_uHznTW1RhBhA_1752170620","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1752170620; x=1752775420;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=ngHsuHbhsg3AbwcZrG3mqheeotSOXWbbgJC78TPbx8o=;\n\tb=i0YkLgUvICrZmVYT72YaOFE4dO+OSSxS8i/mwfvsiqrnMSw0tfywOfyv2kyT+G4NPh\n\tBPvTSK9soN75lei/JtQdgcL94kmBiqDknhrwYD46MNEnm51cheksHu0U1TuA4YcW4HUX\n\tMiuEFxphhAf1S8rj3BMycwRz1DGK7mnblwYk3Z9QTtj/IC+1rhKxdc6V59LLyhOJ7MX3\n\t5KmRWfJ4geXRe47Fr9bmsxHt9N+i+PbPXXBAIMT/PxqL+NhBmt15scMdoivKS9JEIdnJ\n\tJ0SRfLfySsfwCTxzV3wvnfp8mAmqSZVAaCuN1KYNpWllsehyhcbnItF1wnfoOTLSoSUM\n\tT1ww==","X-Gm-Message-State":"AOJu0YzeaujYnAs7uQV7fFNoBlBjUy11vhZSajDoerwd5IxFV2zzOEj6\n\t9tgTNjSbudKLWkZMYQC0m3ADn46J84837+crmxjOSn9ur4ReXvj5wKzuzpYCdFP6gAy1+iKXznE\n\teFLoqqSJpA3Zqj76nRNCsYh8Lu6wFDKj+r1m91h5qVGfzs+ov8e6z7KOexOxeoJo0T54U6aglqZ\n\tM=","X-Gm-Gg":"ASbGncvo3tPk4fHZoskAGSZx8+k7qjzTNrfSW//nHxSEHFDyLzh5cq25pCkyj0CfLpW\n\tv8l83xuayKf8VKE4i1Hf/wMsjiCJ1GaETutmefXK5xBAHihFygbH4AjM2TPU+mi8POmAIoKVOpv\n\taVL+6rHVXwZpPA6l6wihqNlK4rpetcZK/nIpuK6vzVCEzZmmPnO3tM+AA+12ZlpB4AnLmSueLZg\n\t5VJ3gjiwn4sgGcgKIWP4nFt0nOZLX92oMfuXb3TD0a84K26m6QqrpkN9mu+hX0OPn6sAVF7m3co\n\tONAHXQnKXmsNpzDYZ/WnxlmOjWX8ItY1lJmvZBiSxpSBUWBg55CzPhfpr9vWCoSdQze0rgQJMYE\n\t=","X-Received":["by 2002:a05:600c:19d1:b0:441:d4e8:76c6 with SMTP id\n\t5b1f17b1804b1-454d53f3136mr81542595e9.30.1752170619898; \n\tThu, 10 Jul 2025 11:03:39 -0700 (PDT)","by 2002:a05:600c:19d1:b0:441:d4e8:76c6 with SMTP id\n\t5b1f17b1804b1-454d53f3136mr81542095e9.30.1752170619471; \n\tThu, 10 Jul 2025 11:03:39 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGbmt7Qlrqv0BT/3OTHMnlBrtfCt9F311684cylWMxtpNlOg2nE5J0WiKK0XSZ+3+9/efaFJw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Umang Jain <uajain@igalia.com>","Cc":"libcamera-devel@lists.libcamera.org,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab?=\n\t=?utf-8?b?w6FzIFDFkWN6ZQ==?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","In-Reply-To":"<rcyyudg34ud3wm35f3icqsms43sdbokdelyx5k5i2gmminsq5y@wktfe3qtmbnj>\n\t(Umang Jain's message of \"Thu, 10 Jul 2025 19:51:25 +0530\")","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-3-mzamazal@redhat.com>\n\t<rcyyudg34ud3wm35f3icqsms43sdbokdelyx5k5i2gmminsq5y@wktfe3qtmbnj>","Date":"Thu, 10 Jul 2025 20:03:37 +0200","Message-ID":"<857c0fditi.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"aU-flOGCbLfDg9B8kfZkWEkHOEkeEjiHQun41wUW4pc_1752170620","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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":34854,"web_url":"https://patchwork.libcamera.org/comment/34854/","msgid":"<allxf4lnpao3dcj7v6hm7vgnkpprcnypbkwuaofpca7njdmk6o@ghgqufnjgiit>","date":"2025-07-11T07:34:31","subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"On Thu, Jul 10, 2025 at 08:03:37PM +0200, Milan Zamazal wrote:\n> Hi Umang,\n> \n> thank you for review.\n> \n> Umang Jain <uajain@igalia.com> writes:\n> \n> > Hi Milan,\n> >\n> > Thank you for the patch.\n> >\n> > On Mon, Jul 07, 2025 at 05:58:47PM +0200, Milan Zamazal wrote:\n> >> When software ISP is enabled, we want to be able to provide a raw stream\n> >> in addition to the processed stream.  For this purpose, we need two\n> >> streams.  If only the processed stream is requested, it doesn't harm to\n> >> allocate two.\n> >> \n> >> This is a hack for the lack of a better easy option.  The number of\n> >> streams is determined as a camera property in the pipeline matching.\n> >\n> > It is determined only for the converters case right? For\n> > SoftwareISP=true, it can be determined later in the stage, no? Are there\n> > any downsides of doing that?\n> \n> It's a tempting idea but I'm not sure it can be done this way.\n> Currently, it fails in Camera::generateConfiguration on\n> \n>   if (roles.size() > streams().size())\n>   \treturn nullptr;\n> \n\nOh yes - I see it now, it is a sticky situation on this.\nstreams_ is a bit static parameter while creating the camera.\nFor Simple<>SoftISP configuration, one can theoretically have as\nmany streams they want, right? The check seems to be coming from a time\nwhere software-ISP was proabably not been conceived.\n\n\n> >> The actual number of streams needed (one or two) is determined only when\n> >> examining roles in SimplePipelineHandler::generateConfiguration.\n> >\n> > I don't think numStreams it's set in stone from the start, except for\n> > the converters case. If SoftISP is enabled, we should be able to\n> > resize the streams_ vector / determine the actual no. of streams\n> > required.\n> >\n> >> \n> >> In theory, software ISP could produce multiple processed streams but\n> >> this is out of scope of this patch series.  Hence two streams are\n> >> sufficient at the moment.\n> >> \n> >> When software ISP is not enabled, the camera won't be able to produce\n> >> multiple streams (assuming there's no hardware converter) and only\n> >> single stream should be allocated as before.  The simple pipeline\n> >> handler assumes there's a linear pipeline from the camera sensor to a\n> >> video capture device, and only supports a single stream.  Branches in\n> >> the hardware pipeline that would allow capturing multiple streams from\n> >> the same camera sensor are not supported.  We have no plan to change\n> >> that, as a device that can produce multiple streams will likely be\n> >> better supported by a dedicated pipeline handler.\n> >> \n> >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> >> ---\n> >>  src/libcamera/pipeline/simple/simple.cpp | 11 ++++++++++-\n> >>  1 file changed, 10 insertions(+), 1 deletion(-)\n> >> \n> >> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> >> index d45480fe7..a900918db 100644\n> >> --- a/src/libcamera/pipeline/simple/simple.cpp\n> >> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> >> @@ -1723,7 +1723,16 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n> >>  \t\t}\n> >>  \t}\n> >>  \n> >> -\tswIspEnabled_ = info->swIspEnabled;\n> >> +\tif (info->swIspEnabled) {\n> >> +\t\t/*\n> >> +\t\t * When the software ISP is enabled, the simple pipeline handler\n> >> +\t\t * exposes the raw stream, giving a total of two streams. This\n> >> +\t\t * is mutally exclusive with the presence of a converter.\n> >> +\t\t */\n> >> +\t\tASSERT(!converter_);\n> >> +\t\tnumStreams = 2;\n> >> +\t\tswIspEnabled_ = true;\n> >> +\t}\n> >\n> > Won't swIspEnabled_ will remain un-initialized if, info->swIspEnabled=false ?\n> > I don't see getting it initialised elsewhere.\n> \n> Right, it should be initialised here, will fix.\n> \n> >>  \n> >>  \t/* Locate the sensors. */\n> >>  \tstd::vector<MediaEntity *> sensors = locateSensors(media);\n> >> -- \n> >> 2.50.0\n> >> \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 2764DC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Jul 2025 07:34:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5168E68F0A;\n\tFri, 11 Jul 2025 09:34:38 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 681B868EA8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 09:34:34 +0200 (CEST)","from [49.43.35.133] (helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1ua8HB-00FH8r-52; Fri, 11 Jul 2025 09:34:33 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"UuS6VgJY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=7F1x4VIMyPwQHOPvjgh6aRFZjcg5sDLtUc9aBd+aAKI=;\n\tb=UuS6VgJY+VNvR7lyPUPOT6Pob1\n\tadS3jQZj4ce2PVzuMOd4UMN9XA1CuinC3bB7ee82UwIQnA53UOXlsczG3VAKtV97N2lz/KuP18OCH\n\tuBeLTRok9vjL24ANsxg0Yx0hE/UNAUTBaWZ4AZspEErw6d7MRTIa/TeKXCivzAzD12wbkZapbVHLh\n\tSpPgSqtAJEPSq4RLVsyC9Z6AzHBspFT5Uh7MtW7mc78z3m57mDvFfcb+rp9ch8kzsawDtKwjW2V4N\n\t+CQgqISG7Ufkr5fNDnjT4HXm2JCc0SOcta57sc//UmHpJNj2hypdkrTqn+6/vncQ5BmPaVtbdVWjk\n\ta3Xpengg==;","Date":"Fri, 11 Jul 2025 13:04:31 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","Message-ID":"<allxf4lnpao3dcj7v6hm7vgnkpprcnypbkwuaofpca7njdmk6o@ghgqufnjgiit>","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-3-mzamazal@redhat.com>\n\t<rcyyudg34ud3wm35f3icqsms43sdbokdelyx5k5i2gmminsq5y@wktfe3qtmbnj>\n\t<857c0fditi.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<857c0fditi.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"NeoMutt/20250510-dirty","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":34859,"web_url":"https://patchwork.libcamera.org/comment/34859/","msgid":"<85sej2dih4.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-07-11T12:23:19","subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Umang Jain <uajain@igalia.com> writes:\n\n> On Thu, Jul 10, 2025 at 08:03:37PM +0200, Milan Zamazal wrote:\n>> Hi Umang,\n>> \n>\n>> thank you for review.\n>> \n>> Umang Jain <uajain@igalia.com> writes:\n>> \n>> > Hi Milan,\n>> >\n>> > Thank you for the patch.\n>> >\n>> > On Mon, Jul 07, 2025 at 05:58:47PM +0200, Milan Zamazal wrote:\n>> >> When software ISP is enabled, we want to be able to provide a raw stream\n>> >> in addition to the processed stream.  For this purpose, we need two\n>> >> streams.  If only the processed stream is requested, it doesn't harm to\n>> >> allocate two.\n>> >> \n>> >> This is a hack for the lack of a better easy option.  The number of\n>> >> streams is determined as a camera property in the pipeline matching.\n>> >\n>> > It is determined only for the converters case right? For\n>> > SoftwareISP=true, it can be determined later in the stage, no? Are there\n>> > any downsides of doing that?\n>> \n>> It's a tempting idea but I'm not sure it can be done this way.\n>> Currently, it fails in Camera::generateConfiguration on\n>> \n>>   if (roles.size() > streams().size())\n>>   \treturn nullptr;\n>> \n>\n> Oh yes - I see it now, it is a sticky situation on this.\n> streams_ is a bit static parameter while creating the camera.\n> For Simple<>SoftISP configuration, one can theoretically have as\n> many streams they want, right? \n\nI think so.\n\n> The check seems to be coming from a time where software-ISP was\n> proabably not been conceived.\n\nIt does but it doesn't prevent having more streams.  I'm not keen on\ntouching it, it could cause problems in other pipelines.  Considering\nthe raw stream effort for simple pipeline has been in review with slow\nprogress for half a year, I'd keep this series as simple as possible.\nSetting numStreams to 2 is certainly a hack but it serves the purpose\nfor now and can be improved later if needed.\n\n>> >> The actual number of streams needed (one or two) is determined only when\n>> >> examining roles in SimplePipelineHandler::generateConfiguration.\n>> >\n>> > I don't think numStreams it's set in stone from the start, except for\n>> > the converters case. If SoftISP is enabled, we should be able to\n>> > resize the streams_ vector / determine the actual no. of streams\n>> > required.\n>> >\n>> >> \n>> >> In theory, software ISP could produce multiple processed streams but\n>> >> this is out of scope of this patch series.  Hence two streams are\n>> >> sufficient at the moment.\n>> >> \n>> >> When software ISP is not enabled, the camera won't be able to produce\n>> >> multiple streams (assuming there's no hardware converter) and only\n>> >> single stream should be allocated as before.  The simple pipeline\n>> >> handler assumes there's a linear pipeline from the camera sensor to a\n>> >> video capture device, and only supports a single stream.  Branches in\n>> >> the hardware pipeline that would allow capturing multiple streams from\n>> >> the same camera sensor are not supported.  We have no plan to change\n>> >> that, as a device that can produce multiple streams will likely be\n>> >> better supported by a dedicated pipeline handler.\n>> >> \n>> >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> >> ---\n>> >>  src/libcamera/pipeline/simple/simple.cpp | 11 ++++++++++-\n>> >>  1 file changed, 10 insertions(+), 1 deletion(-)\n>> >> \n>> >> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>> >> index d45480fe7..a900918db 100644\n>> >> --- a/src/libcamera/pipeline/simple/simple.cpp\n>> >> +++ b/src/libcamera/pipeline/simple/simple.cpp\n>> >> @@ -1723,7 +1723,16 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n>> >>  \t\t}\n>> >>  \t}\n>> >>  \n>> >> -\tswIspEnabled_ = info->swIspEnabled;\n>> >> +\tif (info->swIspEnabled) {\n>> >> +\t\t/*\n>> >> +\t\t * When the software ISP is enabled, the simple pipeline handler\n>> >> +\t\t * exposes the raw stream, giving a total of two streams. This\n>> >> +\t\t * is mutally exclusive with the presence of a converter.\n>> >> +\t\t */\n>> >> +\t\tASSERT(!converter_);\n>> >> +\t\tnumStreams = 2;\n>> >> +\t\tswIspEnabled_ = true;\n>> >> +\t}\n>> >\n>> > Won't swIspEnabled_ will remain un-initialized if, info->swIspEnabled=false ?\n>> > I don't see getting it initialised elsewhere.\n>> \n>> Right, it should be initialised here, will fix.\n>> \n>> >>  \n>> >>  \t/* Locate the sensors. */\n>> >>  \tstd::vector<MediaEntity *> sensors = locateSensors(media);\n>> >> -- \n>> >> 2.50.0\n>> >> \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 224AABE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Jul 2025 12:23:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E9D268F10;\n\tFri, 11 Jul 2025 14:23:28 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D18F268E30\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 14:23:26 +0200 (CEST)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-540-2I2_bRchOPWf3wdziTsFrg-1; Fri, 11 Jul 2025 08:23:22 -0400","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-455e9daab1cso1336115e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jul 2025 05:23:22 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-454d5051e7esm86410085e9.11.2025.07.11.05.23.19\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 11 Jul 2025 05:23:20 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"WaJeQDh8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1752236605;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=qUixTLSb+pZdXy4En7DBXqukcYgqfym/LrIBL9V13ek=;\n\tb=WaJeQDh8tBAMKNkfDZKaGQHq4frfoM4CDfODqo+/oQosgsqbxZ0BrdY6pzjJ3wTN/7lyeC\n\txmOXAtsXHChCw0S1gTWNzDXmW0Qv0t+hisZP0FpA8aStXdGh5rVapR6dWONee1AuADz8ez\n\tyzbigsUE/ZcgMA4hLB8WPaFhFoOzbvo=","X-MC-Unique":"2I2_bRchOPWf3wdziTsFrg-1","X-Mimecast-MFC-AGG-ID":"2I2_bRchOPWf3wdziTsFrg_1752236601","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1752236601; x=1752841401;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=qUixTLSb+pZdXy4En7DBXqukcYgqfym/LrIBL9V13ek=;\n\tb=jeo70e9G7SEGBLl6RQTx/W8PozTbC4kFDAfXQNJEG/HWu1+cLuhYcI3tHF2KYICFve\n\toc0C9EnOIwu4HkR/jrvbAjcTiCOnZlgIsXu3tfgHpjNbh+QaIdAYQnI/FUbWBV9WYod7\n\tzFZ6q8nyyr3eOHDPnp5oIYbyFC3gC+1VQtTZjdfHjdqwCbJ/srZrpW/Sq91LwMnNLL0Y\n\tAn/f9vmINU3UtWvlzLcimJcAATtSwIhnUxbDxa0hSItUc0/S3iQSHsqvAxGL3P+WFJM8\n\tfLAmL8yeyY/Qu4L7opXJnOISiOBL1PmjVSFzINinwAERRcvH4LyT0VjNaCRMKzjJ6JBE\n\ttzHA==","X-Gm-Message-State":"AOJu0YxM7tpFPxfYWYkgU7nq8wzsTXawcnNIh7l3Uw3+4oPGY2ClvkJO\n\tbxjCfxsCKc/elf1eQ6/zeAtvxwTZqafNtchcI0RxPqHGs8YrCmASM5ScW+Hb8gCBvEGJkdKfFAw\n\tc6wxIIDLdbOcTZ9VzKTDJIjvaC6h7ViLH01AC/qhWempMaj7HVylQ5TkEo/oZh7OV+OSCR9sfgn\n\t4=","X-Gm-Gg":"ASbGnctgq4eZV+bY9Ya/c/sl2TfGJQ9HtRzcTc0JJAhINHPnaVfeezH5Be9vD54cKu9\n\tSm+5cppkgA4jwKI2U1tfQzik/opmHhSQwXKfGjk31u8lQKwBpzTtqYPsbPhxMYMYzeZkfhp7DN1\n\tCzh9+VzfoLJcIx6vqYJCwyLklanhRPFmd6dA4alXSu2eJB7ECQtXwMMMe+u9DZRlkqswVITDDkA\n\t+mJ41QY6jti2IUXL0x/R7+43bO8u2Af/wsokaRmrSpP9AyoSy7+7pW0ekVSdYnV/uPlWeu5r0Jw\n\t3UkSAw1AX22NyC2PEGLVU5QQrBnRhEJVXw+osU1slo/690mqRMVW4pEUBmjS7OSkxzlz+Xynp5R\n\tKaZRe4DYHi2Wwu4zy","X-Received":["by 2002:a05:600c:1da7:b0:454:aec9:1db5 with SMTP id\n\t5b1f17b1804b1-454ec2769dcmr33137365e9.16.1752236601115; \n\tFri, 11 Jul 2025 05:23:21 -0700 (PDT)","by 2002:a05:600c:1da7:b0:454:aec9:1db5 with SMTP id\n\t5b1f17b1804b1-454ec2769dcmr33136925e9.16.1752236600667; \n\tFri, 11 Jul 2025 05:23:20 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGNde9TQWvFZt/COdw6Rgp53F52HXw0MdBq+aFrXchdC6Dc7249gyqs5x47JuFsuk30gTP8ag==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Umang Jain <uajain@igalia.com>","Cc":"libcamera-devel@lists.libcamera.org,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab?=\n\t=?utf-8?b?w6FzIFDFkWN6ZQ==?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v9 02/10] libcamera: simple: Set the number of software\n\tISP streams to 2","In-Reply-To":"<allxf4lnpao3dcj7v6hm7vgnkpprcnypbkwuaofpca7njdmk6o@ghgqufnjgiit>\n\t(Umang Jain's message of \"Fri, 11 Jul 2025 13:04:31 +0530\")","References":"<20250707155856.33436-1-mzamazal@redhat.com>\n\t<20250707155856.33436-3-mzamazal@redhat.com>\n\t<rcyyudg34ud3wm35f3icqsms43sdbokdelyx5k5i2gmminsq5y@wktfe3qtmbnj>\n\t<857c0fditi.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<allxf4lnpao3dcj7v6hm7vgnkpprcnypbkwuaofpca7njdmk6o@ghgqufnjgiit>","Date":"Fri, 11 Jul 2025 14:23:19 +0200","Message-ID":"<85sej2dih4.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"5Vy8Wc0CYp8sfRS_kHsPm_OAlTfaNjMY59JUloK6GHk_1752236601","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]