[{"id":18023,"web_url":"https://patchwork.libcamera.org/comment/18023/","msgid":"<CAEmqJPpKYLKHB0p=kNvuQd=ZLEJwB9Vp9KVWv9xtC8xrW451jw@mail.gmail.com>","date":"2021-07-08T09:26:54","subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Nicolas,\n\nThank you for your patch.\n\nOn Wed, 7 Jul 2021 at 15:42, Nícolas F. R. A. Prado <nfraprado@collabora.com>\nwrote:\n\n> The MinNumRequests property reports the bare minimum number of requests\n> needed in the camera pipeline for capture to be possible. It is equal to\n> the number of buffers required by the driver. At this quantity, there's\n> no guarantee that frames won't be dropped or that manual per-frame\n> controls will apply correctly. The quantity needed for those may be\n> added as separate properties in the future.\n>\n> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp               | 6 ++++++\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 2 ++\n>  src/libcamera/pipeline/simple/simple.cpp           | 2 ++\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       | 2 ++\n>  src/libcamera/pipeline/vimc/vimc.cpp               | 3 +++\n>  src/libcamera/property_ids.yaml                    | 9 +++++++++\n>  7 files changed, 30 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 76c3bb3d8aa9..017018c845fa 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -1111,6 +1111,12 @@ int PipelineHandlerIPU3::registerCameras()\n>                 /* Initialize the camera properties. */\n>                 data->properties_ = cio2->sensor()->properties();\n>\n> +               /*\n> +                * \\todo Make sure this is correct even after the stream is\n> +                * configured to CIO2\n> +                */\n> +               data->properties_.set(properties::MinNumRequests, 1);\n> +\n>                 ret = initControls(data.get());\n>                 if (ret)\n>                         continue;\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 082eb1ee1c23..f99a21de6918 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1045,6 +1045,12 @@ bool PipelineHandlerRPi::match(DeviceEnumerator\n> *enumerator)\n>         /* Initialize the camera properties. */\n>         data->properties_ = data->sensor_->properties();\n>\n> +       /*\n> +        * \\todo Make sure this is correct after the stream is configured\n> for\n> +        * any of the roles\n> +        */\n> +       data->properties_.set(properties::MinNumRequests, 1);\n> +\n>\n\nCould you elaborate a bit on the above \\todo, I'm not entirely sure it is\nrelevant for the\nRaspberry Pi pipeline handler.\n\nThanks,\nNaush\n\n        /*\n>          * Set a default value for the ScalerCropMaximum property to show\n>          * that we support its use, however, initialise it to zero because\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 00df4f0b3e6b..b5cbf2394b1c 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -24,6 +24,7 @@\n>  #include <libcamera/ipa/core_ipa_interface.h>\n>  #include <libcamera/ipa/rkisp1_ipa_interface.h>\n>  #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n> +#include <libcamera/property_ids.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n>\n> @@ -944,6 +945,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity\n> *sensor)\n>\n>         /* Initialize the camera properties. */\n>         data->properties_ = data->sensor_->properties();\n> +       data->properties_.set(properties::MinNumRequests, 3);\n>\n>         /*\n>          * \\todo Read dealy values from the sensor itself or from a\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp\n> b/src/libcamera/pipeline/simple/simple.cpp\n> index b29fff9820e5..c4adea61519f 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -25,6 +25,7 @@\n>\n>  #include <libcamera/camera.h>\n>  #include <libcamera/control_ids.h>\n> +#include <libcamera/property_ids.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n>\n> @@ -436,6 +437,7 @@ int SimpleCameraData::init()\n>         }\n>\n>         properties_ = sensor_->properties();\n> +       properties_.set(properties::MinNumRequests, 3);\n>\n>         return 0;\n>  }\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index 0f634b8da609..0258111ad6cf 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -525,6 +525,8 @@ int UVCCameraData::init(MediaDevice *media)\n>         properties_.set(properties::PixelArraySize, resolution);\n>         properties_.set(properties::PixelArrayActiveAreas, {\n> Rectangle(resolution) });\n>\n> +       properties_.set(properties::MinNumRequests, 1);\n> +\n>         /* Initialise the supported controls. */\n>         ControlInfoMap::Map ctrls;\n>\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp\n> b/src/libcamera/pipeline/vimc/vimc.cpp\n> index 12f7517fd0ae..8c3f7ccb46bd 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -21,6 +21,7 @@\n>  #include <libcamera/control_ids.h>\n>  #include <libcamera/controls.h>\n>  #include <libcamera/formats.h>\n> +#include <libcamera/property_ids.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n>\n> @@ -517,6 +518,8 @@ int VimcCameraData::init()\n>         /* Initialize the camera properties. */\n>         properties_ = sensor_->properties();\n>\n> +       properties_.set(properties::MinNumRequests, 2);\n> +\n>         return 0;\n>  }\n>\n> diff --git a/src/libcamera/property_ids.yaml\n> b/src/libcamera/property_ids.yaml\n> index 12ecbce5eed4..4efa952ee393 100644\n> --- a/src/libcamera/property_ids.yaml\n> +++ b/src/libcamera/property_ids.yaml\n> @@ -678,6 +678,15 @@ controls:\n>          \\todo Turn this property into a \"maximum control value\" for the\n>          ScalerCrop control once \"dynamic\" controls have been implemented.\n>\n> +  - MinNumRequests:\n> +      type: int32_t\n> +      description: |\n> +        The bare minimum number of requests needed in the camera pipeline\n> for\n> +        capture to be possible, as required by the driver. Note that this\n> +        quantity does not guarantee that frames won't be dropped or that\n> manual\n> +        per-frame controls will be applied properly.\n> +\n> +\n>    #\n> ----------------------------------------------------------------------------\n>    # Draft properties section\n>\n> --\n> 2.32.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 14AF5BD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Jul 2021 09:27:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7F74F6851A;\n\tThu,  8 Jul 2021 11:27:11 +0200 (CEST)","from mail-lf1-x134.google.com (mail-lf1-x134.google.com\n\t[IPv6:2a00:1450:4864:20::134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AEAEB68509\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Jul 2021 11:27:10 +0200 (CEST)","by mail-lf1-x134.google.com with SMTP id p16so13406050lfc.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 08 Jul 2021 02:27:10 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"O1rJnEQY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=nzIWDn82gVggGDJNES4cOI1CGbLoMrDoZ/P5eoDT/e8=;\n\tb=O1rJnEQYJ7y0DOj3cDmsluP4JI0DsCyuxdOnxcMJeXoejgCU3VYHFzLnrrC7MkO27i\n\ttn3EZ/d8Ammsmg8Pv5pQ5bUNbUH/981ihzxl+NNjoPFIiBGwZvNC3m5WSzsq4t7YREKJ\n\t3R+PojYFj3mVoRGNXRoLNhT6cJBC6QYv1lEdBpAdmiRp7tYIYrWvbPyHPBdPjT/xudhm\n\tPtSD3O1CSm2984MdUqQ/O6RTo5Xhwj8Ahuu6iR2E6RnwB9WebzBcIqi/m20nuhVYNO9M\n\t+UzqKrj/SW3RmnSWOEJwa4fE01VMutb9LB4B2h1eWXU+QUBs6w+r90ZXCkgNh0ZInpXa\n\t5cXg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=nzIWDn82gVggGDJNES4cOI1CGbLoMrDoZ/P5eoDT/e8=;\n\tb=VBeeACbY0+9jpRoP8/CEqhxeUJpOTrs8Bdtp0e/cXY7U5JQGcOIYpafwQRz8PPRHro\n\txGLkxdpWrvxA5vcygCrN6NgpJCC8VLdPeFWyS/ysL/jfz9s5cUSBhMTCq+Oln3LAX9nc\n\tdfly5OVepTIchSgzRFFyqVIDjDknFl4OACJsXrcwf+GMLmJP53nvoK9DLp+MlkyM9oGe\n\t+KYr3mGd7YmE79x9bs88mEFg03JSn4uQAkV/iNuuKU5SDyeimih7kD7ndyG3Fsevf22s\n\tzwK/E5WpDaunLQi2KWB2Keq/Q8r2K6DTj0v7Qam1VN7CjHYWUHa3lIrWV9fkErR+sqzg\n\tobAQ==","X-Gm-Message-State":"AOAM530HygxgEDQOaqAYLy0RY5aD1b9r6iraOR+GwmHetckbRJ5xZFNI\n\t6BUaXuQzO4rtnsf7qohRb5FaBeAij25inuQ9/XLJ6w==","X-Google-Smtp-Source":"ABdhPJzqZmWxeD5CmfHjdg/BJW2WduTt0rl0u5ahHtoX7aA6jzh4MJsiCbxJr69mD0pe3+BUGt6IbaGs6QqAjoXKBOY=","X-Received":"by 2002:a2e:7617:: with SMTP id\n\tr23mr5966102ljc.169.1625736430044; \n\tThu, 08 Jul 2021 02:27:10 -0700 (PDT)","MIME-Version":"1.0","References":"<20210707144202.1327061-1-nfraprado@collabora.com>\n\t<20210707144202.1327061-2-nfraprado@collabora.com>","In-Reply-To":"<20210707144202.1327061-2-nfraprado@collabora.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Thu, 8 Jul 2021 10:26:54 +0100","Message-ID":"<CAEmqJPpKYLKHB0p=kNvuQd=ZLEJwB9Vp9KVWv9xtC8xrW451jw@mail.gmail.com>","To":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>","Content-Type":"multipart/alternative; boundary=\"000000000000695dad05c69942ee\"","Subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tkernel@collabora.com, =?utf-8?q?Andr=C3=A9_Almeida?=\n\t<andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18029,"web_url":"https://patchwork.libcamera.org/comment/18029/","msgid":"<20210708124417.5sbchljhulbiobmj@notapiano>","date":"2021-07-08T12:44:17","subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","submitter":{"id":84,"url":"https://patchwork.libcamera.org/api/people/84/","name":"Nícolas F. R. A. Prado","email":"nfraprado@collabora.com"},"content":"Hi Naushir,\n\nOn Thu, Jul 08, 2021 at 10:26:54AM +0100, Naushir Patuck wrote:\n> Hi Nicolas,\n> \n> Thank you for your patch.\n> \n> On Wed, 7 Jul 2021 at 15:42, Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> wrote:\n> \n> > The MinNumRequests property reports the bare minimum number of requests\n> > needed in the camera pipeline for capture to be possible. It is equal to\n> > the number of buffers required by the driver. At this quantity, there's\n> > no guarantee that frames won't be dropped or that manual per-frame\n> > controls will apply correctly. The quantity needed for those may be\n> > added as separate properties in the future.\n> >\n> > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> > ---\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp               | 6 ++++++\n> >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++\n> >  src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 2 ++\n> >  src/libcamera/pipeline/simple/simple.cpp           | 2 ++\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       | 2 ++\n> >  src/libcamera/pipeline/vimc/vimc.cpp               | 3 +++\n> >  src/libcamera/property_ids.yaml                    | 9 +++++++++\n> >  7 files changed, 30 insertions(+)\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index 76c3bb3d8aa9..017018c845fa 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -1111,6 +1111,12 @@ int PipelineHandlerIPU3::registerCameras()\n> >                 /* Initialize the camera properties. */\n> >                 data->properties_ = cio2->sensor()->properties();\n> >\n> > +               /*\n> > +                * \\todo Make sure this is correct even after the stream is\n> > +                * configured to CIO2\n> > +                */\n> > +               data->properties_.set(properties::MinNumRequests, 1);\n> > +\n> >                 ret = initControls(data.get());\n> >                 if (ret)\n> >                         continue;\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index 082eb1ee1c23..f99a21de6918 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -1045,6 +1045,12 @@ bool PipelineHandlerRPi::match(DeviceEnumerator\n> > *enumerator)\n> >         /* Initialize the camera properties. */\n> >         data->properties_ = data->sensor_->properties();\n> >\n> > +       /*\n> > +        * \\todo Make sure this is correct after the stream is configured\n> > for\n> > +        * any of the roles\n> > +        */\n> > +       data->properties_.set(properties::MinNumRequests, 1);\n> > +\n> >\n> \n> Could you elaborate a bit on the above \\todo, I'm not entirely sure it is\n> relevant for the\n> Raspberry Pi pipeline handler.\n\nSure. I added it because I am worried about the usage of different values for\nbufferCount depending on the StreamRole used. I saw that you use 2 buffers for\nRaw, 1 for StillCapture, 4 for VideoRecording and Viewfinder, but I don't\nquite understand the reason for them.\n\nGiven that I'm removing those bufferCount assignments in patch 10, and that the\nMinNumRequests is one global property for the pipeline handler, not specific to\na single StreamRole, I just added that TODO so we could have this discussion\neventually :).\n\nSo, do you think 1 works fine independent of the StreamRole configuration?\n\nThanks,\nNícolas\n\n> \n> Thanks,\n> Naush\n> \n>         /*\n> >          * Set a default value for the ScalerCropMaximum property to show\n> >          * that we support its use, however, initialise it to zero because\n> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > index 00df4f0b3e6b..b5cbf2394b1c 100644\n> > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > @@ -24,6 +24,7 @@\n> >  #include <libcamera/ipa/core_ipa_interface.h>\n> >  #include <libcamera/ipa/rkisp1_ipa_interface.h>\n> >  #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n> > +#include <libcamera/property_ids.h>\n> >  #include <libcamera/request.h>\n> >  #include <libcamera/stream.h>\n> >\n> > @@ -944,6 +945,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity\n> > *sensor)\n> >\n> >         /* Initialize the camera properties. */\n> >         data->properties_ = data->sensor_->properties();\n> > +       data->properties_.set(properties::MinNumRequests, 3);\n> >\n> >         /*\n> >          * \\todo Read dealy values from the sensor itself or from a\n> > diff --git a/src/libcamera/pipeline/simple/simple.cpp\n> > b/src/libcamera/pipeline/simple/simple.cpp\n> > index b29fff9820e5..c4adea61519f 100644\n> > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > @@ -25,6 +25,7 @@\n> >\n> >  #include <libcamera/camera.h>\n> >  #include <libcamera/control_ids.h>\n> > +#include <libcamera/property_ids.h>\n> >  #include <libcamera/request.h>\n> >  #include <libcamera/stream.h>\n> >\n> > @@ -436,6 +437,7 @@ int SimpleCameraData::init()\n> >         }\n> >\n> >         properties_ = sensor_->properties();\n> > +       properties_.set(properties::MinNumRequests, 3);\n> >\n> >         return 0;\n> >  }\n> > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > index 0f634b8da609..0258111ad6cf 100644\n> > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > @@ -525,6 +525,8 @@ int UVCCameraData::init(MediaDevice *media)\n> >         properties_.set(properties::PixelArraySize, resolution);\n> >         properties_.set(properties::PixelArrayActiveAreas, {\n> > Rectangle(resolution) });\n> >\n> > +       properties_.set(properties::MinNumRequests, 1);\n> > +\n> >         /* Initialise the supported controls. */\n> >         ControlInfoMap::Map ctrls;\n> >\n> > diff --git a/src/libcamera/pipeline/vimc/vimc.cpp\n> > b/src/libcamera/pipeline/vimc/vimc.cpp\n> > index 12f7517fd0ae..8c3f7ccb46bd 100644\n> > --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> > +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> > @@ -21,6 +21,7 @@\n> >  #include <libcamera/control_ids.h>\n> >  #include <libcamera/controls.h>\n> >  #include <libcamera/formats.h>\n> > +#include <libcamera/property_ids.h>\n> >  #include <libcamera/request.h>\n> >  #include <libcamera/stream.h>\n> >\n> > @@ -517,6 +518,8 @@ int VimcCameraData::init()\n> >         /* Initialize the camera properties. */\n> >         properties_ = sensor_->properties();\n> >\n> > +       properties_.set(properties::MinNumRequests, 2);\n> > +\n> >         return 0;\n> >  }\n> >\n> > diff --git a/src/libcamera/property_ids.yaml\n> > b/src/libcamera/property_ids.yaml\n> > index 12ecbce5eed4..4efa952ee393 100644\n> > --- a/src/libcamera/property_ids.yaml\n> > +++ b/src/libcamera/property_ids.yaml\n> > @@ -678,6 +678,15 @@ controls:\n> >          \\todo Turn this property into a \"maximum control value\" for the\n> >          ScalerCrop control once \"dynamic\" controls have been implemented.\n> >\n> > +  - MinNumRequests:\n> > +      type: int32_t\n> > +      description: |\n> > +        The bare minimum number of requests needed in the camera pipeline\n> > for\n> > +        capture to be possible, as required by the driver. Note that this\n> > +        quantity does not guarantee that frames won't be dropped or that\n> > manual\n> > +        per-frame controls will be applied properly.\n> > +\n> > +\n> >    #\n> > ----------------------------------------------------------------------------\n> >    # Draft properties section\n> >\n> > --\n> > 2.32.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 2C419BD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Jul 2021 12:44:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 652A668523;\n\tThu,  8 Jul 2021 14:44:26 +0200 (CEST)","from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C4E0968506\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Jul 2021 14:44:24 +0200 (CEST)","from notapiano (unknown\n\t[IPv6:2804:14c:1a9:2434:6553:ad0c:9d2a:24db])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nfraprado)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 4BF621F41543;\n\tThu,  8 Jul 2021 13:44:23 +0100 (BST)"],"Date":"Thu, 8 Jul 2021 09:44:17 -0300","From":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4=?= Prado <nfraprado@collabora.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20210708124417.5sbchljhulbiobmj@notapiano>","References":"<20210707144202.1327061-1-nfraprado@collabora.com>\n\t<20210707144202.1327061-2-nfraprado@collabora.com>\n\t<CAEmqJPpKYLKHB0p=kNvuQd=ZLEJwB9Vp9KVWv9xtC8xrW451jw@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CAEmqJPpKYLKHB0p=kNvuQd=ZLEJwB9Vp9KVWv9xtC8xrW451jw@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tkernel@collabora.com, =?utf-8?b?QW5kcsOp?=\n\tAlmeida <andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18033,"web_url":"https://patchwork.libcamera.org/comment/18033/","msgid":"<CAEmqJPpZZt4s3YC1qQCXLNVESt2=D08BCCR+f-WD0pxNA3dH_g@mail.gmail.com>","date":"2021-07-08T13:19:07","subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Nícolas,\n\nOn Thu, 8 Jul 2021 at 13:44, Nícolas F. R. A. Prado <nfraprado@collabora.com>\nwrote:\n\n> Hi Naushir,\n>\n> On Thu, Jul 08, 2021 at 10:26:54AM +0100, Naushir Patuck wrote:\n> > Hi Nicolas,\n> >\n> > Thank you for your patch.\n> >\n> > On Wed, 7 Jul 2021 at 15:42, Nícolas F. R. A. Prado <\n> nfraprado@collabora.com>\n> > wrote:\n> >\n> > > The MinNumRequests property reports the bare minimum number of requests\n> > > needed in the camera pipeline for capture to be possible. It is equal\n> to\n> > > the number of buffers required by the driver. At this quantity, there's\n> > > no guarantee that frames won't be dropped or that manual per-frame\n> > > controls will apply correctly. The quantity needed for those may be\n> > > added as separate properties in the future.\n> > >\n> > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> > > ---\n> > >  src/libcamera/pipeline/ipu3/ipu3.cpp               | 6 ++++++\n> > >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++\n> > >  src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 2 ++\n> > >  src/libcamera/pipeline/simple/simple.cpp           | 2 ++\n> > >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       | 2 ++\n> > >  src/libcamera/pipeline/vimc/vimc.cpp               | 3 +++\n> > >  src/libcamera/property_ids.yaml                    | 9 +++++++++\n> > >  7 files changed, 30 insertions(+)\n> > >\n> > > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > index 76c3bb3d8aa9..017018c845fa 100644\n> > > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > @@ -1111,6 +1111,12 @@ int PipelineHandlerIPU3::registerCameras()\n> > >                 /* Initialize the camera properties. */\n> > >                 data->properties_ = cio2->sensor()->properties();\n> > >\n> > > +               /*\n> > > +                * \\todo Make sure this is correct even after the\n> stream is\n> > > +                * configured to CIO2\n> > > +                */\n> > > +               data->properties_.set(properties::MinNumRequests, 1);\n> > > +\n> > >                 ret = initControls(data.get());\n> > >                 if (ret)\n> > >                         continue;\n> > > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > index 082eb1ee1c23..f99a21de6918 100644\n> > > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > @@ -1045,6 +1045,12 @@ bool PipelineHandlerRPi::match(DeviceEnumerator\n> > > *enumerator)\n> > >         /* Initialize the camera properties. */\n> > >         data->properties_ = data->sensor_->properties();\n> > >\n> > > +       /*\n> > > +        * \\todo Make sure this is correct after the stream is\n> configured\n> > > for\n> > > +        * any of the roles\n> > > +        */\n> > > +       data->properties_.set(properties::MinNumRequests, 1);\n> > > +\n> > >\n> >\n> > Could you elaborate a bit on the above \\todo, I'm not entirely sure it is\n> > relevant for the\n> > Raspberry Pi pipeline handler.\n>\n> Sure. I added it because I am worried about the usage of different values\n> for\n> bufferCount depending on the StreamRole used. I saw that you use 2 buffers\n> for\n> Raw, 1 for StillCapture, 4 for VideoRecording and Viewfinder, but I don't\n> quite understand the reason for them.\n>\n\nI don't clearly know what to set bufferCount to.  I assumed it is a\n\"reasonable guess\"\nas to what a user should request for a given use case.\n\n\n>\n> Given that I'm removing those bufferCount assignments in patch 10, and\n> that the\n> MinNumRequests is one global property for the pipeline handler, not\n> specific to\n> a single StreamRole, I just added that TODO so we could have this\n> discussion\n> eventually :).\n>\n> So, do you think 1 works fine independent of the StreamRole configuration?\n>\n\nYes, 1 should work fine, regardless of the use case.  So perhaps the todo\nis not\nneeded here.\n\nRegards,\nNaush\n\n\n>\n> Thanks,\n> Nícolas\n>\n> >\n> > Thanks,\n> > Naush\n> >\n> >         /*\n> > >          * Set a default value for the ScalerCropMaximum property to\n> show\n> > >          * that we support its use, however, initialise it to zero\n> because\n> > > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > index 00df4f0b3e6b..b5cbf2394b1c 100644\n> > > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > @@ -24,6 +24,7 @@\n> > >  #include <libcamera/ipa/core_ipa_interface.h>\n> > >  #include <libcamera/ipa/rkisp1_ipa_interface.h>\n> > >  #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n> > > +#include <libcamera/property_ids.h>\n> > >  #include <libcamera/request.h>\n> > >  #include <libcamera/stream.h>\n> > >\n> > > @@ -944,6 +945,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity\n> > > *sensor)\n> > >\n> > >         /* Initialize the camera properties. */\n> > >         data->properties_ = data->sensor_->properties();\n> > > +       data->properties_.set(properties::MinNumRequests, 3);\n> > >\n> > >         /*\n> > >          * \\todo Read dealy values from the sensor itself or from a\n> > > diff --git a/src/libcamera/pipeline/simple/simple.cpp\n> > > b/src/libcamera/pipeline/simple/simple.cpp\n> > > index b29fff9820e5..c4adea61519f 100644\n> > > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > > @@ -25,6 +25,7 @@\n> > >\n> > >  #include <libcamera/camera.h>\n> > >  #include <libcamera/control_ids.h>\n> > > +#include <libcamera/property_ids.h>\n> > >  #include <libcamera/request.h>\n> > >  #include <libcamera/stream.h>\n> > >\n> > > @@ -436,6 +437,7 @@ int SimpleCameraData::init()\n> > >         }\n> > >\n> > >         properties_ = sensor_->properties();\n> > > +       properties_.set(properties::MinNumRequests, 3);\n> > >\n> > >         return 0;\n> > >  }\n> > > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > index 0f634b8da609..0258111ad6cf 100644\n> > > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > @@ -525,6 +525,8 @@ int UVCCameraData::init(MediaDevice *media)\n> > >         properties_.set(properties::PixelArraySize, resolution);\n> > >         properties_.set(properties::PixelArrayActiveAreas, {\n> > > Rectangle(resolution) });\n> > >\n> > > +       properties_.set(properties::MinNumRequests, 1);\n> > > +\n> > >         /* Initialise the supported controls. */\n> > >         ControlInfoMap::Map ctrls;\n> > >\n> > > diff --git a/src/libcamera/pipeline/vimc/vimc.cpp\n> > > b/src/libcamera/pipeline/vimc/vimc.cpp\n> > > index 12f7517fd0ae..8c3f7ccb46bd 100644\n> > > --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> > > +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> > > @@ -21,6 +21,7 @@\n> > >  #include <libcamera/control_ids.h>\n> > >  #include <libcamera/controls.h>\n> > >  #include <libcamera/formats.h>\n> > > +#include <libcamera/property_ids.h>\n> > >  #include <libcamera/request.h>\n> > >  #include <libcamera/stream.h>\n> > >\n> > > @@ -517,6 +518,8 @@ int VimcCameraData::init()\n> > >         /* Initialize the camera properties. */\n> > >         properties_ = sensor_->properties();\n> > >\n> > > +       properties_.set(properties::MinNumRequests, 2);\n> > > +\n> > >         return 0;\n> > >  }\n> > >\n> > > diff --git a/src/libcamera/property_ids.yaml\n> > > b/src/libcamera/property_ids.yaml\n> > > index 12ecbce5eed4..4efa952ee393 100644\n> > > --- a/src/libcamera/property_ids.yaml\n> > > +++ b/src/libcamera/property_ids.yaml\n> > > @@ -678,6 +678,15 @@ controls:\n> > >          \\todo Turn this property into a \"maximum control value\" for\n> the\n> > >          ScalerCrop control once \"dynamic\" controls have been\n> implemented.\n> > >\n> > > +  - MinNumRequests:\n> > > +      type: int32_t\n> > > +      description: |\n> > > +        The bare minimum number of requests needed in the camera\n> pipeline\n> > > for\n> > > +        capture to be possible, as required by the driver. Note that\n> this\n> > > +        quantity does not guarantee that frames won't be dropped or\n> that\n> > > manual\n> > > +        per-frame controls will be applied properly.\n> > > +\n> > > +\n> > >    #\n> > >\n> ----------------------------------------------------------------------------\n> > >    # Draft properties section\n> > >\n> > > --\n> > > 2.32.0\n> > >\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 C9079BD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Jul 2021 13:19:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4429D68523;\n\tThu,  8 Jul 2021 15:19:26 +0200 (CEST)","from mail-lf1-x132.google.com (mail-lf1-x132.google.com\n\t[IPv6:2a00:1450:4864:20::132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 456D168506\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Jul 2021 15:19:24 +0200 (CEST)","by mail-lf1-x132.google.com with SMTP id x25so2738892lfu.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 08 Jul 2021 06:19:24 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"oZwzkK5b\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=rNR+v+qpGPddzzDIGGy3jp+Y1DhGfkFQdx+TfglMiRE=;\n\tb=oZwzkK5bqOERlmY/nQ7zaOp7/ROUhxPAWBjFrjl12Pn3LaSvIauBQ2ErCZXErR+Afv\n\tEbOyACMo1RHOegs16D8mWS/1dtkZ/KGqpTkLwNj8JQ64T/X9VJhAMj33QWQ7BVPUH2gr\n\tQCDMwdtbr93iTyhpPhufWnA4GVhCPXm2mY6MY1rmWMfGlt4DmDeqKqsa/SyOVu371xIe\n\tS5cZDtgC4XyU6k1Py6pBBRhIE25WBYVQyCaDSdtPeqozD8lww5/ztwtzha1GpMBk3HrB\n\tTzlbMK0hXwoJSfg2G/kw6V+wdDubYvGHt3zPzpuUNoD/voSSMr7IqfH4cY53wtkeN0Q9\n\tPP0w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=rNR+v+qpGPddzzDIGGy3jp+Y1DhGfkFQdx+TfglMiRE=;\n\tb=jtdGoGgp5o4Val/jxeBVCO1J2q3mkNBLyGLJBtwXrO9D5M8A8OoAZuWGk7CU7DSYNz\n\t1+8xSJWJiVUI7/aUnoPAW1l1QUhz+xeYb8Eug7QjaXq4MY+p+oVSDPkWdvQnoQm9zXyv\n\t0viTllN4BJiAQ2d9r6hYjhf0QiSKXcQHEkjbsifWq1S7MoOeSDeSF2CsqJWA1aBRNkM+\n\tVwtUGD6i/rd4BwXh6NhMZ8q2u9trMrTubVbdskv6sOobQA/DGMhYlnxJewcTUXApreqy\n\tSLgIgukNzHXhnLEOoiVyFTwPlNIwmjm7OlVMc4o1xOxi4G3G6z1qdEEalR1cCxVJmLhg\n\tYtfg==","X-Gm-Message-State":"AOAM531fSn4pAbcw/pDi6mTCnnPkHuc7kresi/ps5WlS1H20WBKP6YSN\n\tB1n/jgzzQQgcV7TUTHOwvXioGKdGeC0fe/iqhcDm5Q==","X-Google-Smtp-Source":"ABdhPJxPsftqbdJp+u8dNqhdR87vNQe/uMYajXaLCuVemjPglXxdX+bmYWlc0QirN4vwIcJsyY3n6d3Negj1AUvQC8w=","X-Received":"by 2002:a2e:8905:: with SMTP id\n\td5mr19941066lji.400.1625750363538; \n\tThu, 08 Jul 2021 06:19:23 -0700 (PDT)","MIME-Version":"1.0","References":"<20210707144202.1327061-1-nfraprado@collabora.com>\n\t<20210707144202.1327061-2-nfraprado@collabora.com>\n\t<CAEmqJPpKYLKHB0p=kNvuQd=ZLEJwB9Vp9KVWv9xtC8xrW451jw@mail.gmail.com>\n\t<20210708124417.5sbchljhulbiobmj@notapiano>","In-Reply-To":"<20210708124417.5sbchljhulbiobmj@notapiano>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Thu, 8 Jul 2021 14:19:07 +0100","Message-ID":"<CAEmqJPpZZt4s3YC1qQCXLNVESt2=D08BCCR+f-WD0pxNA3dH_g@mail.gmail.com>","To":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>","Content-Type":"multipart/alternative; boundary=\"000000000000e9992605c69c80a8\"","Subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tkernel@collabora.com, =?utf-8?q?Andr=C3=A9_Almeida?=\n\t<andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":18034,"web_url":"https://patchwork.libcamera.org/comment/18034/","msgid":"<20210708132835.smo5oumufpg5u76z@notapiano>","date":"2021-07-08T13:28:35","subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","submitter":{"id":84,"url":"https://patchwork.libcamera.org/api/people/84/","name":"Nícolas F. R. A. Prado","email":"nfraprado@collabora.com"},"content":"Hi Naushir,\n\nOn Thu, Jul 08, 2021 at 02:19:07PM +0100, Naushir Patuck wrote:\n> Hi Nícolas,\n> \n> On Thu, 8 Jul 2021 at 13:44, Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> wrote:\n> \n> > Hi Naushir,\n> >\n> > On Thu, Jul 08, 2021 at 10:26:54AM +0100, Naushir Patuck wrote:\n> > > Hi Nicolas,\n> > >\n> > > Thank you for your patch.\n> > >\n> > > On Wed, 7 Jul 2021 at 15:42, Nícolas F. R. A. Prado <\n> > nfraprado@collabora.com>\n> > > wrote:\n> > >\n> > > > The MinNumRequests property reports the bare minimum number of requests\n> > > > needed in the camera pipeline for capture to be possible. It is equal\n> > to\n> > > > the number of buffers required by the driver. At this quantity, there's\n> > > > no guarantee that frames won't be dropped or that manual per-frame\n> > > > controls will apply correctly. The quantity needed for those may be\n> > > > added as separate properties in the future.\n> > > >\n> > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> > > > ---\n> > > >  src/libcamera/pipeline/ipu3/ipu3.cpp               | 6 ++++++\n> > > >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++\n> > > >  src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 2 ++\n> > > >  src/libcamera/pipeline/simple/simple.cpp           | 2 ++\n> > > >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       | 2 ++\n> > > >  src/libcamera/pipeline/vimc/vimc.cpp               | 3 +++\n> > > >  src/libcamera/property_ids.yaml                    | 9 +++++++++\n> > > >  7 files changed, 30 insertions(+)\n> > > >\n> > > > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > > b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > > index 76c3bb3d8aa9..017018c845fa 100644\n> > > > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > > @@ -1111,6 +1111,12 @@ int PipelineHandlerIPU3::registerCameras()\n> > > >                 /* Initialize the camera properties. */\n> > > >                 data->properties_ = cio2->sensor()->properties();\n> > > >\n> > > > +               /*\n> > > > +                * \\todo Make sure this is correct even after the\n> > stream is\n> > > > +                * configured to CIO2\n> > > > +                */\n> > > > +               data->properties_.set(properties::MinNumRequests, 1);\n> > > > +\n> > > >                 ret = initControls(data.get());\n> > > >                 if (ret)\n> > > >                         continue;\n> > > > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > > b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > > index 082eb1ee1c23..f99a21de6918 100644\n> > > > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > > @@ -1045,6 +1045,12 @@ bool PipelineHandlerRPi::match(DeviceEnumerator\n> > > > *enumerator)\n> > > >         /* Initialize the camera properties. */\n> > > >         data->properties_ = data->sensor_->properties();\n> > > >\n> > > > +       /*\n> > > > +        * \\todo Make sure this is correct after the stream is\n> > configured\n> > > > for\n> > > > +        * any of the roles\n> > > > +        */\n> > > > +       data->properties_.set(properties::MinNumRequests, 1);\n> > > > +\n> > > >\n> > >\n> > > Could you elaborate a bit on the above \\todo, I'm not entirely sure it is\n> > > relevant for the\n> > > Raspberry Pi pipeline handler.\n> >\n> > Sure. I added it because I am worried about the usage of different values\n> > for\n> > bufferCount depending on the StreamRole used. I saw that you use 2 buffers\n> > for\n> > Raw, 1 for StillCapture, 4 for VideoRecording and Viewfinder, but I don't\n> > quite understand the reason for them.\n> >\n> \n> I don't clearly know what to set bufferCount to.  I assumed it is a\n> \"reasonable guess\"\n> as to what a user should request for a given use case.\n\nYes, I think that's how it's used normally. It could also have been used to set\na minimum value however, which makes it a little ambiguous.\n\n> \n> \n> >\n> > Given that I'm removing those bufferCount assignments in patch 10, and\n> > that the\n> > MinNumRequests is one global property for the pipeline handler, not\n> > specific to\n> > a single StreamRole, I just added that TODO so we could have this\n> > discussion\n> > eventually :).\n> >\n> > So, do you think 1 works fine independent of the StreamRole configuration?\n> >\n> \n> Yes, 1 should work fine, regardless of the use case.  So perhaps the todo\n> is not\n> needed here.\n\nOk, sounds good. I'll remove it for next version. I also just realized I have\nalready tested this on the raspberrypi pipeline with all StreamRoles and nothing\nexploded, so I guess we're good :).\n\nThanks,\nNícolas\n\n> \n> Regards,\n> Naush\n> \n> \n> >\n> > Thanks,\n> > Nícolas\n> >\n> > >\n> > > Thanks,\n> > > Naush\n> > >\n> > >         /*\n> > > >          * Set a default value for the ScalerCropMaximum property to\n> > show\n> > > >          * that we support its use, however, initialise it to zero\n> > because\n> > > > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > > b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > > index 00df4f0b3e6b..b5cbf2394b1c 100644\n> > > > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > > @@ -24,6 +24,7 @@\n> > > >  #include <libcamera/ipa/core_ipa_interface.h>\n> > > >  #include <libcamera/ipa/rkisp1_ipa_interface.h>\n> > > >  #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n> > > > +#include <libcamera/property_ids.h>\n> > > >  #include <libcamera/request.h>\n> > > >  #include <libcamera/stream.h>\n> > > >\n> > > > @@ -944,6 +945,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity\n> > > > *sensor)\n> > > >\n> > > >         /* Initialize the camera properties. */\n> > > >         data->properties_ = data->sensor_->properties();\n> > > > +       data->properties_.set(properties::MinNumRequests, 3);\n> > > >\n> > > >         /*\n> > > >          * \\todo Read dealy values from the sensor itself or from a\n> > > > diff --git a/src/libcamera/pipeline/simple/simple.cpp\n> > > > b/src/libcamera/pipeline/simple/simple.cpp\n> > > > index b29fff9820e5..c4adea61519f 100644\n> > > > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > > > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > > > @@ -25,6 +25,7 @@\n> > > >\n> > > >  #include <libcamera/camera.h>\n> > > >  #include <libcamera/control_ids.h>\n> > > > +#include <libcamera/property_ids.h>\n> > > >  #include <libcamera/request.h>\n> > > >  #include <libcamera/stream.h>\n> > > >\n> > > > @@ -436,6 +437,7 @@ int SimpleCameraData::init()\n> > > >         }\n> > > >\n> > > >         properties_ = sensor_->properties();\n> > > > +       properties_.set(properties::MinNumRequests, 3);\n> > > >\n> > > >         return 0;\n> > > >  }\n> > > > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > > b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > > index 0f634b8da609..0258111ad6cf 100644\n> > > > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > > > @@ -525,6 +525,8 @@ int UVCCameraData::init(MediaDevice *media)\n> > > >         properties_.set(properties::PixelArraySize, resolution);\n> > > >         properties_.set(properties::PixelArrayActiveAreas, {\n> > > > Rectangle(resolution) });\n> > > >\n> > > > +       properties_.set(properties::MinNumRequests, 1);\n> > > > +\n> > > >         /* Initialise the supported controls. */\n> > > >         ControlInfoMap::Map ctrls;\n> > > >\n> > > > diff --git a/src/libcamera/pipeline/vimc/vimc.cpp\n> > > > b/src/libcamera/pipeline/vimc/vimc.cpp\n> > > > index 12f7517fd0ae..8c3f7ccb46bd 100644\n> > > > --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> > > > +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> > > > @@ -21,6 +21,7 @@\n> > > >  #include <libcamera/control_ids.h>\n> > > >  #include <libcamera/controls.h>\n> > > >  #include <libcamera/formats.h>\n> > > > +#include <libcamera/property_ids.h>\n> > > >  #include <libcamera/request.h>\n> > > >  #include <libcamera/stream.h>\n> > > >\n> > > > @@ -517,6 +518,8 @@ int VimcCameraData::init()\n> > > >         /* Initialize the camera properties. */\n> > > >         properties_ = sensor_->properties();\n> > > >\n> > > > +       properties_.set(properties::MinNumRequests, 2);\n> > > > +\n> > > >         return 0;\n> > > >  }\n> > > >\n> > > > diff --git a/src/libcamera/property_ids.yaml\n> > > > b/src/libcamera/property_ids.yaml\n> > > > index 12ecbce5eed4..4efa952ee393 100644\n> > > > --- a/src/libcamera/property_ids.yaml\n> > > > +++ b/src/libcamera/property_ids.yaml\n> > > > @@ -678,6 +678,15 @@ controls:\n> > > >          \\todo Turn this property into a \"maximum control value\" for\n> > the\n> > > >          ScalerCrop control once \"dynamic\" controls have been\n> > implemented.\n> > > >\n> > > > +  - MinNumRequests:\n> > > > +      type: int32_t\n> > > > +      description: |\n> > > > +        The bare minimum number of requests needed in the camera\n> > pipeline\n> > > > for\n> > > > +        capture to be possible, as required by the driver. Note that\n> > this\n> > > > +        quantity does not guarantee that frames won't be dropped or\n> > that\n> > > > manual\n> > > > +        per-frame controls will be applied properly.\n> > > > +\n> > > > +\n> > > >    #\n> > > >\n> > ----------------------------------------------------------------------------\n> > > >    # Draft properties section\n> > > >\n> > > > --\n> > > > 2.32.0\n> > > >\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 58CC4C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Jul 2021 13:28:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D0FB368513;\n\tThu,  8 Jul 2021 15:28:43 +0200 (CEST)","from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 527CE68506\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Jul 2021 15:28:42 +0200 (CEST)","from notapiano (unknown\n\t[IPv6:2804:14c:1a9:2434:6553:ad0c:9d2a:24db])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nfraprado)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id D43CC1F43C23;\n\tThu,  8 Jul 2021 14:28:40 +0100 (BST)"],"Date":"Thu, 8 Jul 2021 10:28:35 -0300","From":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4=?= Prado <nfraprado@collabora.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20210708132835.smo5oumufpg5u76z@notapiano>","References":"<20210707144202.1327061-1-nfraprado@collabora.com>\n\t<20210707144202.1327061-2-nfraprado@collabora.com>\n\t<CAEmqJPpKYLKHB0p=kNvuQd=ZLEJwB9Vp9KVWv9xtC8xrW451jw@mail.gmail.com>\n\t<20210708124417.5sbchljhulbiobmj@notapiano>\n\t<CAEmqJPpZZt4s3YC1qQCXLNVESt2=D08BCCR+f-WD0pxNA3dH_g@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CAEmqJPpZZt4s3YC1qQCXLNVESt2=D08BCCR+f-WD0pxNA3dH_g@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v5 01/10] libcamera: property: Add\n\tMinNumRequests property","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tkernel@collabora.com, =?utf-8?b?QW5kcsOp?=\n\tAlmeida <andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]