[{"id":34970,"web_url":"https://patchwork.libcamera.org/comment/34970/","msgid":"<175310269168.560048.6187042084212926995@ping.linuxembedded.co.uk>","date":"2025-07-21T12:58:11","subject":"Re: [PATCH v1] libcamera: camera: Do not call\n\t`generateConfiguration()` synchronously","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-07-21 13:01:26)\n> Most pipeline handler methods are dispatched in the internal `CameraManager`\n> thread. `PipelineHandler::generateConfiguration()` was called directly,\n> however, which likely goes against the expectations, so call it on the\n> internal thread.\n> \n> This could not be done before 14618cdd0c80a4 (\"libcamera: base: bound_method: Move return value\")\n> because the function returns `std::unique_ptr`, and that type cannot\n> be copied.\n> \n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  src/libcamera/camera.cpp | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> index 5efeadd53..423c5f3aa 100644\n> --- a/src/libcamera/camera.cpp\n> +++ b/src/libcamera/camera.cpp\n> @@ -1206,7 +1206,8 @@ std::unique_ptr<CameraConfiguration> Camera::generateConfiguration(Span<const St\n>                 return nullptr;\n>  \n>         std::unique_ptr<CameraConfiguration> config =\n> -               d->pipe_->generateConfiguration(this, roles);\n> +               d->pipe_->invokeMethod(&PipelineHandler::generateConfiguration,\n> +                                      ConnectionTypeBlocking, this, roles);\n\nInteresting. I hope this doesn't have any (negative) impact on the\ncurrect testing of\nhttps://github.com/raspberrypi/rpicam-apps/issues/799.\n\nI think this is correct to make sure we're consistent calling things on\nthe pipeline handler in the internal threads though so:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>         if (!config) {\n>                 LOG(Camera, Debug)\n>                         << \"Pipeline handler failed to generate configuration\";\n> -- \n> 2.50.1\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 501EDC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Jul 2025 12:58:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6FC0268FB1;\n\tMon, 21 Jul 2025 14:58:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 091B268FB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jul 2025 14:58:15 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 130B4655C;\n\tMon, 21 Jul 2025 14:57: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=\"mZHmexK7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753102658;\n\tbh=36V2FcOV+fsTLAS2WgsOZDAsfY8cjngRVYQnS2eX4VQ=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=mZHmexK7gshYvmX5kDls3zCtDBr+0A0S2VMf6c7sBaecKkpemnDhU5h49G/+hsNLp\n\tbqKcO9ePIU+lYAaQWdH6sVaLocBigbsE/YlcDbAXrqmHH2k+Mh6t+dwBfA/IOzLPJE\n\t+eTkmwtFA5kKf7g+bit7X0EeEJMAzIdEk+Aig1O8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250721120126.1563367-1-barnabas.pocze@ideasonboard.com>","References":"<20250721120126.1563367-1-barnabas.pocze@ideasonboard.com>","Subject":"Re: [PATCH v1] libcamera: camera: Do not call\n\t`generateConfiguration()` synchronously","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 21 Jul 2025 13:58:11 +0100","Message-ID":"<175310269168.560048.6187042084212926995@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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":35110,"web_url":"https://patchwork.libcamera.org/comment/35110/","msgid":"<20250724204749.GU11202@pendragon.ideasonboard.com>","date":"2025-07-24T20:47:49","subject":"Re: [PATCH v1] libcamera: camera: Do not call\n\t`generateConfiguration()` synchronously","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello,\n\nOn Mon, Jul 21, 2025 at 01:58:11PM +0100, Kieran Bingham wrote:\n> Quoting Barnabás Pőcze (2025-07-21 13:01:26)\n> > Most pipeline handler methods are dispatched in the internal `CameraManager`\n> > thread. `PipelineHandler::generateConfiguration()` was called directly,\n\ns/was/is/\n\n> > however, which likely goes against the expectations, so call it on the\n> > internal thread.\n> > \n> > This could not be done before 14618cdd0c80a4 (\"libcamera: base: bound_method: Move return value\")\n\nYou can wrap the commit message and split this line.\n\n> > because the function returns `std::unique_ptr`, and that type cannot\n> > be copied.\n> > \n> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > ---\n> >  src/libcamera/camera.cpp | 3 ++-\n> >  1 file changed, 2 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> > index 5efeadd53..423c5f3aa 100644\n> > --- a/src/libcamera/camera.cpp\n> > +++ b/src/libcamera/camera.cpp\n> > @@ -1206,7 +1206,8 @@ std::unique_ptr<CameraConfiguration> Camera::generateConfiguration(Span<const St\n> >                 return nullptr;\n> >  \n> >         std::unique_ptr<CameraConfiguration> config =\n> > -               d->pipe_->generateConfiguration(this, roles);\n> > +               d->pipe_->invokeMethod(&PipelineHandler::generateConfiguration,\n> > +                                      ConnectionTypeBlocking, this, roles);\n> \n> Interesting. I hope this doesn't have any (negative) impact on the\n> currect testing of\n> https://github.com/raspberrypi/rpicam-apps/issues/799.\n> \n> I think this is correct to make sure we're consistent calling things on\n> the pipeline handler in the internal threads though so:\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >         if (!config) {\n> >                 LOG(Camera, Debug)\n> >                         << \"Pipeline handler failed to generate configuration\";","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 AACEDC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Jul 2025 20:47:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A81CD614D4;\n\tThu, 24 Jul 2025 22:47:56 +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 418A2614D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jul 2025 22:47:54 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A3F45BA;\n\tThu, 24 Jul 2025 22:47:14 +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=\"LB5OY38/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753390034;\n\tbh=QMK1DD1FnMqe1mwwJZW7e5IcPwKdH3hXDMxtptyntNc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LB5OY38/rF9gUqTg/TDorpf4YUWRxnYvDal1Rvuqb2kuGAqBDH31q4/MrpOhksR+M\n\tchPEajJfKpv24usGv6bVI5vg31ihDqXZCEE+PzMF5RxH1lA2ukIQwMr4UHf4guaylf\n\tV0f6MBkBvxG/5OVapu675uJzrPLu7ANLUvFXi2y8=","Date":"Thu, 24 Jul 2025 23:47:49 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1] libcamera: camera: Do not call\n\t`generateConfiguration()` synchronously","Message-ID":"<20250724204749.GU11202@pendragon.ideasonboard.com>","References":"<20250721120126.1563367-1-barnabas.pocze@ideasonboard.com>\n\t<175310269168.560048.6187042084212926995@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<175310269168.560048.6187042084212926995@ping.linuxembedded.co.uk>","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":35111,"web_url":"https://patchwork.libcamera.org/comment/35111/","msgid":"<c9dae332-2fbc-4a88-8162-a98d798c8a72@ideasonboard.com>","date":"2025-07-25T07:05:23","subject":"Re: [PATCH v1] libcamera: camera: Do not call\n\t`generateConfiguration()` synchronously","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 07. 24. 22:47 keltezéssel, Laurent Pinchart írta:\n> Hello,\n> \n> On Mon, Jul 21, 2025 at 01:58:11PM +0100, Kieran Bingham wrote:\n>> Quoting Barnabás Pőcze (2025-07-21 13:01:26)\n>>> Most pipeline handler methods are dispatched in the internal `CameraManager`\n>>> thread. `PipelineHandler::generateConfiguration()` was called directly,\n> \n> s/was/is/\n> \n>>> however, which likely goes against the expectations, so call it on the\n>>> internal thread.\n>>>\n>>> This could not be done before 14618cdd0c80a4 (\"libcamera: base: bound_method: Move return value\")\n> \n> You can wrap the commit message and split this line.\n\nI have rewritten it as follows:\n\n     Before 14618cdd0c80a4 (\"libcamera: base: bound_method: Move return value\")\n     this could not be done because the function returns `std::unique_ptr`, and\n     that type cannot be copied.\n\nI believe it is important to keep the commit title in one line.\n\n\nRegards,\nBarnabás Pőcze\n\n> \n>>> because the function returns `std::unique_ptr`, and that type cannot\n>>> be copied.\n>>>\n>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>>> ---\n>>>   src/libcamera/camera.cpp | 3 ++-\n>>>   1 file changed, 2 insertions(+), 1 deletion(-)\n>>>\n>>> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n>>> index 5efeadd53..423c5f3aa 100644\n>>> --- a/src/libcamera/camera.cpp\n>>> +++ b/src/libcamera/camera.cpp\n>>> @@ -1206,7 +1206,8 @@ std::unique_ptr<CameraConfiguration> Camera::generateConfiguration(Span<const St\n>>>                  return nullptr;\n>>>   \n>>>          std::unique_ptr<CameraConfiguration> config =\n>>> -               d->pipe_->generateConfiguration(this, roles);\n>>> +               d->pipe_->invokeMethod(&PipelineHandler::generateConfiguration,\n>>> +                                      ConnectionTypeBlocking, this, roles);\n>>\n>> Interesting. I hope this doesn't have any (negative) impact on the\n>> currect testing of\n>> https://github.com/raspberrypi/rpicam-apps/issues/799.\n>>\n>> I think this is correct to make sure we're consistent calling things on\n>> the pipeline handler in the internal threads though so:\n>>\n>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n>>>          if (!config) {\n>>>                  LOG(Camera, Debug)\n>>>                          << \"Pipeline handler failed to generate configuration\";\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 BCBDBC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Jul 2025 07:05:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55F3269082;\n\tFri, 25 Jul 2025 09:05:32 +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 A1E9469025\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jul 2025 09:05:27 +0200 (CEST)","from [192.168.33.15] (185.221.140.39.nat.pool.zt.hu\n\t[185.221.140.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CC4C99CE;\n\tFri, 25 Jul 2025 09:04:47 +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=\"pMht4CDo\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753427088;\n\tbh=kombqLIGHnLZFJiy5GcKg9wK7eSMG0+ciaZDBXgjBAA=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=pMht4CDooDiFPDkJXV5nGjVotM2kTcusdlvM9Ae73a5EDdcCfPATy4xU6RCHqRv8J\n\t3X58LP/aHcHW1nsxNyeA7eBXYcICA5CS8iJxXLpJL+WwPgUUEbhD6CQ/E8Dyuln0yt\n\t+EbO4XryXWTB0JYnmo4OuTPwa5BlKpoFr4zLQyxE=","Message-ID":"<c9dae332-2fbc-4a88-8162-a98d798c8a72@ideasonboard.com>","Date":"Fri, 25 Jul 2025 09:05:23 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1] libcamera: camera: Do not call\n\t`generateConfiguration()` synchronously","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20250721120126.1563367-1-barnabas.pocze@ideasonboard.com>\n\t<175310269168.560048.6187042084212926995@ping.linuxembedded.co.uk>\n\t<20250724204749.GU11202@pendragon.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250724204749.GU11202@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>"}}]