[{"id":22175,"web_url":"https://patchwork.libcamera.org/comment/22175/","msgid":"<YgxMuseqssph20mR@pendragon.ideasonboard.com>","date":"2022-02-16T01:00:42","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Han-Lin,\n\nThank you for the patch.\n\nI'm CC'ing Jacopo and Umang as they've both spent a large amount of time\nsolving issues related to frame durations.\n\nOn Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> It's notice that Chrome Camera App filters out the resolutions which cannot\n> achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if FPS is lower\n> within 2%.\n\nUnless I'm mistaken this patch doesn't depend on the rest of the series,\nso we can review and merge it separately.\n\n> Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> ---\n>  src/android/camera_capabilities.cpp | 31 +++++++++++++++++++----------\n>  1 file changed, 20 insertions(+), 11 deletions(-)\n> \n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index 55d651f3..e10ab036 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -655,7 +655,9 @@ int CameraCapabilities::initializeStreamConfigurations()\n>  \t\t\tint64_t maxFrameDuration = frameDurations->second.max().get<int64_t>() * 1000;\n>  \n>  \t\t\t/*\n> -\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance.\n> +\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance,\n> +\t\t\t * and elevate min frame duration to 30 FPS with 2%\n> +\t\t\t * tolerance.\n>  \t\t\t *\n>  \t\t\t * 30 frames per second has been validated as the most\n>  \t\t\t * opportune frame rate for quality tuning, and power\n> @@ -675,17 +677,24 @@ int CameraCapabilities::initializeStreamConfigurations()\n>  \t\t\t * to the in-development configuration API rework.\n>  \t\t\t */\n>  \t\t\tint64_t minFrameDurationCap = 1e9 / 30.0;\n> -\t\t\tif (minFrameDuration < minFrameDurationCap) {\n> -\t\t\t\tfloat tolerance =\n> -\t\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> +\t\t\tfloat tolerance =\n> +\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n>  \n> -\t\t\t\t/*\n> -\t\t\t\t * If the tolerance is less than 1%, do not cap\n> -\t\t\t\t * the frame duration.\n> -\t\t\t\t */\n> -\t\t\t\tif (tolerance > 1.0)\n> -\t\t\t\t\tminFrameDuration = minFrameDurationCap;\n> -\t\t\t}\n> +\t\t\t/*\n> +\t\t\t * If the tolerance is less than 1%, do not cap\n> +\t\t\t * the frame duration.\n> +\t\t\t */\n> +\t\t\tif (tolerance > 1.0)\n> +\t\t\t\tminFrameDuration = minFrameDurationCap;\n> +\n> +\t\t\t/*\n> +\t\t\t * Some applications, ex: Chrome Camera App filters out\n> +\t\t\t * the resolutions which cannot achieve 30 FPS. Elevate\n> +\t\t\t * the minimum frame duration to 30 FPS if FPS is lower\n> +\t\t\t * within 2%.\n> +\t\t\t */\n> +\t\t\tif (tolerance < 0 && tolerance > -2.0)\n> +\t\t\t\tminFrameDuration = minFrameDurationCap;\n>  \n>  \t\t\tstreamConfigurations_.push_back({\n>  \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,","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 E7BDABE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 16 Feb 2022 01:00:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 50551601FC;\n\tWed, 16 Feb 2022 02:00:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AC1E6601FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Feb 2022 02:00:49 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1813225B;\n\tWed, 16 Feb 2022 02:00:49 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cE71ErHU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1644973249;\n\tbh=Oe2Tvx9+cPCM9uf0jsE5yH3MLGdRkvsGOSX0gKQl4P4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=cE71ErHUjpTklxQycV4OFo0RDyhG3eMuZYutoLy/OqXX0JWqvBJQ2x+w1bfb9Opbn\n\tFh63bFeZ0OhhWxMS2dKAExeS4jhVUK/r9kVv92qPZ+fKq78mn/C7YDsja/WQHT7HP9\n\tazsSwMtGNdEApIgKUCUz+SlZA8piPqMOGRULhFW8=","Date":"Wed, 16 Feb 2022 03:00:42 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Han-Lin Chen <hanlinchen@chromium.org>","Message-ID":"<YgxMuseqssph20mR@pendragon.ideasonboard.com>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220209071917.559993-10-hanlinchen@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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@lists.libcamera.org, umang@pendragon.ideasonboard.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22176,"web_url":"https://patchwork.libcamera.org/comment/22176/","msgid":"<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>","date":"2022-02-16T01:01:12","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> Hi Han-Lin,\n> \n> Thank you for the patch.\n> \n> I'm CC'ing Jacopo and Umang as they've both spent a large amount of time\n> solving issues related to frame durations.\n\nAnd now with Umang's correct address.\n\n> On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > It's notice that Chrome Camera App filters out the resolutions which cannot\n> > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if FPS is lower\n> > within 2%.\n> \n> Unless I'm mistaken this patch doesn't depend on the rest of the series,\n> so we can review and merge it separately.\n> \n> > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > ---\n> >  src/android/camera_capabilities.cpp | 31 +++++++++++++++++++----------\n> >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > \n> > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > index 55d651f3..e10ab036 100644\n> > --- a/src/android/camera_capabilities.cpp\n> > +++ b/src/android/camera_capabilities.cpp\n> > @@ -655,7 +655,9 @@ int CameraCapabilities::initializeStreamConfigurations()\n> >  \t\t\tint64_t maxFrameDuration = frameDurations->second.max().get<int64_t>() * 1000;\n> >  \n> >  \t\t\t/*\n> > -\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance.\n> > +\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance,\n> > +\t\t\t * and elevate min frame duration to 30 FPS with 2%\n> > +\t\t\t * tolerance.\n> >  \t\t\t *\n> >  \t\t\t * 30 frames per second has been validated as the most\n> >  \t\t\t * opportune frame rate for quality tuning, and power\n> > @@ -675,17 +677,24 @@ int CameraCapabilities::initializeStreamConfigurations()\n> >  \t\t\t * to the in-development configuration API rework.\n> >  \t\t\t */\n> >  \t\t\tint64_t minFrameDurationCap = 1e9 / 30.0;\n> > -\t\t\tif (minFrameDuration < minFrameDurationCap) {\n> > -\t\t\t\tfloat tolerance =\n> > -\t\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> > +\t\t\tfloat tolerance =\n> > +\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> >  \n> > -\t\t\t\t/*\n> > -\t\t\t\t * If the tolerance is less than 1%, do not cap\n> > -\t\t\t\t * the frame duration.\n> > -\t\t\t\t */\n> > -\t\t\t\tif (tolerance > 1.0)\n> > -\t\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > -\t\t\t}\n> > +\t\t\t/*\n> > +\t\t\t * If the tolerance is less than 1%, do not cap\n> > +\t\t\t * the frame duration.\n> > +\t\t\t */\n> > +\t\t\tif (tolerance > 1.0)\n> > +\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > +\n> > +\t\t\t/*\n> > +\t\t\t * Some applications, ex: Chrome Camera App filters out\n> > +\t\t\t * the resolutions which cannot achieve 30 FPS. Elevate\n> > +\t\t\t * the minimum frame duration to 30 FPS if FPS is lower\n> > +\t\t\t * within 2%.\n> > +\t\t\t */\n> > +\t\t\tif (tolerance < 0 && tolerance > -2.0)\n> > +\t\t\t\tminFrameDuration = minFrameDurationCap;\n> >  \n> >  \t\t\tstreamConfigurations_.push_back({\n> >  \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,","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 1A6B7BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 16 Feb 2022 01:01:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D090D61139;\n\tWed, 16 Feb 2022 02:01:20 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 705A0601FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 16 Feb 2022 02:01:19 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 01A8425B;\n\tWed, 16 Feb 2022 02:01:18 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EAn8rhQY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1644973279;\n\tbh=GHXF87iY/bl5nibUQ+Y+znlX2mKPIS2YKm4uWD6NyWE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EAn8rhQY8KDOBvseLvUi0djVapvFYu+9aGxTW3eP426Hqr/S9WsX6AAAR1iNIS8uw\n\tZOyeX2zF7ahYbhmSATvAglXZDjhBZjtMspVEVtWuFyy/wuobaQ0UG7TFx/uDhParDm\n\tKUw5VHWAtCh9ycfg6BlOhTejhenJ8kEeZ6DsNXbM=","Date":"Wed, 16 Feb 2022 03:01:12 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Han-Lin Chen <hanlinchen@chromium.org>","Message-ID":"<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YgxMuseqssph20mR@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22600,"web_url":"https://patchwork.libcamera.org/comment/22600/","msgid":"<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>","date":"2022-04-06T01:38:53","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > Hi Han-Lin,\n> > \n> > Thank you for the patch.\n> > \n> > I'm CC'ing Jacopo and Umang as they've both spent a large amount of time\n> > solving issues related to frame durations.\n> \n> And now with Umang's correct address.\n\nJacopo, Umang, any feedback on this ?\n\n> > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > It's notice that Chrome Camera App filters out the resolutions which cannot\n> > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if FPS is lower\n> > > within 2%.\n> > \n> > Unless I'm mistaken this patch doesn't depend on the rest of the series,\n> > so we can review and merge it separately.\n> > \n> > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > ---\n> > >  src/android/camera_capabilities.cpp | 31 +++++++++++++++++++----------\n> > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > \n> > > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > > index 55d651f3..e10ab036 100644\n> > > --- a/src/android/camera_capabilities.cpp\n> > > +++ b/src/android/camera_capabilities.cpp\n> > > @@ -655,7 +655,9 @@ int CameraCapabilities::initializeStreamConfigurations()\n> > >  \t\t\tint64_t maxFrameDuration = frameDurations->second.max().get<int64_t>() * 1000;\n> > >  \n> > >  \t\t\t/*\n> > > -\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance.\n> > > +\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance,\n> > > +\t\t\t * and elevate min frame duration to 30 FPS with 2%\n> > > +\t\t\t * tolerance.\n> > >  \t\t\t *\n> > >  \t\t\t * 30 frames per second has been validated as the most\n> > >  \t\t\t * opportune frame rate for quality tuning, and power\n> > > @@ -675,17 +677,24 @@ int CameraCapabilities::initializeStreamConfigurations()\n> > >  \t\t\t * to the in-development configuration API rework.\n> > >  \t\t\t */\n> > >  \t\t\tint64_t minFrameDurationCap = 1e9 / 30.0;\n> > > -\t\t\tif (minFrameDuration < minFrameDurationCap) {\n> > > -\t\t\t\tfloat tolerance =\n> > > -\t\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > +\t\t\tfloat tolerance =\n> > > +\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> > >  \n> > > -\t\t\t\t/*\n> > > -\t\t\t\t * If the tolerance is less than 1%, do not cap\n> > > -\t\t\t\t * the frame duration.\n> > > -\t\t\t\t */\n> > > -\t\t\t\tif (tolerance > 1.0)\n> > > -\t\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > > -\t\t\t}\n> > > +\t\t\t/*\n> > > +\t\t\t * If the tolerance is less than 1%, do not cap\n> > > +\t\t\t * the frame duration.\n> > > +\t\t\t */\n> > > +\t\t\tif (tolerance > 1.0)\n> > > +\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > > +\n> > > +\t\t\t/*\n> > > +\t\t\t * Some applications, ex: Chrome Camera App filters out\n> > > +\t\t\t * the resolutions which cannot achieve 30 FPS. Elevate\n> > > +\t\t\t * the minimum frame duration to 30 FPS if FPS is lower\n> > > +\t\t\t * within 2%.\n> > > +\t\t\t */\n> > > +\t\t\tif (tolerance < 0 && tolerance > -2.0)\n> > > +\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > >  \n> > >  \t\t\tstreamConfigurations_.push_back({\n> > >  \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,","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 851DCC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Apr 2022 01:38:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C4AF965644;\n\tWed,  6 Apr 2022 03:38:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EFD0B604B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Apr 2022 03:38:56 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9389C482;\n\tWed,  6 Apr 2022 03:38:56 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649209138;\n\tbh=IA+JSy60AxGe2/kSk8b6eh6H4oU3Nwwma84iStqOTgY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=QqqQ8KnqLV2ZJZpq6+Al1ifj1LOrLWftq02+FogNZ5pq3RPzDK67a7Ckpp+HrBBek\n\tNePa8xmdYrWa6gWxWdhFLwYRAEm2o1AygG/sBl8ZH3YgzmnhHbeWjWq2JXlpJJVQab\n\twRR5kGIuReo5tHwPCLODxW9zWIdarTBq+Gi4R0UiqpvOUK9YWUZdT6P7mTRFORjlyS\n\t1Xa6qNehEL0eA7ygGWadB2jWjGVnlMZADVC2ePK+VjQYUzl28KdXLn0xm2/mU/PChr\n\t9KyllLR+aNY4Sx0Uo4JxfnYeU4yNnxaYdw0tOoOyIpTiQho5MHjGwGwy74hfjPDd3D\n\tyBK+ME3iz1ynQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649209136;\n\tbh=IA+JSy60AxGe2/kSk8b6eh6H4oU3Nwwma84iStqOTgY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TDZW36cgxCTPo+QvaiNdoj7odn7RRBRfqEe4g7Ksn2m2dSjElw7brwtsWtmJvRLHf\n\tAthgBcZI/CHnwV3DedMyo07RozE/nhTnJctZG5E0qqt5aaKC1Y2VoMlu5Jdb/ZEtfQ\n\ti0eK0v0tD4/frXWYicJwy9hODSUiE2sa7KDvhARs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"TDZW36cg\"; dkim-atps=neutral","Date":"Wed, 6 Apr 2022 04:38:53 +0300","To":"Han-Lin Chen <hanlinchen@chromium.org>","Message-ID":"<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22607,"web_url":"https://patchwork.libcamera.org/comment/22607/","msgid":"<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>","date":"2022-04-06T07:09:46","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hello,\n   sorry for being late\n\nOn Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n> On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> > On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > > Hi Han-Lin,\n> > >\n> > > Thank you for the patch.\n> > >\n> > > I'm CC'ing Jacopo and Umang as they've both spent a large amount of time\n> > > solving issues related to frame durations.\n> >\n> > And now with Umang's correct address.\n>\n> Jacopo, Umang, any feedback on this ?\n>\n\nLet me recap a bit first.\n\nWe currently adjust all durations > 33333333*101/100 to 33333333.\nThe idea was to avoid reporting any frame duration < 10^9/30\nc7ae5a50c10de1e790855d66842192c766da4dd3\nto bring the HAL in par with what the Intel HAL does.\n\nUmang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\nsituation to allow slightly faster durations to be reported, to please\nCTS which would have otherwise complained if the actual duration was\nsmaller than the reported on.\n\nHence, so far, we have been dealing with -faster- cameras than the\nfixed 10^9/30 limit.\n\nUmang: do you recall how did we pick the 1% positive tolerance ?\n\nThe issue here is instead that some -slower- cameras might need to be\nadjusted and report a smaller frame duration than what they actually\nproduce. We had a lengthy discussion in the past [1] about how to report\ncorrectly the durations of Nautilus which was reporting a duration of\n29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\nnot complaining. We ended up fixing the driver in\n\"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\ninstead, if I'm not mistaken, resolutions that produce < 30 FPS are\nnot reported as part of the preview streams list (so only resolutions\nup to 1080p are reported there).\n\nSo I would like first to know what cameras and what resolutions\nis this patch trying to please.\n\nAlso, reading again the thread in [1] I realized CTS allows a 1.5%\ntolerance\n\n\" Frame duration must be in the range of [33333333, 33333333], value\n34387000 is out of range [32833332, 33833332])\"\n\nHow was 2% picked here ?\n\nSorry for making things difficult, but I'm always a bit concerned that\nmoving a tiny thing here would make some CTS test failures creep in\nunnoticed.\n\nThanks\n  j\n\n[1] [libcamera-internal] Question on camera stream durations\n\n> > > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > > It's notice that Chrome Camera App filters out the resolutions which cannot\n> > > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if FPS is lower\n> > > > within 2%.\n> > >\n> > > Unless I'm mistaken this patch doesn't depend on the rest of the series,\n> > > so we can review and merge it separately.\n> > >\n> > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > ---\n> > > >  src/android/camera_capabilities.cpp | 31 +++++++++++++++++++----------\n> > > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > >\n> > > > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> > > > index 55d651f3..e10ab036 100644\n> > > > --- a/src/android/camera_capabilities.cpp\n> > > > +++ b/src/android/camera_capabilities.cpp\n> > > > @@ -655,7 +655,9 @@ int CameraCapabilities::initializeStreamConfigurations()\n> > > >  \t\t\tint64_t maxFrameDuration = frameDurations->second.max().get<int64_t>() * 1000;\n> > > >\n> > > >  \t\t\t/*\n> > > > -\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance.\n> > > > +\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance,\n> > > > +\t\t\t * and elevate min frame duration to 30 FPS with 2%\n> > > > +\t\t\t * tolerance.\n> > > >  \t\t\t *\n> > > >  \t\t\t * 30 frames per second has been validated as the most\n> > > >  \t\t\t * opportune frame rate for quality tuning, and power\n> > > > @@ -675,17 +677,24 @@ int CameraCapabilities::initializeStreamConfigurations()\n> > > >  \t\t\t * to the in-development configuration API rework.\n> > > >  \t\t\t */\n> > > >  \t\t\tint64_t minFrameDurationCap = 1e9 / 30.0;\n> > > > -\t\t\tif (minFrameDuration < minFrameDurationCap) {\n> > > > -\t\t\t\tfloat tolerance =\n> > > > -\t\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > +\t\t\tfloat tolerance =\n> > > > +\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > >\n> > > > -\t\t\t\t/*\n> > > > -\t\t\t\t * If the tolerance is less than 1%, do not cap\n> > > > -\t\t\t\t * the frame duration.\n> > > > -\t\t\t\t */\n> > > > -\t\t\t\tif (tolerance > 1.0)\n> > > > -\t\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > > > -\t\t\t}\n> > > > +\t\t\t/*\n> > > > +\t\t\t * If the tolerance is less than 1%, do not cap\n> > > > +\t\t\t * the frame duration.\n> > > > +\t\t\t */\n> > > > +\t\t\tif (tolerance > 1.0)\n> > > > +\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > > > +\n> > > > +\t\t\t/*\n> > > > +\t\t\t * Some applications, ex: Chrome Camera App filters out\n> > > > +\t\t\t * the resolutions which cannot achieve 30 FPS. Elevate\n> > > > +\t\t\t * the minimum frame duration to 30 FPS if FPS is lower\n> > > > +\t\t\t * within 2%.\n> > > > +\t\t\t */\n> > > > +\t\t\tif (tolerance < 0 && tolerance > -2.0)\n> > > > +\t\t\t\tminFrameDuration = minFrameDurationCap;\n> > > >\n> > > >  \t\t\tstreamConfigurations_.push_back({\n> > > >  \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 E6E1DC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Apr 2022 07:09:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4520865643;\n\tWed,  6 Apr 2022 09:09:51 +0200 (CEST)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::222])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C89FD604B8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Apr 2022 09:09:49 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 569A840008;\n\tWed,  6 Apr 2022 07:09:48 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649228991;\n\tbh=Opz/cKeQJAliCRWpbe5asENbUEVYd6FqVjjFcqTumVA=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=EXnnLQoNkRLXkKlET5wjAR9dQ5PGxv1EdenrNLLAKK3ylA0oVYDtbN/z+DFwxmBeY\n\tssMR2zHDORTdH5YJ6g8qsiGmCZDZJAtwkdjC2lEJn3iEMiApGm5qQAZg+/A11jX/tC\n\tZYZV7tzpMBm2VD/3p95mpoOZWT4xKtNEZfpTFSMjBEG1Oica6Mi+38FZsmOd1C+v4I\n\tB/7/TbdbKMAKeCUyF6cRBp+A8JMPqKp9O02pcdOIrLyRQ9plkh0+nELmU5E2foRdXM\n\tnmszjAtDMW3wImT/NTZt3yVsKkhHcctHYCe05ZVDZnglGOpSDJZpuOn8w2o5XRkr1a\n\tQfNlzn7iDv+ew==","Date":"Wed, 6 Apr 2022 09:09:46 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22710,"web_url":"https://patchwork.libcamera.org/comment/22710/","msgid":"<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>","date":"2022-04-14T12:34:56","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":98,"url":"https://patchwork.libcamera.org/api/people/98/","name":"Hanlin Chen","email":"hanlinchen@chromium.org"},"content":"Hi Jacopo,\nSorry for the late reply.\n\nOn Wed, Apr 6, 2022 at 3:09 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n\n> Hello,\n>    sorry for being late\n>\n> On Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n> > On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> > > On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > > > Hi Han-Lin,\n> > > >\n> > > > Thank you for the patch.\n> > > >\n> > > > I'm CC'ing Jacopo and Umang as they've both spent a large amount of\n> time\n> > > > solving issues related to frame durations.\n> > >\n> > > And now with Umang's correct address.\n> >\n> > Jacopo, Umang, any feedback on this ?\n> >\n>\n> Let me recap a bit first.\n>\n> We currently adjust all durations > 33333333*101/100 to 33333333.\n> The idea was to avoid reporting any frame duration < 10^9/30\n> c7ae5a50c10de1e790855d66842192c766da4dd3\n> to bring the HAL in par with what the Intel HAL does.\n>\n> Umang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\n> situation to allow slightly faster durations to be reported, to please\n> CTS which would have otherwise complained if the actual duration was\n> smaller than the reported on.\n>\n> Hence, so far, we have been dealing with -faster- cameras than the\n> fixed 10^9/30 limit.\n>\n> Umang: do you recall how did we pick the 1% positive tolerance ?\n>\n> The issue here is instead that some -slower- cameras might need to be\n> adjusted and report a smaller frame duration than what they actually\n> produce. We had a lengthy discussion in the past [1] about how to report\n> correctly the durations of Nautilus which was reporting a duration of\n> 29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\n> not complaining. We ended up fixing the driver in\n> \"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\n> instead, if I'm not mistaken, resolutions that produce < 30 FPS are\n> not reported as part of the preview streams list (so only resolutions\n> up to 1080p are reported there).\n>\n> So I would like first to know what cameras and what resolutions\n> is this patch trying to please.\n>\n> Also, reading again the thread in [1] I realized CTS allows a 1.5%\n> tolerance\n>\n> \" Frame duration must be in the range of [33333333, 33333333], value\n> 34387000 is out of range [32833332, 33833332])\"\n>\n> How was 2% picked here ?\n>\n> Sorry for making things difficult, but I'm always a bit concerned that\n> moving a tiny thing here would make some CTS test failures creep in\n> unnoticed.\n>\n> Thanks\n>   j\n>\n> [1] [libcamera-internal] Question on camera stream durations\n>\n\nFor the front camera of soraka, thus OV5685, which reports frame duration\n33336000 for resolution larger than 720p.\nWhen calculating FPS, we did a slight elevation it due to CTS in\nf78f714b4486dbfd62bd62d7a479abc1d98d7495:\n\n// unsigned int fps = static_cast<unsigned int> (floor(1e9 /\nentry.minFrameDurationNsec + 0.05f));\n\nIt gets floor(29.997600192 + 0.5) = 30, and passes the bar.\nHowever, we still report the minFrameDuration as 33336000.\n\nI checked with the chrome team about their logic:\nChrome would only try the frame rate listed in\nANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\nwhich is elevated to 30 in the case, and filter out the stream with frame\nduration with 33336000, since its calculated FPS would be 29.97. As a\nresult, chrome rejects resolution > 720p for the front camera.\nOn the other hand, the back camera reports 33389000 for the full size. The\n2% is from the value, which is about 1.6% from 33333333.\n\nAfter a rethink, maybe I should elevate the min frame duration together\nwith where we elevate the FPS, instead of a 2% cap.\nOr try to centralize all adjustments on FPS/frame duration to an earlier\nstage.\n\n\n>\n> > > > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > > > It's notice that Chrome Camera App filters out the resolutions\n> which cannot\n> > > > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if\n> FPS is lower\n> > > > > within 2%.\n> > > >\n> > > > Unless I'm mistaken this patch doesn't depend on the rest of the\n> series,\n> > > > so we can review and merge it separately.\n> > > >\n> > > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > > ---\n> > > > >  src/android/camera_capabilities.cpp | 31\n> +++++++++++++++++++----------\n> > > > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > > >\n> > > > > diff --git a/src/android/camera_capabilities.cpp\n> b/src/android/camera_capabilities.cpp\n> > > > > index 55d651f3..e10ab036 100644\n> > > > > --- a/src/android/camera_capabilities.cpp\n> > > > > +++ b/src/android/camera_capabilities.cpp\n> > > > > @@ -655,7 +655,9 @@ int\n> CameraCapabilities::initializeStreamConfigurations()\n> > > > >                         int64_t maxFrameDuration =\n> frameDurations->second.max().get<int64_t>() * 1000;\n> > > > >\n> > > > >                         /*\n> > > > > -                        * Cap min frame duration to 30 FPS with\n> 1% tolerance.\n> > > > > +                        * Cap min frame duration to 30 FPS with\n> 1% tolerance,\n> > > > > +                        * and elevate min frame duration to 30\n> FPS with 2%\n> > > > > +                        * tolerance.\n> > > > >                          *\n> > > > >                          * 30 frames per second has been validated\n> as the most\n> > > > >                          * opportune frame rate for quality\n> tuning, and power\n> > > > > @@ -675,17 +677,24 @@ int\n> CameraCapabilities::initializeStreamConfigurations()\n> > > > >                          * to the in-development configuration API\n> rework.\n> > > > >                          */\n> > > > >                         int64_t minFrameDurationCap = 1e9 / 30.0;\n> > > > > -                       if (minFrameDuration <\n> minFrameDurationCap) {\n> > > > > -                               float tolerance =\n> > > > > -                                       (minFrameDurationCap -\n> minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > +                       float tolerance =\n> > > > > +                               (minFrameDurationCap -\n> minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > >\n> > > > > -                               /*\n> > > > > -                                * If the tolerance is less than\n> 1%, do not cap\n> > > > > -                                * the frame duration.\n> > > > > -                                */\n> > > > > -                               if (tolerance > 1.0)\n> > > > > -                                       minFrameDuration =\n> minFrameDurationCap;\n> > > > > -                       }\n> > > > > +                       /*\n> > > > > +                        * If the tolerance is less than 1%, do\n> not cap\n> > > > > +                        * the frame duration.\n> > > > > +                        */\n> > > > > +                       if (tolerance > 1.0)\n> > > > > +                               minFrameDuration =\n> minFrameDurationCap;\n> > > > > +\n> > > > > +                       /*\n> > > > > +                        * Some applications, ex: Chrome Camera\n> App filters out\n> > > > > +                        * the resolutions which cannot achieve 30\n> FPS. Elevate\n> > > > > +                        * the minimum frame duration to 30 FPS if\n> FPS is lower\n> > > > > +                        * within 2%.\n> > > > > +                        */\n> > > > > +                       if (tolerance < 0 && tolerance > -2.0)\n> > > > > +                               minFrameDuration =\n> minFrameDurationCap;\n> > > > >\n> > > > >                         streamConfigurations_.push_back({\n> > > > >                                 res, androidFormat,\n> minFrameDuration, maxFrameDuration,\n> >\n> > --\n> > Regards,\n> >\n> > Laurent Pinchart\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 B5043C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Apr 2022 12:35:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C2CEC65653;\n\tThu, 14 Apr 2022 14:35:10 +0200 (CEST)","from mail-ot1-x331.google.com (mail-ot1-x331.google.com\n\t[IPv6:2607:f8b0:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C69E965647\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 14:35:08 +0200 (CEST)","by mail-ot1-x331.google.com with SMTP id\n\tg16-20020a9d6b10000000b00601ded2a06fso200829otp.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 05:35:08 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649939710;\n\tbh=yENRabkMaO7YhW4fBmGMCe4jS9svl7EYbVtSxWHgaU8=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=VqDOdvPIuYjNvv2gcgz8ajyKUweNC8JKbkrmw59eqvRTeuvLxfLnz7UNgpRKxFOc2\n\tooD32ksPyEaOlgNjI3L1eanPtgmZCiL2e7EVa20xy8VFpjQBma1+0Qicx6SfE03ol8\n\tWZlFTuSd3NbxWsFoEWwWXpC3/jpb2GyW2BubIpYhedkarlF68Y7LJ9UHjX8AKhkyNo\n\tmrP67vLUeQwv8PRwM0A4FNUGgoy/nIUksz7BEjS2Wp2LGRveTd3we1voxbzUjnYyib\n\tyIASOEguPKPMatMIx1NCDe6QmFmXg8EzlTJuZgDYlnXZbxgIbUGhOUs1s8e/i1cnHR\n\thqxWuoMpjkK0A==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=6UNz+Sos911Nruf5hBMZjOCjtR1FWkvLuyRMPhHSr0o=;\n\tb=jNneqL1nDp5oDY+BwB9xkRJgrSOBRSOdQW3q0thT8VxcIuX+2M/aUEprgRDOxHvKW3\n\tkpA6mpn5KDT77QBgAw0+IIQMsqJ0DidocDAlz126FXsITc7+XoXFkBMzf7ztSuJdGvA1\n\tI9YEZi/R/lzGn99oBpZbGlcRtOzzy3jgWTH5M="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"jNneqL1n\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=6UNz+Sos911Nruf5hBMZjOCjtR1FWkvLuyRMPhHSr0o=;\n\tb=vW/sC3OCOE92ZtctJLXzueHh5yw2EDcSuMMu2rW3VkuGf75LZbifbKiCbycYqsbENo\n\trnVybQR9f/acPLjcx2lI+qSEGkhDF/KcqYQZf/Yx1ledLfFG5cMkEnOy6ZfVP8gxN10S\n\tvVnwhrtyNA7bCFl61rWWn1Qw8RyspZmwi9+F1GQkHnnXHyGC8AwfyKe4CLHdVtyl0dPF\n\tFuFi4cP74R41Sr/NwZQq9I7ynaKazsuHRHxUNzxRuW8fwOr7o+CEq18UPeNf5EbOokNN\n\tKhrpmpqSfQZ9nakea3kyQn9z5ubnVQp7onM77izv/stVOdo/AnBY0FUkzlxvZ+nGDkX4\n\tGGEA==","X-Gm-Message-State":"AOAM532mkqbFshtUSAGc7PIGuPEfOepSKG1w7HGApnn9WXSCfOUvRMOr\n\tdjZdkbRZq8jihcAKV4QxeB2haOWoi89L8qTCMsYJmw==","X-Google-Smtp-Source":"ABdhPJxtcSVTd5+ZwCj9rcI6PfEgxDxjl/21ThMz16y4pKA62/m757qeC/AlaryUxIMv36UiVpze9BFrjb6ruxbVmQI=","X-Received":"by 2002:a9d:1991:0:b0:5cd:b2a1:5c50 with SMTP id\n\tk17-20020a9d1991000000b005cdb2a15c50mr844974otk.217.1649939707418;\n\tThu, 14 Apr 2022 05:35:07 -0700 (PDT)","MIME-Version":"1.0","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>\n\t<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>","In-Reply-To":"<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>","Date":"Thu, 14 Apr 2022 20:34:56 +0800","Message-ID":"<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"multipart/alternative; boundary=\"000000000000296f4d05dc9c866d\"","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Hanlin Chen via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Hanlin Chen <hanlinchen@chromium.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22711,"web_url":"https://patchwork.libcamera.org/comment/22711/","msgid":"<ff64bae7-5a44-270a-ecc7-ab5702744643@ideasonboard.com>","date":"2022-04-14T18:42:19","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hello,\n\nOn 4/6/22 12:39, Jacopo Mondi wrote:\n> Hello,\n>     sorry for being late\n>\n> On Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n>> On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n>>> On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n>>>> Hi Han-Lin,\n>>>>\n>>>> Thank you for the patch.\n>>>>\n>>>> I'm CC'ing Jacopo and Umang as they've both spent a large amount of time\n>>>> solving issues related to frame durations.\n>>> And now with Umang's correct address.\n>> Jacopo, Umang, any feedback on this ?\n>>\n> Let me recap a bit first.\n>\n> We currently adjust all durations > 33333333*101/100 to 33333333.\n> The idea was to avoid reporting any frame duration < 10^9/30\n> c7ae5a50c10de1e790855d66842192c766da4dd3\n> to bring the HAL in par with what the Intel HAL does.\n>\n> Umang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\n> situation to allow slightly faster durations to be reported, to please\n> CTS which would have otherwise complained if the actual duration was\n> smaller than the reported on.\n>\n> Hence, so far, we have been dealing with -faster- cameras than the\n> fixed 10^9/30 limit.\n>\n> Umang: do you recall how did we pick the 1% positive tolerance ?\n\n\nThe 1% duration was picked as per nautilus' use-case (i.e. numerical \nvalues of minFrameDuration reported on nautilus).\n\nI didn't need more than anything more than 1% hence, we agreed that it's \na good tolerance % that can go in.\n\n>\n> The issue here is instead that some -slower- cameras might need to be\n> adjusted and report a smaller frame duration than what they actually\n> produce. We had a lengthy discussion in the past [1] about how to report\n> correctly the durations of Nautilus which was reporting a duration of\n> 29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\n> not complaining. We ended up fixing the driver in\n> \"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\n> instead, if I'm not mistaken, resolutions that produce < 30 FPS are\n> not reported as part of the preview streams list (so only resolutions\n> up to 1080p are reported there).\n>\n> So I would like first to know what cameras and what resolutions\n> is this patch trying to please.\n>\n> Also, reading again the thread in [1] I realized CTS allows a 1.5%\n> tolerance\n>\n> \" Frame duration must be in the range of [33333333, 33333333], value\n> 34387000 is out of range [32833332, 33833332])\"\n>\n> How was 2% picked here ?\n>\n> Sorry for making things difficult, but I'm always a bit concerned that\n> moving a tiny thing here would make some CTS test failures creep in\n> unnoticed.\n>\n> Thanks\n>    j\n>\n> [1] [libcamera-internal] Question on camera stream durations\n>\n>>>> On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n>>>>> It's notice that Chrome Camera App filters out the resolutions which cannot\n>>>>> achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if FPS is lower\n>>>>> within 2%.\n>>>> Unless I'm mistaken this patch doesn't depend on the rest of the series,\n>>>> so we can review and merge it separately.\n>>>>\n>>>>> Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n>>>>> ---\n>>>>>   src/android/camera_capabilities.cpp | 31 +++++++++++++++++++----------\n>>>>>   1 file changed, 20 insertions(+), 11 deletions(-)\n>>>>>\n>>>>> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n>>>>> index 55d651f3..e10ab036 100644\n>>>>> --- a/src/android/camera_capabilities.cpp\n>>>>> +++ b/src/android/camera_capabilities.cpp\n>>>>> @@ -655,7 +655,9 @@ int CameraCapabilities::initializeStreamConfigurations()\n>>>>>   \t\t\tint64_t maxFrameDuration = frameDurations->second.max().get<int64_t>() * 1000;\n>>>>>\n>>>>>   \t\t\t/*\n>>>>> -\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance.\n>>>>> +\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance,\n>>>>> +\t\t\t * and elevate min frame duration to 30 FPS with 2%\n>>>>> +\t\t\t * tolerance.\n>>>>>   \t\t\t *\n>>>>>   \t\t\t * 30 frames per second has been validated as the most\n>>>>>   \t\t\t * opportune frame rate for quality tuning, and power\n>>>>> @@ -675,17 +677,24 @@ int CameraCapabilities::initializeStreamConfigurations()\n>>>>>   \t\t\t * to the in-development configuration API rework.\n>>>>>   \t\t\t */\n>>>>>   \t\t\tint64_t minFrameDurationCap = 1e9 / 30.0;\n>>>>> -\t\t\tif (minFrameDuration < minFrameDurationCap) {\n>>>>> -\t\t\t\tfloat tolerance =\n>>>>> -\t\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n>>>>> +\t\t\tfloat tolerance =\n>>>>> +\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n>>>>>\n>>>>> -\t\t\t\t/*\n>>>>> -\t\t\t\t * If the tolerance is less than 1%, do not cap\n>>>>> -\t\t\t\t * the frame duration.\n>>>>> -\t\t\t\t */\n>>>>> -\t\t\t\tif (tolerance > 1.0)\n>>>>> -\t\t\t\t\tminFrameDuration = minFrameDurationCap;\n>>>>> -\t\t\t}\n>>>>> +\t\t\t/*\n>>>>> +\t\t\t * If the tolerance is less than 1%, do not cap\n>>>>> +\t\t\t * the frame duration.\n>>>>> +\t\t\t */\n>>>>> +\t\t\tif (tolerance > 1.0)\n>>>>> +\t\t\t\tminFrameDuration = minFrameDurationCap;\n>>>>> +\n>>>>> +\t\t\t/*\n>>>>> +\t\t\t * Some applications, ex: Chrome Camera App filters out\n>>>>> +\t\t\t * the resolutions which cannot achieve 30 FPS. Elevate\n>>>>> +\t\t\t * the minimum frame duration to 30 FPS if FPS is lower\n>>>>> +\t\t\t * within 2%.\n>>>>> +\t\t\t */\n>>>>> +\t\t\tif (tolerance < 0 && tolerance > -2.0)\n>>>>> +\t\t\t\tminFrameDuration = minFrameDurationCap;\n>>>>>\n>>>>>   \t\t\tstreamConfigurations_.push_back({\n>>>>>   \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,\n>> --\n>> Regards,\n>>\n>> Laurent Pinchart","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 C566EC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Apr 2022 18:42:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 154AA65641;\n\tThu, 14 Apr 2022 20:42:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8262465640\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 20:42:27 +0200 (CEST)","from [192.168.1.105] (unknown [103.74.73.10])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4EF84494;\n\tThu, 14 Apr 2022 20:42:24 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649961749;\n\tbh=nDdazm7zfi3RwZ4MtFXkvfWG7B/aYAn7y/hClpH6o5Q=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ptmqwtKisiIdIWvFo/iuqrXLScOusFlP7lAkSx+HLY5r7WKjwTdS2TeHTo//h6K8m\n\ttq892Bn0HADpUxBDdfapgUF2ukgzW0ECgnx1k6tVXdPFeQ5exOslZrKihAdbHty1zH\n\t/dJ45h6u1qUXrTgF+5zyKFyY6jqnlC+56cV88wnHTHHZ4yHa6NjcT4+WwU2qqdNv9r\n\tF4IsxtFNme8V7NxXwRVV7j6uPWA225bbJ5gbmtrDSynwRNGWmAqDB9v+Dl1h4YgMFl\n\thWOFFaNzXpqa7A57M3xEYEA8z5Z2A6kXmilKkJlCBCscsC2uGk8OQLE0zCRhHAEFc5\n\teYBStBkVgHxtQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649961747;\n\tbh=nDdazm7zfi3RwZ4MtFXkvfWG7B/aYAn7y/hClpH6o5Q=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=hgK2jz89SEttSM8WlO5dMVQRcLGNtxBeUWOXDKCqTJY+T1yalQkkWVJnq+dJiQhxj\n\tMNQS4AZcQhpyQFTEyv+8DlLWahEF1aV8vBpQ98GH6BQ36TY6LreCWTh+Fgl01H71ZS\n\tOVkU93AFNYt4tjZJZW/X2iTTtYh7veucufgXVPvk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"hgK2jz89\"; dkim-atps=neutral","Message-ID":"<ff64bae7-5a44-270a-ecc7-ab5702744643@ideasonboard.com>","Date":"Fri, 15 Apr 2022 00:12:19 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Jacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>\n\t<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>","In-Reply-To":"<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22714,"web_url":"https://patchwork.libcamera.org/comment/22714/","msgid":"<20220414202917.tyiqarac2scxvzrt@uno.localdomain>","date":"2022-04-14T20:29:17","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Han-Lin,\n\nOn Thu, Apr 14, 2022 at 08:34:56PM +0800, Hanlin Chen wrote:\n> Hi Jacopo,\n> Sorry for the late reply.\n>\n> On Wed, Apr 6, 2022 at 3:09 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> > Hello,\n> >    sorry for being late\n> >\n> > On Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n> > > On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> > > > On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > > > > Hi Han-Lin,\n> > > > >\n> > > > > Thank you for the patch.\n> > > > >\n> > > > > I'm CC'ing Jacopo and Umang as they've both spent a large amount of\n> > time\n> > > > > solving issues related to frame durations.\n> > > >\n> > > > And now with Umang's correct address.\n> > >\n> > > Jacopo, Umang, any feedback on this ?\n> > >\n> >\n> > Let me recap a bit first.\n> >\n> > We currently adjust all durations > 33333333*101/100 to 33333333.\n> > The idea was to avoid reporting any frame duration < 10^9/30\n> > c7ae5a50c10de1e790855d66842192c766da4dd3\n> > to bring the HAL in par with what the Intel HAL does.\n> >\n> > Umang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\n> > situation to allow slightly faster durations to be reported, to please\n> > CTS which would have otherwise complained if the actual duration was\n> > smaller than the reported on.\n> >\n> > Hence, so far, we have been dealing with -faster- cameras than the\n> > fixed 10^9/30 limit.\n> >\n> > Umang: do you recall how did we pick the 1% positive tolerance ?\n> >\n> > The issue here is instead that some -slower- cameras might need to be\n> > adjusted and report a smaller frame duration than what they actually\n> > produce. We had a lengthy discussion in the past [1] about how to report\n> > correctly the durations of Nautilus which was reporting a duration of\n> > 29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\n> > not complaining. We ended up fixing the driver in\n> > \"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\n> > instead, if I'm not mistaken, resolutions that produce < 30 FPS are\n> > not reported as part of the preview streams list (so only resolutions\n> > up to 1080p are reported there).\n> >\n> > So I would like first to know what cameras and what resolutions\n> > is this patch trying to please.\n> >\n> > Also, reading again the thread in [1] I realized CTS allows a 1.5%\n> > tolerance\n> >\n> > \" Frame duration must be in the range of [33333333, 33333333], value\n> > 34387000 is out of range [32833332, 33833332])\"\n> >\n> > How was 2% picked here ?\n> >\n> > Sorry for making things difficult, but I'm always a bit concerned that\n> > moving a tiny thing here would make some CTS test failures creep in\n> > unnoticed.\n> >\n> > Thanks\n> >   j\n> >\n> > [1] [libcamera-internal] Question on camera stream durations\n> >\n>\n> For the front camera of soraka, thus OV5685, which reports frame duration\n> 33336000 for resolution larger than 720p.\n> When calculating FPS, we did a slight elevation it due to CTS in\n> f78f714b4486dbfd62bd62d7a479abc1d98d7495:\n>\n> // unsigned int fps = static_cast<unsigned int> (floor(1e9 /\n> entry.minFrameDurationNsec + 0.05f));\n>\n> It gets floor(29.997600192 + 0.5) = 30, and passes the bar.\n> However, we still report the minFrameDuration as 33336000.\n>\n> I checked with the chrome team about their logic:\n> Chrome would only try the frame rate listed in\n> ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n> which is elevated to 30 in the case, and filter out the stream with frame\n> duration with 33336000, since its calculated FPS would be 29.97. As a\n> result, chrome rejects resolution > 720p for the front camera.\n\nIs this something new ? I recall we had 1080p for preview on Soraka.\nAm I mistaken ?\n\n> On the other hand, the back camera reports 33389000 for the full size. The\n> 2% is from the value, which is about 1.6% from 33333333.\n\nFull sizes are in facts not reported as 30-FPS capable streams, if I\nrecall correctly ?\n\n>\n> After a rethink, maybe I should elevate the min frame duration together\n> with where we elevate the FPS, instead of a 2% cap.\n> Or try to centralize all adjustments on FPS/frame duration to an earlier\n> stage.\n>\n\nIt would be indeed better to centralize all the adjustments, probably\nat CameraCapabilities::initializeStreamConfigurations() time.\n\nThe way we handle minFrameDurations is\n\nCameraCapabilities::initializeStreamConfigurations() {\n        int64_t minFrameDuration = frameDurations->second.min().get<int64_t>() * 1000;\n        ..\n\n        int64_t minFrameDurationCap = 1e9 / 30.0;\n        if (minFrameDuration < minFrameDurationCap) {\n                float tolerance =\n                        (minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n\n                /*\n                 * If the tolerance is less than 1%, do not cap\n                 * the frame duration.\n                 */\n                if (tolerance > 1.0)\n                        minFrameDuration = minFrameDurationCap;\n        }\n\n        streamConfigurations_.push_back({\n                res, androidFormat, minFrameDuration, maxFrameDuration,\n});\n\nSo here we adjust faster cameras to report max 30 FPS +- 1%\nThis was due to get in par with the Intel HAL, but might cause errors\nas some streams are -faster- than what we report here.\n\nWhen populating the ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT\ncamera property, as you noticed, we add a 0.05 to the calculated FPS to\naccept as 30-fps-capable streams that can do > 29.95.\n\n        unsigned int fps = static_cast<unsigned int>\n                           (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n        if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n                continue;\n\nAnd we use the adjusted FPS to later populate\nAE_AVAILABLE_TARGET_FPS_RANGE\n\n        /*\n         * Collect the FPS of the maximum YUV output size to populate\n         * AE_AVAILABLE_TARGET_FPS_RANGE\n         */\n        if (entry.androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888 &&\n            entry.resolution > maxYUVSize) {\n                maxYUVSize = entry.resolution;\n                maxYUVFps = fps;\n        }\n\n\tint32_t availableAeFpsTarget[] = {\n\t\tminFps, maxYUVFps, maxYUVFps, maxYUVFps,\n\t};\n\n\tstaticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n\t\t\t\t  availableAeFpsTarget);\n\n\nThen we populate ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS with the\nentry.minFrameDurationNsec value, without adjusting it.\n\n        /* Per-stream durations. */\n        minFrameDurations.push_back(entry.androidFormat);\n        minFrameDurations.push_back(entry.resolution.width);\n        minFrameDurations.push_back(entry.resolution.height);\n        minFrameDurations.push_back(entry.minFrameDurationNsec);\n\n\tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n\t\t\t\t  minFrameDurations);\n\nSo yes, we report a faster FPS in AE_AVAILABLE_TARGET_FPS_RANGE than the min\nframe duration reported in ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS.\n\nNow, a 2% tolerance seems a lot, but CTS has 1.5%, so it might be\nacceptable.\n\nI'm just afraid that if we adjust too much, then CTS will\ndetect that we report a min duration that doesn't match the actual\nmeasured one and complains because a stream slower than expected is\ndetected.\n\nAnyway, yes, we should adjust frame durations in a single place to\navoid reporting inconsistent information in the camera capabilities.\nThe question is how much to adjust ? :)\n\n}\n>\n> >\n> > > > > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > > > > It's notice that Chrome Camera App filters out the resolutions\n> > which cannot\n> > > > > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if\n> > FPS is lower\n> > > > > > within 2%.\n> > > > >\n> > > > > Unless I'm mistaken this patch doesn't depend on the rest of the\n> > series,\n> > > > > so we can review and merge it separately.\n> > > > >\n> > > > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > > > ---\n> > > > > >  src/android/camera_capabilities.cpp | 31\n> > +++++++++++++++++++----------\n> > > > > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > > > >\n> > > > > > diff --git a/src/android/camera_capabilities.cpp\n> > b/src/android/camera_capabilities.cpp\n> > > > > > index 55d651f3..e10ab036 100644\n> > > > > > --- a/src/android/camera_capabilities.cpp\n> > > > > > +++ b/src/android/camera_capabilities.cpp\n> > > > > > @@ -655,7 +655,9 @@ int\n> > CameraCapabilities::initializeStreamConfigurations()\n> > > > > >                         int64_t maxFrameDuration =\n> > frameDurations->second.max().get<int64_t>() * 1000;\n> > > > > >\n> > > > > >                         /*\n> > > > > > -                        * Cap min frame duration to 30 FPS with\n> > 1% tolerance.\n> > > > > > +                        * Cap min frame duration to 30 FPS with\n> > 1% tolerance,\n> > > > > > +                        * and elevate min frame duration to 30\n> > FPS with 2%\n> > > > > > +                        * tolerance.\n> > > > > >                          *\n> > > > > >                          * 30 frames per second has been validated\n> > as the most\n> > > > > >                          * opportune frame rate for quality\n> > tuning, and power\n> > > > > > @@ -675,17 +677,24 @@ int\n> > CameraCapabilities::initializeStreamConfigurations()\n> > > > > >                          * to the in-development configuration API\n> > rework.\n> > > > > >                          */\n> > > > > >                         int64_t minFrameDurationCap = 1e9 / 30.0;\n> > > > > > -                       if (minFrameDuration <\n> > minFrameDurationCap) {\n> > > > > > -                               float tolerance =\n> > > > > > -                                       (minFrameDurationCap -\n> > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > +                       float tolerance =\n> > > > > > +                               (minFrameDurationCap -\n> > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > >\n> > > > > > -                               /*\n> > > > > > -                                * If the tolerance is less than\n> > 1%, do not cap\n> > > > > > -                                * the frame duration.\n> > > > > > -                                */\n> > > > > > -                               if (tolerance > 1.0)\n> > > > > > -                                       minFrameDuration =\n> > minFrameDurationCap;\n> > > > > > -                       }\n> > > > > > +                       /*\n> > > > > > +                        * If the tolerance is less than 1%, do\n> > not cap\n> > > > > > +                        * the frame duration.\n> > > > > > +                        */\n> > > > > > +                       if (tolerance > 1.0)\n> > > > > > +                               minFrameDuration =\n> > minFrameDurationCap;\n> > > > > > +\n> > > > > > +                       /*\n> > > > > > +                        * Some applications, ex: Chrome Camera\n> > App filters out\n> > > > > > +                        * the resolutions which cannot achieve 30\n> > FPS. Elevate\n> > > > > > +                        * the minimum frame duration to 30 FPS if\n> > FPS is lower\n> > > > > > +                        * within 2%.\n> > > > > > +                        */\n> > > > > > +                       if (tolerance < 0 && tolerance > -2.0)\n> > > > > > +                               minFrameDuration =\n> > minFrameDurationCap;\n> > > > > >\n> > > > > >                         streamConfigurations_.push_back({\n> > > > > >                                 res, androidFormat,\n> > minFrameDuration, maxFrameDuration,\n> > >\n> > > --\n> > > Regards,\n> > >\n> > > Laurent Pinchart\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 D9E1AC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Apr 2022 20:29:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 403CC65647;\n\tThu, 14 Apr 2022 22:29:22 +0200 (CEST)","from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 589CE65640\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 22:29:21 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 8DA9220007;\n\tThu, 14 Apr 2022 20:29:19 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649968162;\n\tbh=Z6LA4ybS/Khb5azyXPtvwJ+r6/1qWAAzi1cbOBOhJNw=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ivfXUxWXEfsgueKiEIzZH0WPsOA5NlBpJ39avUvY3cvRxjDdwj9jj/ZwlFIjNLd9/\n\tW8EcxF3xLakmlJY5abh7Q7n+5Gv6FBM9iNkOo+qAjW7PyTQW1XRDhq9FOzInYZuwVU\n\tFTttm+oWuB9x45UQDBdyGP0SyrJuTKM5Un288KGIPkw6ZE5SeZ8M2Y5p7IJp6cc4Z9\n\tmAZCMHuNcAdaqkxHh03HpTkLsYYmYDefHXsRi1ARYxQ+o+jw7htGC7ugO+1TKrtnnj\n\tk16XzbEV25R5pPwqQtJ0ithxX0W5py+rx0uqfmXezQTLoSw0KZHqpPZ3Xt+1+2PJbc\n\th7zCeh1KLPfHw==","Date":"Thu, 14 Apr 2022 22:29:17 +0200","To":"Hanlin Chen <hanlinchen@chromium.org>","Message-ID":"<20220414202917.tyiqarac2scxvzrt@uno.localdomain>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>\n\t<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>\n\t<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22716,"web_url":"https://patchwork.libcamera.org/comment/22716/","msgid":"<CAJAuwM=CuNrOHPdt+a1zyWOb3Er-Ok4s5p9RCVw3FnE37+-esQ@mail.gmail.com>","date":"2022-04-15T03:56:35","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":98,"url":"https://patchwork.libcamera.org/api/people/98/","name":"Hanlin Chen","email":"hanlinchen@chromium.org"},"content":"Hi Jacopo,\n\nOn Fri, Apr 15, 2022 at 4:29 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Han-Lin,\n>\n> On Thu, Apr 14, 2022 at 08:34:56PM +0800, Hanlin Chen wrote:\n> > Hi Jacopo,\n> > Sorry for the late reply.\n> >\n> > On Wed, Apr 6, 2022 at 3:09 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> >\n> > > Hello,\n> > >    sorry for being late\n> > >\n> > > On Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n> > > > On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> > > > > On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > > > > > Hi Han-Lin,\n> > > > > >\n> > > > > > Thank you for the patch.\n> > > > > >\n> > > > > > I'm CC'ing Jacopo and Umang as they've both spent a large amount of\n> > > time\n> > > > > > solving issues related to frame durations.\n> > > > >\n> > > > > And now with Umang's correct address.\n> > > >\n> > > > Jacopo, Umang, any feedback on this ?\n> > > >\n> > >\n> > > Let me recap a bit first.\n> > >\n> > > We currently adjust all durations > 33333333*101/100 to 33333333.\n> > > The idea was to avoid reporting any frame duration < 10^9/30\n> > > c7ae5a50c10de1e790855d66842192c766da4dd3\n> > > to bring the HAL in par with what the Intel HAL does.\n> > >\n> > > Umang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\n> > > situation to allow slightly faster durations to be reported, to please\n> > > CTS which would have otherwise complained if the actual duration was\n> > > smaller than the reported on.\n> > >\n> > > Hence, so far, we have been dealing with -faster- cameras than the\n> > > fixed 10^9/30 limit.\n> > >\n> > > Umang: do you recall how did we pick the 1% positive tolerance ?\n> > >\n> > > The issue here is instead that some -slower- cameras might need to be\n> > > adjusted and report a smaller frame duration than what they actually\n> > > produce. We had a lengthy discussion in the past [1] about how to report\n> > > correctly the durations of Nautilus which was reporting a duration of\n> > > 29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\n> > > not complaining. We ended up fixing the driver in\n> > > \"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\n> > > instead, if I'm not mistaken, resolutions that produce < 30 FPS are\n> > > not reported as part of the preview streams list (so only resolutions\n> > > up to 1080p are reported there).\n> > >\n> > > So I would like first to know what cameras and what resolutions\n> > > is this patch trying to please.\n> > >\n> > > Also, reading again the thread in [1] I realized CTS allows a 1.5%\n> > > tolerance\n> > >\n> > > \" Frame duration must be in the range of [33333333, 33333333], value\n> > > 34387000 is out of range [32833332, 33833332])\"\n> > >\n> > > How was 2% picked here ?\n> > >\n> > > Sorry for making things difficult, but I'm always a bit concerned that\n> > > moving a tiny thing here would make some CTS test failures creep in\n> > > unnoticed.\n> > >\n> > > Thanks\n> > >   j\n> > >\n> > > [1] [libcamera-internal] Question on camera stream durations\n> > >\n> >\n> > For the front camera of soraka, thus OV5685, which reports frame duration\n> > 33336000 for resolution larger than 720p.\n> > When calculating FPS, we did a slight elevation it due to CTS in\n> > f78f714b4486dbfd62bd62d7a479abc1d98d7495:\n> >\n> > // unsigned int fps = static_cast<unsigned int> (floor(1e9 /\n> > entry.minFrameDurationNsec + 0.05f));\n> >\n> > It gets floor(29.997600192 + 0.5) = 30, and passes the bar.\n> > However, we still report the minFrameDuration as 33336000.\n> >\n> > I checked with the chrome team about their logic:\n> > Chrome would only try the frame rate listed in\n> > ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n> > which is elevated to 30 in the case, and filter out the stream with frame\n> > duration with 33336000, since its calculated FPS would be 29.97. As a\n> > result, chrome rejects resolution > 720p for the front camera.\n>\n> Is this something new ? I recall we had 1080p for preview on Soraka.\n> Am I mistaken ?\nCCA will accept 1080p but silently fall back to 480p. I notice it by\nchecking its expert mode accidentally.\n>\n> > On the other hand, the back camera reports 33389000 for the full size. The\n> > 2% is from the value, which is about 1.6% from 33333333.\n>\n> Full sizes are in facts not reported as 30-FPS capable streams, if I\n> recall correctly ?\n>\n> >\n> > After a rethink, maybe I should elevate the min frame duration together\n> > with where we elevate the FPS, instead of a 2% cap.\n> > Or try to centralize all adjustments on FPS/frame duration to an earlier\n> > stage.\n> >\n>\n> It would be indeed better to centralize all the adjustments, probably\n> at CameraCapabilities::initializeStreamConfigurations() time.\n>\n> The way we handle minFrameDurations is\n>\n> CameraCapabilities::initializeStreamConfigurations() {\n>         int64_t minFrameDuration = frameDurations->second.min().get<int64_t>() * 1000;\n>         ..\n>\n>         int64_t minFrameDurationCap = 1e9 / 30.0;\n>         if (minFrameDuration < minFrameDurationCap) {\n>                 float tolerance =\n>                         (minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n>\n>                 /*\n>                  * If the tolerance is less than 1%, do not cap\n>                  * the frame duration.\n>                  */\n>                 if (tolerance > 1.0)\n>                         minFrameDuration = minFrameDurationCap;\n>         }\n>\n>         streamConfigurations_.push_back({\n>                 res, androidFormat, minFrameDuration, maxFrameDuration,\n> });\n>\n> So here we adjust faster cameras to report max 30 FPS +- 1%\n> This was due to get in par with the Intel HAL, but might cause errors\n> as some streams are -faster- than what we report here.\n>\n> When populating the ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT\n> camera property, as you noticed, we add a 0.05 to the calculated FPS to\n> accept as 30-fps-capable streams that can do > 29.95.\n>\n>         unsigned int fps = static_cast<unsigned int>\n>                            (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n>         if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n>                 continue;\n>\n> And we use the adjusted FPS to later populate\n> AE_AVAILABLE_TARGET_FPS_RANGE\n>\n>         /*\n>          * Collect the FPS of the maximum YUV output size to populate\n>          * AE_AVAILABLE_TARGET_FPS_RANGE\n>          */\n>         if (entry.androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888 &&\n>             entry.resolution > maxYUVSize) {\n>                 maxYUVSize = entry.resolution;\n>                 maxYUVFps = fps;\n>         }\n>\n>         int32_t availableAeFpsTarget[] = {\n>                 minFps, maxYUVFps, maxYUVFps, maxYUVFps,\n>         };\n>\n>         staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n>                                   availableAeFpsTarget);\n>\n>\n> Then we populate ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS with the\n> entry.minFrameDurationNsec value, without adjusting it.\n>\n>         /* Per-stream durations. */\n>         minFrameDurations.push_back(entry.androidFormat);\n>         minFrameDurations.push_back(entry.resolution.width);\n>         minFrameDurations.push_back(entry.resolution.height);\n>         minFrameDurations.push_back(entry.minFrameDurationNsec);\n>\n>         staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n>                                   minFrameDurations);\n>\n> So yes, we report a faster FPS in AE_AVAILABLE_TARGET_FPS_RANGE than the min\n> frame duration reported in ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS.\n>\n> Now, a 2% tolerance seems a lot, but CTS has 1.5%, so it might be\n> acceptable.\n>\n> I'm just afraid that if we adjust too much, then CTS will\n> detect that we report a min duration that doesn't match the actual\n> measured one and complains because a stream slower than expected is\n> detected.\n>\n> Anyway, yes, we should adjust frame durations in a single place to\n> avoid reporting inconsistent information in the camera capabilities.\n> The question is how much to adjust ? :)\n\nYes, I was thinking of elevating it to where we elevate the FPS. Maybe:\n\nunsigned int fps = static_cast<unsigned int>\n   (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n\n/*\n* Since CTS calculate FPS with additional 0.05f before taking\n* floor. Adjust the reported min frame duration accordingly.\n*/\nint64_t adjustedMinFrameDurationNsec = 1e9 / fps;\n\nif (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\ncontinue;\n\nAnd then we can abandon the 2% in the patch.\n>\n> }\n> >\n> > >\n> > > > > > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > > > > > It's notice that Chrome Camera App filters out the resolutions\n> > > which cannot\n> > > > > > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if\n> > > FPS is lower\n> > > > > > > within 2%.\n> > > > > >\n> > > > > > Unless I'm mistaken this patch doesn't depend on the rest of the\n> > > series,\n> > > > > > so we can review and merge it separately.\n> > > > > >\n> > > > > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > > > > ---\n> > > > > > >  src/android/camera_capabilities.cpp | 31\n> > > +++++++++++++++++++----------\n> > > > > > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > > > > >\n> > > > > > > diff --git a/src/android/camera_capabilities.cpp\n> > > b/src/android/camera_capabilities.cpp\n> > > > > > > index 55d651f3..e10ab036 100644\n> > > > > > > --- a/src/android/camera_capabilities.cpp\n> > > > > > > +++ b/src/android/camera_capabilities.cpp\n> > > > > > > @@ -655,7 +655,9 @@ int\n> > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > >                         int64_t maxFrameDuration =\n> > > frameDurations->second.max().get<int64_t>() * 1000;\n> > > > > > >\n> > > > > > >                         /*\n> > > > > > > -                        * Cap min frame duration to 30 FPS with\n> > > 1% tolerance.\n> > > > > > > +                        * Cap min frame duration to 30 FPS with\n> > > 1% tolerance,\n> > > > > > > +                        * and elevate min frame duration to 30\n> > > FPS with 2%\n> > > > > > > +                        * tolerance.\n> > > > > > >                          *\n> > > > > > >                          * 30 frames per second has been validated\n> > > as the most\n> > > > > > >                          * opportune frame rate for quality\n> > > tuning, and power\n> > > > > > > @@ -675,17 +677,24 @@ int\n> > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > >                          * to the in-development configuration API\n> > > rework.\n> > > > > > >                          */\n> > > > > > >                         int64_t minFrameDurationCap = 1e9 / 30.0;\n> > > > > > > -                       if (minFrameDuration <\n> > > minFrameDurationCap) {\n> > > > > > > -                               float tolerance =\n> > > > > > > -                                       (minFrameDurationCap -\n> > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > > +                       float tolerance =\n> > > > > > > +                               (minFrameDurationCap -\n> > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > >\n> > > > > > > -                               /*\n> > > > > > > -                                * If the tolerance is less than\n> > > 1%, do not cap\n> > > > > > > -                                * the frame duration.\n> > > > > > > -                                */\n> > > > > > > -                               if (tolerance > 1.0)\n> > > > > > > -                                       minFrameDuration =\n> > > minFrameDurationCap;\n> > > > > > > -                       }\n> > > > > > > +                       /*\n> > > > > > > +                        * If the tolerance is less than 1%, do\n> > > not cap\n> > > > > > > +                        * the frame duration.\n> > > > > > > +                        */\n> > > > > > > +                       if (tolerance > 1.0)\n> > > > > > > +                               minFrameDuration =\n> > > minFrameDurationCap;\n> > > > > > > +\n> > > > > > > +                       /*\n> > > > > > > +                        * Some applications, ex: Chrome Camera\n> > > App filters out\n> > > > > > > +                        * the resolutions which cannot achieve 30\n> > > FPS. Elevate\n> > > > > > > +                        * the minimum frame duration to 30 FPS if\n> > > FPS is lower\n> > > > > > > +                        * within 2%.\n> > > > > > > +                        */\n> > > > > > > +                       if (tolerance < 0 && tolerance > -2.0)\n> > > > > > > +                               minFrameDuration =\n> > > minFrameDurationCap;\n> > > > > > >\n> > > > > > >                         streamConfigurations_.push_back({\n> > > > > > >                                 res, androidFormat,\n> > > minFrameDuration, maxFrameDuration,\n> > > >\n> > > > --\n> > > > Regards,\n> > > >\n> > > > Laurent Pinchart\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 DDE12C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Apr 2022 03:56:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BF6E65646;\n\tFri, 15 Apr 2022 05:56:50 +0200 (CEST)","from mail-oi1-x230.google.com (mail-oi1-x230.google.com\n\t[IPv6:2607:f8b0:4864:20::230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7C2FE65640\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 05:56:47 +0200 (CEST)","by mail-oi1-x230.google.com with SMTP id z2so3059460oic.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 20:56:47 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649995010;\n\tbh=/Pk7p9QYlrndFaknFh+8A1HDybMTg7k3RUnOxB4/7WQ=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=A09CgYXNNRBUQT+XI95l/OrD6skOPa1bBwYIstVuyXRmTzfpPXAmrcj2Tr69E+nVj\n\tRW6FgxYaadt1nW3ZfFCZQUQCG8zLyg9KYEvJgBLIzFUQsXSYczXdpHRFEzu5W8okM6\n\tHcCXJsnXV1o3pQTRLSH8o8yyChbm/DTVtV2G0Rsto7S2rXhMx3PEN3li1PRoZfrcAZ\n\tzR4fnjLbui2DPCc0QnhF3UE2KozKYKT/WXrqOPksI3wkZl7oLkUkF0YWvT40v8KV6T\n\tuXcd7M+qWpQ65BXvL/SprDzORYE+bMuvzfiugQ/f3jSrNlDPx8v4elr43SQFgWrXVM\n\tQek2BrdqbmNwQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=pTHW42b5GMDQ+rq/VW3f/YBgcqNWqPr3QHtZipf5R8Q=;\n\tb=ESxcYPkhFnT2Jm0pEfn9PkERs4om25VMg6gNzlEEG0LOI+8ClwFbMcsRVTZIgYr1cZ\n\t+Mvqp0Z8Z0wU06/qK3tDU6qisMKeHCk0mkRxF+oeW1pbG1PBiHwTZKONqA8AGFz0MfR4\n\t17CvcxVmlT/rBVGVli1XNq1+w+xYtH+R6Luag="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"ESxcYPkh\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=pTHW42b5GMDQ+rq/VW3f/YBgcqNWqPr3QHtZipf5R8Q=;\n\tb=mpNiXz0W7kppiec8uTT7e7apoC8IR/G6AMXCILmtgJ/tma8xbcR+Zc1lshAUO3sAId\n\tWx8CWapHoT7F4pMJ4JcuTX9cp7bEMACfPDBvdtED2EkFjwSICjMbAUxXh1o+U2Vn1pUK\n\tHTyX/joGPXpuLvEBP6TbDafoL8g/No1jOuFsCJiZJ+GFMmNOeyi0mO1g05CTlZ5UalXz\n\tZv7AiyzcqdFGtKd1Gztjh+oG7Wzn8vygVN1Q+LseO+iZ3ns8yM6ga2zpeYoOw31f0R69\n\tZyzQq6ec5H5hc6aNUdiIT5oWCTHRQ7RiFmovwmVf/cKIxwwUXh4fWJpAPqILu+E2RoPA\n\tHZqg==","X-Gm-Message-State":"AOAM530Z5if8t8lfIqf9E+5GoSyIrObDTAl7HxLWwn1dGPGokX0nsPxf\n\tOo0m6voXcdfnF31fpXUoAMc28eTOwJ3CP//ycLKWCw==","X-Google-Smtp-Source":"ABdhPJyThqYnvw93xDZo/ZN091Es/t7PO7zSNzVunX6zLUhrLQFPnkncjS7Fxpg4rwelmyDyKTJ29lyW+MZb0TJF/U0=","X-Received":"by 2002:a05:6808:1246:b0:2c9:efa5:7209 with SMTP id\n\to6-20020a056808124600b002c9efa57209mr854019oiv.62.1649995005882;\n\tThu, 14 Apr 2022 20:56:45 -0700 (PDT)","MIME-Version":"1.0","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>\n\t<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>\n\t<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>\n\t<20220414202917.tyiqarac2scxvzrt@uno.localdomain>","In-Reply-To":"<20220414202917.tyiqarac2scxvzrt@uno.localdomain>","Date":"Fri, 15 Apr 2022 11:56:35 +0800","Message-ID":"<CAJAuwM=CuNrOHPdt+a1zyWOb3Er-Ok4s5p9RCVw3FnE37+-esQ@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Hanlin Chen via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Hanlin Chen <hanlinchen@chromium.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22718,"web_url":"https://patchwork.libcamera.org/comment/22718/","msgid":"<CAJAuwMk5sCNngNXFdisBDHe5WyK8oaMCBBBjxyWvqgseGj-4UQ@mail.gmail.com>","date":"2022-04-15T04:51:45","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":98,"url":"https://patchwork.libcamera.org/api/people/98/","name":"Hanlin Chen","email":"hanlinchen@chromium.org"},"content":"Hi Jacopo,\nSorry for the separate email.\n\nOn Fri, Apr 15, 2022 at 4:29 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Han-Lin,\n>\n> On Thu, Apr 14, 2022 at 08:34:56PM +0800, Hanlin Chen wrote:\n> > Hi Jacopo,\n> > Sorry for the late reply.\n> >\n> > On Wed, Apr 6, 2022 at 3:09 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> >\n> > > Hello,\n> > >    sorry for being late\n> > >\n> > > On Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n> > > > On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> > > > > On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > > > > > Hi Han-Lin,\n> > > > > >\n> > > > > > Thank you for the patch.\n> > > > > >\n> > > > > > I'm CC'ing Jacopo and Umang as they've both spent a large amount of\n> > > time\n> > > > > > solving issues related to frame durations.\n> > > > >\n> > > > > And now with Umang's correct address.\n> > > >\n> > > > Jacopo, Umang, any feedback on this ?\n> > > >\n> > >\n> > > Let me recap a bit first.\n> > >\n> > > We currently adjust all durations > 33333333*101/100 to 33333333.\n> > > The idea was to avoid reporting any frame duration < 10^9/30\n> > > c7ae5a50c10de1e790855d66842192c766da4dd3\n> > > to bring the HAL in par with what the Intel HAL does.\n> > >\n> > > Umang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\n> > > situation to allow slightly faster durations to be reported, to please\n> > > CTS which would have otherwise complained if the actual duration was\n> > > smaller than the reported on.\n> > >\n> > > Hence, so far, we have been dealing with -faster- cameras than the\n> > > fixed 10^9/30 limit.\n> > >\n> > > Umang: do you recall how did we pick the 1% positive tolerance ?\n> > >\n> > > The issue here is instead that some -slower- cameras might need to be\n> > > adjusted and report a smaller frame duration than what they actually\n> > > produce. We had a lengthy discussion in the past [1] about how to report\n> > > correctly the durations of Nautilus which was reporting a duration of\n> > > 29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\n> > > not complaining. We ended up fixing the driver in\n> > > \"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\n> > > instead, if I'm not mistaken, resolutions that produce < 30 FPS are\n> > > not reported as part of the preview streams list (so only resolutions\n> > > up to 1080p are reported there).\n> > >\n> > > So I would like first to know what cameras and what resolutions\n> > > is this patch trying to please.\n> > >\n> > > Also, reading again the thread in [1] I realized CTS allows a 1.5%\n> > > tolerance\n> > >\n> > > \" Frame duration must be in the range of [33333333, 33333333], value\n> > > 34387000 is out of range [32833332, 33833332])\"\n> > >\n> > > How was 2% picked here ?\n> > >\n> > > Sorry for making things difficult, but I'm always a bit concerned that\n> > > moving a tiny thing here would make some CTS test failures creep in\n> > > unnoticed.\n> > >\n> > > Thanks\n> > >   j\n> > >\n> > > [1] [libcamera-internal] Question on camera stream durations\n> > >\n> >\n> > For the front camera of soraka, thus OV5685, which reports frame duration\n> > 33336000 for resolution larger than 720p.\n> > When calculating FPS, we did a slight elevation it due to CTS in\n> > f78f714b4486dbfd62bd62d7a479abc1d98d7495:\n> >\n> > // unsigned int fps = static_cast<unsigned int> (floor(1e9 /\n> > entry.minFrameDurationNsec + 0.05f));\n> >\n> > It gets floor(29.997600192 + 0.5) = 30, and passes the bar.\n> > However, we still report the minFrameDuration as 33336000.\n> >\n> > I checked with the chrome team about their logic:\n> > Chrome would only try the frame rate listed in\n> > ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n> > which is elevated to 30 in the case, and filter out the stream with frame\n> > duration with 33336000, since its calculated FPS would be 29.97. As a\n> > result, chrome rejects resolution > 720p for the front camera.\n>\n> Is this something new ? I recall we had 1080p for preview on Soraka.\n> Am I mistaken ?\n>\n> > On the other hand, the back camera reports 33389000 for the full size. The\n> > 2% is from the value, which is about 1.6% from 33333333.\n>\n> Full sizes are in facts not reported as 30-FPS capable streams, if I\n> recall correctly ?\n\nAnother reason is due to the configuration file. The config tuned by\nIntel always sets the sensor to full size.\nSince we calculate the FrameDurationLimit by sensor size. The min\nduration would always be 33389000.\nI suppose this is why shipped soraka does not encounter the 1% faster\nproblem in CTS, since it's actually slower.\nIt's a little awkward, since 1e9 / 33389000 = 29.49983, slightly less\nthan the bar 29.5. =.=\nThe only way I can think of is to change the FrameDurationLimit\ncalculation in close sourced IPA.\n\n>\n> >\n> > After a rethink, maybe I should elevate the min frame duration together\n> > with where we elevate the FPS, instead of a 2% cap.\n> > Or try to centralize all adjustments on FPS/frame duration to an earlier\n> > stage.\n> >\n>\n> It would be indeed better to centralize all the adjustments, probably\n> at CameraCapabilities::initializeStreamConfigurations() time.\n>\n> The way we handle minFrameDurations is\n>\n> CameraCapabilities::initializeStreamConfigurations() {\n>         int64_t minFrameDuration = frameDurations->second.min().get<int64_t>() * 1000;\n>         ..\n>\n>         int64_t minFrameDurationCap = 1e9 / 30.0;\n>         if (minFrameDuration < minFrameDurationCap) {\n>                 float tolerance =\n>                         (minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n>\n>                 /*\n>                  * If the tolerance is less than 1%, do not cap\n>                  * the frame duration.\n>                  */\n>                 if (tolerance > 1.0)\n>                         minFrameDuration = minFrameDurationCap;\n>         }\n>\n>         streamConfigurations_.push_back({\n>                 res, androidFormat, minFrameDuration, maxFrameDuration,\n> });\n>\n> So here we adjust faster cameras to report max 30 FPS +- 1%\n> This was due to get in par with the Intel HAL, but might cause errors\n> as some streams are -faster- than what we report here.\n>\n> When populating the ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT\n> camera property, as you noticed, we add a 0.05 to the calculated FPS to\n> accept as 30-fps-capable streams that can do > 29.95.\n>\n>         unsigned int fps = static_cast<unsigned int>\n>                            (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n>         if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n>                 continue;\n>\n> And we use the adjusted FPS to later populate\n> AE_AVAILABLE_TARGET_FPS_RANGE\n>\n>         /*\n>          * Collect the FPS of the maximum YUV output size to populate\n>          * AE_AVAILABLE_TARGET_FPS_RANGE\n>          */\n>         if (entry.androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888 &&\n>             entry.resolution > maxYUVSize) {\n>                 maxYUVSize = entry.resolution;\n>                 maxYUVFps = fps;\n>         }\n>\n>         int32_t availableAeFpsTarget[] = {\n>                 minFps, maxYUVFps, maxYUVFps, maxYUVFps,\n>         };\n>\n>         staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n>                                   availableAeFpsTarget);\n>\n>\n> Then we populate ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS with the\n> entry.minFrameDurationNsec value, without adjusting it.\n>\n>         /* Per-stream durations. */\n>         minFrameDurations.push_back(entry.androidFormat);\n>         minFrameDurations.push_back(entry.resolution.width);\n>         minFrameDurations.push_back(entry.resolution.height);\n>         minFrameDurations.push_back(entry.minFrameDurationNsec);\n>\n>         staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n>                                   minFrameDurations);\n>\n> So yes, we report a faster FPS in AE_AVAILABLE_TARGET_FPS_RANGE than the min\n> frame duration reported in ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS.\n>\n> Now, a 2% tolerance seems a lot, but CTS has 1.5%, so it might be\n> acceptable.\n>\n> I'm just afraid that if we adjust too much, then CTS will\n> detect that we report a min duration that doesn't match the actual\n> measured one and complains because a stream slower than expected is\n> detected.\n>\n> Anyway, yes, we should adjust frame durations in a single place to\n> avoid reporting inconsistent information in the camera capabilities.\n> The question is how much to adjust ? :)\n>\n> }\n> >\n> > >\n> > > > > > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > > > > > It's notice that Chrome Camera App filters out the resolutions\n> > > which cannot\n> > > > > > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if\n> > > FPS is lower\n> > > > > > > within 2%.\n> > > > > >\n> > > > > > Unless I'm mistaken this patch doesn't depend on the rest of the\n> > > series,\n> > > > > > so we can review and merge it separately.\n> > > > > >\n> > > > > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > > > > ---\n> > > > > > >  src/android/camera_capabilities.cpp | 31\n> > > +++++++++++++++++++----------\n> > > > > > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > > > > >\n> > > > > > > diff --git a/src/android/camera_capabilities.cpp\n> > > b/src/android/camera_capabilities.cpp\n> > > > > > > index 55d651f3..e10ab036 100644\n> > > > > > > --- a/src/android/camera_capabilities.cpp\n> > > > > > > +++ b/src/android/camera_capabilities.cpp\n> > > > > > > @@ -655,7 +655,9 @@ int\n> > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > >                         int64_t maxFrameDuration =\n> > > frameDurations->second.max().get<int64_t>() * 1000;\n> > > > > > >\n> > > > > > >                         /*\n> > > > > > > -                        * Cap min frame duration to 30 FPS with\n> > > 1% tolerance.\n> > > > > > > +                        * Cap min frame duration to 30 FPS with\n> > > 1% tolerance,\n> > > > > > > +                        * and elevate min frame duration to 30\n> > > FPS with 2%\n> > > > > > > +                        * tolerance.\n> > > > > > >                          *\n> > > > > > >                          * 30 frames per second has been validated\n> > > as the most\n> > > > > > >                          * opportune frame rate for quality\n> > > tuning, and power\n> > > > > > > @@ -675,17 +677,24 @@ int\n> > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > >                          * to the in-development configuration API\n> > > rework.\n> > > > > > >                          */\n> > > > > > >                         int64_t minFrameDurationCap = 1e9 / 30.0;\n> > > > > > > -                       if (minFrameDuration <\n> > > minFrameDurationCap) {\n> > > > > > > -                               float tolerance =\n> > > > > > > -                                       (minFrameDurationCap -\n> > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > > +                       float tolerance =\n> > > > > > > +                               (minFrameDurationCap -\n> > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > >\n> > > > > > > -                               /*\n> > > > > > > -                                * If the tolerance is less than\n> > > 1%, do not cap\n> > > > > > > -                                * the frame duration.\n> > > > > > > -                                */\n> > > > > > > -                               if (tolerance > 1.0)\n> > > > > > > -                                       minFrameDuration =\n> > > minFrameDurationCap;\n> > > > > > > -                       }\n> > > > > > > +                       /*\n> > > > > > > +                        * If the tolerance is less than 1%, do\n> > > not cap\n> > > > > > > +                        * the frame duration.\n> > > > > > > +                        */\n> > > > > > > +                       if (tolerance > 1.0)\n> > > > > > > +                               minFrameDuration =\n> > > minFrameDurationCap;\n> > > > > > > +\n> > > > > > > +                       /*\n> > > > > > > +                        * Some applications, ex: Chrome Camera\n> > > App filters out\n> > > > > > > +                        * the resolutions which cannot achieve 30\n> > > FPS. Elevate\n> > > > > > > +                        * the minimum frame duration to 30 FPS if\n> > > FPS is lower\n> > > > > > > +                        * within 2%.\n> > > > > > > +                        */\n> > > > > > > +                       if (tolerance < 0 && tolerance > -2.0)\n> > > > > > > +                               minFrameDuration =\n> > > minFrameDurationCap;\n> > > > > > >\n> > > > > > >                         streamConfigurations_.push_back({\n> > > > > > >                                 res, androidFormat,\n> > > minFrameDuration, maxFrameDuration,\n> > > >\n> > > > --\n> > > > Regards,\n> > > >\n> > > > Laurent Pinchart\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 091E1C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Apr 2022 04:52:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3C58D65646;\n\tFri, 15 Apr 2022 06:51:59 +0200 (CEST)","from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com\n\t[IPv6:2607:f8b0:4864:20::22b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3271165640\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 06:51:58 +0200 (CEST)","by mail-oi1-x22b.google.com with SMTP id q129so7521161oif.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Apr 2022 21:51:58 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649998319;\n\tbh=SJRWZXCdCglvzVFinM/Th9UqscZgy3zVnwRjtANZg7o=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=jqKHXv82DDnhXMWvRPEn4kyQYZEocEonSOsVjgXlE1d8OWptypYYOwYYqnFYbGl5a\n\tUnSxWt+BRPzHw/UTnfg/dRBRMV5xk4u79iBb3DVtaZ9ebD45uyAOKakKNmxC/8GxUa\n\t9D41CuTEgHlrIIRldKyBth2xnUyAPW8hRGHZsN0Sy2585yvlIqcyzmdainMnQs3A/z\n\tBNihfrE+erocA7IasM9dq5CQS51CDimNWf7MjK8ON17BM3wMuO11Bkx4sJPfRwnxts\n\tE3z3IalqBPw8hYFOr1v9kZGcXpWMbRRmF2Ys+ATGpGAt5662kNqCxO9DJrjLKp/XJr\n\t5VtjOJcz1C8zA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=df+DOw6A0yiCAcEjFolTNSS84D7L4Kut8pnH4gAaZCg=;\n\tb=Qfv0ze05BZCag5uv6i927/a7/kfFeIbFIxuTbmpUu7ydYlHvk47IGzfrv0IE+S9n6u\n\t5B1YanXlpHKsTcagy/UHsSooCHUVkWjcpqdUnp8KrEYkiKgNTTcNmZSiTRMaYvFhthZL\n\tNA/4LFf5GekKKeQYe+kl5z9jz0Xq00uPf4ATQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"Qfv0ze05\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=df+DOw6A0yiCAcEjFolTNSS84D7L4Kut8pnH4gAaZCg=;\n\tb=cedTaclX4ZRFHLuxGnbLFvLJdEdyFZD0Mzn7nWVEEuLYa684ZpZieVCNUhuxIOvYH9\n\tCo3LokgifkXjQ18HsNMWUagL4HCnF9iTg4nzHEhKmE8Ct55xr33BVGYCUjyPj+a0pvhs\n\tLpZBuufZx6lFLt+FU3xWOiOjTAOLqOcVZBupry7M8Wtt28Orb1LcCtjwzM7xHKUssVkP\n\tdNgoHXBOY3ZZFERCQi9NYRe7F9QejGsSf4eCG0z2pIVnDZ6s9t1q3ABB+USAgX8cp4pY\n\t19jZr2IjD4YM5bqtOdBVdL8V7oxLXIn7oRDMLE0c/ksnAwU5lLgQMcXNgDvlHwyPAzAP\n\tMOOA==","X-Gm-Message-State":"AOAM532dxjWMqwjLe9hV+Go6spPGLtYhtUF6QCl8aZ6oXvBn8un2zh+Y\n\tkXYXw4Tl7NFtRmV8ZPTBcoa8YEyQkDK/8n6JsXPfls/l8YL0zA==","X-Google-Smtp-Source":"ABdhPJwy4mK+5+AKuZObsczTNlrWxus6hJgA+vOcZ11wpYsKC+0QAVKmGx2rvnzQYuVc/4Jz5wMhQRuq410t6Y7nnAE=","X-Received":"by 2002:a05:6808:14c4:b0:31e:8965:52d1 with SMTP id\n\tf4-20020a05680814c400b0031e896552d1mr909292oiw.65.1649998316608;\n\tThu, 14 Apr 2022 21:51:56 -0700 (PDT)","MIME-Version":"1.0","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>\n\t<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>\n\t<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>\n\t<20220414202917.tyiqarac2scxvzrt@uno.localdomain>","In-Reply-To":"<20220414202917.tyiqarac2scxvzrt@uno.localdomain>","Date":"Fri, 15 Apr 2022 12:51:45 +0800","Message-ID":"<CAJAuwMk5sCNngNXFdisBDHe5WyK8oaMCBBBjxyWvqgseGj-4UQ@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Hanlin Chen via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Hanlin Chen <hanlinchen@chromium.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22720,"web_url":"https://patchwork.libcamera.org/comment/22720/","msgid":"<20220415074952.nihwrh72biehfcrs@uno.localdomain>","date":"2022-04-15T07:49:52","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Han-Lin,\n\nOn Fri, Apr 15, 2022 at 12:51:45PM +0800, Hanlin Chen wrote:\n> Hi Jacopo,\n> Sorry for the separate email.\n>\n> On Fri, Apr 15, 2022 at 4:29 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> >\n> > Hi Han-Lin,\n> >\n> > On Thu, Apr 14, 2022 at 08:34:56PM +0800, Hanlin Chen wrote:\n> > > Hi Jacopo,\n> > > Sorry for the late reply.\n> > >\n> > > On Wed, Apr 6, 2022 at 3:09 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> > >\n> > > > Hello,\n> > > >    sorry for being late\n> > > >\n> > > > On Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n> > > > > On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> > > > > > On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > > > > > > Hi Han-Lin,\n> > > > > > >\n> > > > > > > Thank you for the patch.\n> > > > > > >\n> > > > > > > I'm CC'ing Jacopo and Umang as they've both spent a large amount of\n> > > > time\n> > > > > > > solving issues related to frame durations.\n> > > > > >\n> > > > > > And now with Umang's correct address.\n> > > > >\n> > > > > Jacopo, Umang, any feedback on this ?\n> > > > >\n> > > >\n> > > > Let me recap a bit first.\n> > > >\n> > > > We currently adjust all durations > 33333333*101/100 to 33333333.\n> > > > The idea was to avoid reporting any frame duration < 10^9/30\n> > > > c7ae5a50c10de1e790855d66842192c766da4dd3\n> > > > to bring the HAL in par with what the Intel HAL does.\n> > > >\n> > > > Umang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\n> > > > situation to allow slightly faster durations to be reported, to please\n> > > > CTS which would have otherwise complained if the actual duration was\n> > > > smaller than the reported on.\n> > > >\n> > > > Hence, so far, we have been dealing with -faster- cameras than the\n> > > > fixed 10^9/30 limit.\n> > > >\n> > > > Umang: do you recall how did we pick the 1% positive tolerance ?\n> > > >\n> > > > The issue here is instead that some -slower- cameras might need to be\n> > > > adjusted and report a smaller frame duration than what they actually\n> > > > produce. We had a lengthy discussion in the past [1] about how to report\n> > > > correctly the durations of Nautilus which was reporting a duration of\n> > > > 29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\n> > > > not complaining. We ended up fixing the driver in\n> > > > \"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\n> > > > instead, if I'm not mistaken, resolutions that produce < 30 FPS are\n> > > > not reported as part of the preview streams list (so only resolutions\n> > > > up to 1080p are reported there).\n> > > >\n> > > > So I would like first to know what cameras and what resolutions\n> > > > is this patch trying to please.\n> > > >\n> > > > Also, reading again the thread in [1] I realized CTS allows a 1.5%\n> > > > tolerance\n> > > >\n> > > > \" Frame duration must be in the range of [33333333, 33333333], value\n> > > > 34387000 is out of range [32833332, 33833332])\"\n> > > >\n> > > > How was 2% picked here ?\n> > > >\n> > > > Sorry for making things difficult, but I'm always a bit concerned that\n> > > > moving a tiny thing here would make some CTS test failures creep in\n> > > > unnoticed.\n> > > >\n> > > > Thanks\n> > > >   j\n> > > >\n> > > > [1] [libcamera-internal] Question on camera stream durations\n> > > >\n> > >\n> > > For the front camera of soraka, thus OV5685, which reports frame duration\n> > > 33336000 for resolution larger than 720p.\n> > > When calculating FPS, we did a slight elevation it due to CTS in\n> > > f78f714b4486dbfd62bd62d7a479abc1d98d7495:\n> > >\n> > > // unsigned int fps = static_cast<unsigned int> (floor(1e9 /\n> > > entry.minFrameDurationNsec + 0.05f));\n> > >\n> > > It gets floor(29.997600192 + 0.5) = 30, and passes the bar.\n> > > However, we still report the minFrameDuration as 33336000.\n> > >\n> > > I checked with the chrome team about their logic:\n> > > Chrome would only try the frame rate listed in\n> > > ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n> > > which is elevated to 30 in the case, and filter out the stream with frame\n> > > duration with 33336000, since its calculated FPS would be 29.97. As a\n> > > result, chrome rejects resolution > 720p for the front camera.\n> >\n> > Is this something new ? I recall we had 1080p for preview on Soraka.\n> > Am I mistaken ?\n> >\n> > > On the other hand, the back camera reports 33389000 for the full size. The\n> > > 2% is from the value, which is about 1.6% from 33333333.\n> >\n> > Full sizes are in facts not reported as 30-FPS capable streams, if I\n> > recall correctly ?\n>\n> Another reason is due to the configuration file. The config tuned by\n> Intel always sets the sensor to full size.\n\nAlmost. In the revision I have here for ov13858 9 modes gets generated\nfrom smaller sensor resolutions. It only happens to small-ish modes\nthough [1]\n\n> Since we calculate the FrameDurationLimit by sensor size. The min\n> duration would always be 33389000.\n> I suppose this is why shipped soraka does not encounter the 1% faster\n> problem in CTS, since it's actually slower.\n> It's a little awkward, since 1e9 / 33389000 = 29.49983, slightly less\n> than the bar 29.5. =.=\n\nBe aware that the IPU pipeline handler tries to use a sensor\nresolution as close as possible to the maximum requested size\n\nsrc/libcamera/pipeline/ipu3/ipu3.cpp:\n\n\t/*\n\t * Generate raw configuration from CIO2.\n\t *\n\t * The output YUV streams will be limited in size to the maximum frame\n\t * size requested for the RAW stream, if present.\n\t *\n\t * If no raw stream is requested generate a size as large as the maximum\n\t * requested YUV size aligned to the ImgU constraints and bound by the\n\t * sensor's maximum resolution. See\n\t * https://bugs.libcamera.org/show_bug.cgi?id=32\n\t */\n\tif (rawSize.isNull())\n\t\trawSize = maxYuvSize.expandedTo({ ImgUDevice::kIFMaxCropWidth,\n\t\t\t\t\t\t  ImgUDevice::kIFMaxCropHeight })\n\t\t\t\t    .grownBy({ ImgUDevice::kOutputMarginWidth,\n\t\t\t\t\t       ImgUDevice::kOutputMarginHeight })\n\t\t\t\t    .boundedTo(data_->cio2_.sensor()->resolution());\n\nAnd looking at the ov13858 driver supported modes\n\nstatic const struct ov13858_mode supported_modes[] = {\n\t{\n\t\t.width = 4224,\n\t\t.height = 3136,\n\t\t.vts_def = OV13858_VTS_30FPS,\n\t\t.vts_min = OV13858_VTS_30FPS,\n\t\t.reg_list = {\n\t\t\t.num_of_regs = ARRAY_SIZE(mode_4224x3136_regs),\n\t\t\t.regs = mode_4224x3136_regs,\n\t\t},\n\t\t.link_freq_index = OV13858_LINK_FREQ_INDEX_0,\n\t},\n\t{\n\t\t.width = 2112,\n\t\t.height = 1568,\n\t\t.vts_def = OV13858_VTS_30FPS,\n\t\t.vts_min = 1608,\n\t\t.reg_list = {\n\t\t\t.num_of_regs = ARRAY_SIZE(mode_2112x1568_regs),\n\t\t\t.regs = mode_2112x1568_regs,\n\t\t},\n\t\t.link_freq_index = OV13858_LINK_FREQ_INDEX_1,\n\t},\n\t{\n\t\t.width = 2112,\n\t\t.height = 1188,\n\t\t.vts_def = OV13858_VTS_30FPS,\n\t\t.vts_min = 1608,\n\t\t.reg_list = {\n\t\t\t.num_of_regs = ARRAY_SIZE(mode_2112x1188_regs),\n\t\t\t.regs = mode_2112x1188_regs,\n\t\t},\n\t\t.link_freq_index = OV13858_LINK_FREQ_INDEX_1,\n\t},\n\t{\n\t\t.width = 1056,\n\t\t.height = 784,\n\t\t.vts_def = OV13858_VTS_30FPS,\n\t\t.vts_min = 804,\n\t\t.reg_list = {\n\t\t\t.num_of_regs = ARRAY_SIZE(mode_1056x784_regs),\n\t\t\t.regs = mode_1056x784_regs,\n\t\t},\n\t\t.link_freq_index = OV13858_LINK_FREQ_INDEX_1,\n\t}\n};\n\nWe might get to use full size only for full-resolution mode.\n(not verified, only by looking at the code)\n\nClarifying what sensor mode gets selected for what output mode, and\nwhat is the reported frame durations for each sensor mode, might help\nclarify what actually happens.\n\nLooking at numbers from \"Question on camera stream durations\" [2] ov13858\ncan do 60fps@1080p (which is likely produced by 2112x1568 sensor mode),\nand can do 29@full-res. Hence I'm missing why 1080p doesn't get registered\nas 30-FPS-capable in you case.\n\nFor the Soraka ov5670 front camera that instead can do 33336000 for\nall modes > 720p so far we got away with the 0.05 rounding, but as you\nsaid we miss adjusting the AE_AVAILABLE_TARGET_FPS_RANGE.\n\n> The only way I can think of is to change the FrameDurationLimit\n> calculation in close sourced IPA.\n\nAs a general consideration, this is an android specific requirement\nand I see it better placed in the HAL. However the closed source IPA\nserves only for Android so far...\n\nWhat I would do is:\n\n- Move the 0.05 adjustment to when minFrameDuration is calculated, so\n  that we keep AE_AVAILABLE_TARGET_FPS_RANGE and\n  ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT in sync.\n\n  The adjustment can be expressed as a percentage, and since CTS\n  accepts a 1.5% tolerance we could do the same (which means adjusting\n  to 30FPS streams that can only do 29.55 which seems -a lot- of\n  adjustment to me).\n\n- Clarify how 1080p gets generated on Soraka ov13858, from which sensor mode\n  and what durations are reported. From the calculations in [2] it\n  should be capable of 60 FPS (capped at 30), but you see CCA falling\n  back to 480p.\n\n  Apart from this, if sensor full resolution can do 29.94 I think a\n  tiny 0.2% adjustment is fine as we can register full resolution as\n  30-FPS capable if CTS doesn't complain. Be aware though that full\n  resolution modes for both the front and back camera are reported as\n  being 24FPS in the Intel camera HAL as per the discussion in [2]\n  (this is said to be because of the ImgU processing bandwidth\n  limitations iirc) so if we want to get in-par we should really only\n  care about 1080p being @30FPS.\n\nThanks\n   j\n\n>\n> >\n> > >\n> > > After a rethink, maybe I should elevate the min frame duration together\n> > > with where we elevate the FPS, instead of a 2% cap.\n> > > Or try to centralize all adjustments on FPS/frame duration to an earlier\n> > > stage.\n> > >\n\n[1]\n\n cat ./media-libs/cros-camera-hal-configs-poppy/files/gcss/graph_settings_ov13858.xml | grep -A3 \\<input | grep -v 4224  | grep \\<input -A3\n\n    <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n    <vf width=\"960\" height=\"1280\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n    <vf width=\"720\" height=\"1280\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n    <vf width=\"480\" height=\"640\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n    <vf width=\"480\" height=\"640\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"720\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"1056\" height=\"784\" format=\"CIO2\" />\n    <vf width=\"480\" height=\"640\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"480\" height=\"640\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n    <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n    <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"720\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"1056\" height=\"784\" format=\"CIO2\" />\n    <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"480\" height=\"640\" format=\"NV12\" peer=\"main\"/>\n\n--\n    <input width=\"1056\" height=\"784\" format=\"CIO2\" />\n    <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n    <main width=\"240\" height=\"320\" format=\"NV12\" peer=\"main\"/>\n\n[2]\n- ov5670\n (320x240)[16149000]@61\n (640x480)[16149000]@61\n (1280x720)[33336000]@30\n (1280x960)[33336000]@30\n (1920x1080)[33336000]@30\n (2560x1920)[33336000]@30\n\n- ov13858\n (320x240)[8352000]@119\n (640x480)[8352000]@119\n (1280x720)[16705000]@59\n (1920x1080)[16705000]@59\n (4160x3104)[33389000]@29\n\n- imx258\n (320x240)[17644000]@56\n (640x480)[17644000]@56\n (1280x720)[33282000]@30\n (1920x1080)[34100000]@29\n (4160x3104)[34100000]@29\n\nWhich can be summarized as:\n- ov5670 can do 30FPS at max res and 1080p\n- ov13858 can do 29.94 FPS at max res and 60 in 1080p\n- imx258 can do 29.3 FPS at max res and 1080p\n\n> >\n> > It would be indeed better to centralize all the adjustments, probably\n> > at CameraCapabilities::initializeStreamConfigurations() time.\n> >\n> > The way we handle minFrameDurations is\n> >\n> > CameraCapabilities::initializeStreamConfigurations() {\n> >         int64_t minFrameDuration = frameDurations->second.min().get<int64_t>() * 1000;\n> >         ..\n> >\n> >         int64_t minFrameDurationCap = 1e9 / 30.0;\n> >         if (minFrameDuration < minFrameDurationCap) {\n> >                 float tolerance =\n> >                         (minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> >\n> >                 /*\n> >                  * If the tolerance is less than 1%, do not cap\n> >                  * the frame duration.\n> >                  */\n> >                 if (tolerance > 1.0)\n> >                         minFrameDuration = minFrameDurationCap;\n> >         }\n> >\n> >         streamConfigurations_.push_back({\n> >                 res, androidFormat, minFrameDuration, maxFrameDuration,\n> > });\n> >\n> > So here we adjust faster cameras to report max 30 FPS +- 1%\n> > This was due to get in par with the Intel HAL, but might cause errors\n> > as some streams are -faster- than what we report here.\n> >\n> > When populating the ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT\n> > camera property, as you noticed, we add a 0.05 to the calculated FPS to\n> > accept as 30-fps-capable streams that can do > 29.95.\n> >\n> >         unsigned int fps = static_cast<unsigned int>\n> >                            (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n> >         if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n> >                 continue;\n> >\n> > And we use the adjusted FPS to later populate\n> > AE_AVAILABLE_TARGET_FPS_RANGE\n> >\n> >         /*\n> >          * Collect the FPS of the maximum YUV output size to populate\n> >          * AE_AVAILABLE_TARGET_FPS_RANGE\n> >          */\n> >         if (entry.androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888 &&\n> >             entry.resolution > maxYUVSize) {\n> >                 maxYUVSize = entry.resolution;\n> >                 maxYUVFps = fps;\n> >         }\n> >\n> >         int32_t availableAeFpsTarget[] = {\n> >                 minFps, maxYUVFps, maxYUVFps, maxYUVFps,\n> >         };\n> >\n> >         staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n> >                                   availableAeFpsTarget);\n> >\n> >\n> > Then we populate ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS with the\n> > entry.minFrameDurationNsec value, without adjusting it.\n> >\n> >         /* Per-stream durations. */\n> >         minFrameDurations.push_back(entry.androidFormat);\n> >         minFrameDurations.push_back(entry.resolution.width);\n> >         minFrameDurations.push_back(entry.resolution.height);\n> >         minFrameDurations.push_back(entry.minFrameDurationNsec);\n> >\n> >         staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n> >                                   minFrameDurations);\n> >\n> > So yes, we report a faster FPS in AE_AVAILABLE_TARGET_FPS_RANGE than the min\n> > frame duration reported in ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS.\n> >\n> > Now, a 2% tolerance seems a lot, but CTS has 1.5%, so it might be\n> > acceptable.\n> >\n> > I'm just afraid that if we adjust too much, then CTS will\n> > detect that we report a min duration that doesn't match the actual\n> > measured one and complains because a stream slower than expected is\n> > detected.\n> >\n> > Anyway, yes, we should adjust frame durations in a single place to\n> > avoid reporting inconsistent information in the camera capabilities.\n> > The question is how much to adjust ? :)\n> >\n> > }\n> > >\n> > > >\n> > > > > > > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > > > > > > It's notice that Chrome Camera App filters out the resolutions\n> > > > which cannot\n> > > > > > > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if\n> > > > FPS is lower\n> > > > > > > > within 2%.\n> > > > > > >\n> > > > > > > Unless I'm mistaken this patch doesn't depend on the rest of the\n> > > > series,\n> > > > > > > so we can review and merge it separately.\n> > > > > > >\n> > > > > > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > > > > > ---\n> > > > > > > >  src/android/camera_capabilities.cpp | 31\n> > > > +++++++++++++++++++----------\n> > > > > > > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > > > > > >\n> > > > > > > > diff --git a/src/android/camera_capabilities.cpp\n> > > > b/src/android/camera_capabilities.cpp\n> > > > > > > > index 55d651f3..e10ab036 100644\n> > > > > > > > --- a/src/android/camera_capabilities.cpp\n> > > > > > > > +++ b/src/android/camera_capabilities.cpp\n> > > > > > > > @@ -655,7 +655,9 @@ int\n> > > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > > >                         int64_t maxFrameDuration =\n> > > > frameDurations->second.max().get<int64_t>() * 1000;\n> > > > > > > >\n> > > > > > > >                         /*\n> > > > > > > > -                        * Cap min frame duration to 30 FPS with\n> > > > 1% tolerance.\n> > > > > > > > +                        * Cap min frame duration to 30 FPS with\n> > > > 1% tolerance,\n> > > > > > > > +                        * and elevate min frame duration to 30\n> > > > FPS with 2%\n> > > > > > > > +                        * tolerance.\n> > > > > > > >                          *\n> > > > > > > >                          * 30 frames per second has been validated\n> > > > as the most\n> > > > > > > >                          * opportune frame rate for quality\n> > > > tuning, and power\n> > > > > > > > @@ -675,17 +677,24 @@ int\n> > > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > > >                          * to the in-development configuration API\n> > > > rework.\n> > > > > > > >                          */\n> > > > > > > >                         int64_t minFrameDurationCap = 1e9 / 30.0;\n> > > > > > > > -                       if (minFrameDuration <\n> > > > minFrameDurationCap) {\n> > > > > > > > -                               float tolerance =\n> > > > > > > > -                                       (minFrameDurationCap -\n> > > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > > > +                       float tolerance =\n> > > > > > > > +                               (minFrameDurationCap -\n> > > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > > >\n> > > > > > > > -                               /*\n> > > > > > > > -                                * If the tolerance is less than\n> > > > 1%, do not cap\n> > > > > > > > -                                * the frame duration.\n> > > > > > > > -                                */\n> > > > > > > > -                               if (tolerance > 1.0)\n> > > > > > > > -                                       minFrameDuration =\n> > > > minFrameDurationCap;\n> > > > > > > > -                       }\n> > > > > > > > +                       /*\n> > > > > > > > +                        * If the tolerance is less than 1%, do\n> > > > not cap\n> > > > > > > > +                        * the frame duration.\n> > > > > > > > +                        */\n> > > > > > > > +                       if (tolerance > 1.0)\n> > > > > > > > +                               minFrameDuration =\n> > > > minFrameDurationCap;\n> > > > > > > > +\n> > > > > > > > +                       /*\n> > > > > > > > +                        * Some applications, ex: Chrome Camera\n> > > > App filters out\n> > > > > > > > +                        * the resolutions which cannot achieve 30\n> > > > FPS. Elevate\n> > > > > > > > +                        * the minimum frame duration to 30 FPS if\n> > > > FPS is lower\n> > > > > > > > +                        * within 2%.\n> > > > > > > > +                        */\n> > > > > > > > +                       if (tolerance < 0 && tolerance > -2.0)\n> > > > > > > > +                               minFrameDuration =\n> > > > minFrameDurationCap;\n> > > > > > > >\n> > > > > > > >                         streamConfigurations_.push_back({\n> > > > > > > >                                 res, androidFormat,\n> > > > minFrameDuration, maxFrameDuration,\n> > > > >\n> > > > > --\n> > > > > Regards,\n> > > > >\n> > > > > Laurent Pinchart\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 50A96C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Apr 2022 07:49:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7F32F65648;\n\tFri, 15 Apr 2022 09:49:58 +0200 (CEST)","from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 024BB60207\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 09:49:56 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id E9F3060004;\n\tFri, 15 Apr 2022 07:49:54 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650008998;\n\tbh=+uB31/cEW8+anoaHtDt8ht3hHlSGijaMRB4o42t7nEo=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=fhk960uwjWISKUY/KDbwCL4H7PybK9jHAJzM6te+7jRT/H5ij9FldNlS9iP2Krmbu\n\ttt+IPKiog0KWYgmjNMWyvPtU36ednPzDTzoKZv64R45x3PztH7Fd1vn+X788RG/ckN\n\tMSAHSkOG0vk7sOE1TieJ4HNsQjTjGuzm3fJs3z3YuiomZhq3kp7CB3VJXaOsvVXGlY\n\tSoHO3zjYU86cUM+bpbLF3sUPOKLl+ZRzuGl3EJq4lekv20L4j0zep8bPFLFVEm/kU9\n\tmN5sLN+AToBrCH/Mm0cpOUvyNkedCqXVxSArl23MtqKHEZZyJpsIGsYQHpF9UvLDmK\n\tgpSaNEI9V5nCA==","Date":"Fri, 15 Apr 2022 09:49:52 +0200","To":"Hanlin Chen <hanlinchen@chromium.org>","Message-ID":"<20220415074952.nihwrh72biehfcrs@uno.localdomain>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>\n\t<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>\n\t<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>\n\t<20220414202917.tyiqarac2scxvzrt@uno.localdomain>\n\t<CAJAuwMk5sCNngNXFdisBDHe5WyK8oaMCBBBjxyWvqgseGj-4UQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAJAuwMk5sCNngNXFdisBDHe5WyK8oaMCBBBjxyWvqgseGj-4UQ@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22725,"web_url":"https://patchwork.libcamera.org/comment/22725/","msgid":"<CAJAuwM==43gy-J2ZK8Rm3CczT=WJrTHMwdedrs4OxwoWLQ2H1g@mail.gmail.com>","date":"2022-04-15T15:29:21","subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","submitter":{"id":98,"url":"https://patchwork.libcamera.org/api/people/98/","name":"Hanlin Chen","email":"hanlinchen@chromium.org"},"content":"Hi Jacopo,\nThanks for the detailed reply.\n\nOn Fri, Apr 15, 2022 at 3:49 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Han-Lin,\n>\n> On Fri, Apr 15, 2022 at 12:51:45PM +0800, Hanlin Chen wrote:\n> > Hi Jacopo,\n> > Sorry for the separate email.\n> >\n> > On Fri, Apr 15, 2022 at 4:29 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> > >\n> > > Hi Han-Lin,\n> > >\n> > > On Thu, Apr 14, 2022 at 08:34:56PM +0800, Hanlin Chen wrote:\n> > > > Hi Jacopo,\n> > > > Sorry for the late reply.\n> > > >\n> > > > On Wed, Apr 6, 2022 at 3:09 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> > > >\n> > > > > Hello,\n> > > > >    sorry for being late\n> > > > >\n> > > > > On Wed, Apr 06, 2022 at 04:38:53AM +0300, Laurent Pinchart wrote:\n> > > > > > On Wed, Feb 16, 2022 at 03:01:13AM +0200, Laurent Pinchart wrote:\n> > > > > > > On Wed, Feb 16, 2022 at 03:00:43AM +0200, Laurent Pinchart wrote:\n> > > > > > > > Hi Han-Lin,\n> > > > > > > >\n> > > > > > > > Thank you for the patch.\n> > > > > > > >\n> > > > > > > > I'm CC'ing Jacopo and Umang as they've both spent a large amount of\n> > > > > time\n> > > > > > > > solving issues related to frame durations.\n> > > > > > >\n> > > > > > > And now with Umang's correct address.\n> > > > > >\n> > > > > > Jacopo, Umang, any feedback on this ?\n> > > > > >\n> > > > >\n> > > > > Let me recap a bit first.\n> > > > >\n> > > > > We currently adjust all durations > 33333333*101/100 to 33333333.\n> > > > > The idea was to avoid reporting any frame duration < 10^9/30\n> > > > > c7ae5a50c10de1e790855d66842192c766da4dd3\n> > > > > to bring the HAL in par with what the Intel HAL does.\n> > > > >\n> > > > > Umang's 37c41aa6a69985f99f9540dc89d094df61770fdc adjusted the\n> > > > > situation to allow slightly faster durations to be reported, to please\n> > > > > CTS which would have otherwise complained if the actual duration was\n> > > > > smaller than the reported on.\n> > > > >\n> > > > > Hence, so far, we have been dealing with -faster- cameras than the\n> > > > > fixed 10^9/30 limit.\n> > > > >\n> > > > > Umang: do you recall how did we pick the 1% positive tolerance ?\n> > > > >\n> > > > > The issue here is instead that some -slower- cameras might need to be\n> > > > > adjusted and report a smaller frame duration than what they actually\n> > > > > produce. We had a lengthy discussion in the past [1] about how to report\n> > > > > correctly the durations of Nautilus which was reporting a duration of\n> > > > > 29.3 msec while the Intel HAL happily hard-coded 33.333 and CST was\n> > > > > not complaining. We ended up fixing the driver in\n> > > > > \"[libcamera-devel] [PATCH 0/2] IMX258 driver fixes\". For Soraka\n> > > > > instead, if I'm not mistaken, resolutions that produce < 30 FPS are\n> > > > > not reported as part of the preview streams list (so only resolutions\n> > > > > up to 1080p are reported there).\n> > > > >\n> > > > > So I would like first to know what cameras and what resolutions\n> > > > > is this patch trying to please.\n> > > > >\n> > > > > Also, reading again the thread in [1] I realized CTS allows a 1.5%\n> > > > > tolerance\n> > > > >\n> > > > > \" Frame duration must be in the range of [33333333, 33333333], value\n> > > > > 34387000 is out of range [32833332, 33833332])\"\n> > > > >\n> > > > > How was 2% picked here ?\n> > > > >\n> > > > > Sorry for making things difficult, but I'm always a bit concerned that\n> > > > > moving a tiny thing here would make some CTS test failures creep in\n> > > > > unnoticed.\n> > > > >\n> > > > > Thanks\n> > > > >   j\n> > > > >\n> > > > > [1] [libcamera-internal] Question on camera stream durations\n> > > > >\n> > > >\n> > > > For the front camera of soraka, thus OV5685, which reports frame duration\n> > > > 33336000 for resolution larger than 720p.\n> > > > When calculating FPS, we did a slight elevation it due to CTS in\n> > > > f78f714b4486dbfd62bd62d7a479abc1d98d7495:\n> > > >\n> > > > // unsigned int fps = static_cast<unsigned int> (floor(1e9 /\n> > > > entry.minFrameDurationNsec + 0.05f));\n> > > >\n> > > > It gets floor(29.997600192 + 0.5) = 30, and passes the bar.\n> > > > However, we still report the minFrameDuration as 33336000.\n> > > >\n> > > > I checked with the chrome team about their logic:\n> > > > Chrome would only try the frame rate listed in\n> > > > ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n> > > > which is elevated to 30 in the case, and filter out the stream with frame\n> > > > duration with 33336000, since its calculated FPS would be 29.97. As a\n> > > > result, chrome rejects resolution > 720p for the front camera.\n> > >\n> > > Is this something new ? I recall we had 1080p for preview on Soraka.\n> > > Am I mistaken ?\n> > >\n> > > > On the other hand, the back camera reports 33389000 for the full size. The\n> > > > 2% is from the value, which is about 1.6% from 33333333.\n> > >\n> > > Full sizes are in facts not reported as 30-FPS capable streams, if I\n> > > recall correctly ?\n> >\n> > Another reason is due to the configuration file. The config tuned by\n> > Intel always sets the sensor to full size.\n>\n> Almost. In the revision I have here for ov13858 9 modes gets generated\n> from smaller sensor resolutions. It only happens to small-ish modes\n> though [1]\n>\n> > Since we calculate the FrameDurationLimit by sensor size. The min\n> > duration would always be 33389000.\n> > I suppose this is why shipped soraka does not encounter the 1% faster\n> > problem in CTS, since it's actually slower.\n> > It's a little awkward, since 1e9 / 33389000 = 29.49983, slightly less\n> > than the bar 29.5. =.=\n>\n> Be aware that the IPU pipeline handler tries to use a sensor\n> resolution as close as possible to the maximum requested size\n>\n> src/libcamera/pipeline/ipu3/ipu3.cpp:\n>\n>         /*\n>          * Generate raw configuration from CIO2.\n>          *\n>          * The output YUV streams will be limited in size to the maximum frame\n>          * size requested for the RAW stream, if present.\n>          *\n>          * If no raw stream is requested generate a size as large as the maximum\n>          * requested YUV size aligned to the ImgU constraints and bound by the\n>          * sensor's maximum resolution. See\n>          * https://bugs.libcamera.org/show_bug.cgi?id=32\n>          */\n>         if (rawSize.isNull())\n>                 rawSize = maxYuvSize.expandedTo({ ImgUDevice::kIFMaxCropWidth,\n>                                                   ImgUDevice::kIFMaxCropHeight })\n>                                     .grownBy({ ImgUDevice::kOutputMarginWidth,\n>                                                ImgUDevice::kOutputMarginHeight })\n>                                     .boundedTo(data_->cio2_.sensor()->resolution());\n>\n> And looking at the ov13858 driver supported modes\n>\n> static const struct ov13858_mode supported_modes[] = {\n>         {\n>                 .width = 4224,\n>                 .height = 3136,\n>                 .vts_def = OV13858_VTS_30FPS,\n>                 .vts_min = OV13858_VTS_30FPS,\n>                 .reg_list = {\n>                         .num_of_regs = ARRAY_SIZE(mode_4224x3136_regs),\n>                         .regs = mode_4224x3136_regs,\n>                 },\n>                 .link_freq_index = OV13858_LINK_FREQ_INDEX_0,\n>         },\n>         {\n>                 .width = 2112,\n>                 .height = 1568,\n>                 .vts_def = OV13858_VTS_30FPS,\n>                 .vts_min = 1608,\n>                 .reg_list = {\n>                         .num_of_regs = ARRAY_SIZE(mode_2112x1568_regs),\n>                         .regs = mode_2112x1568_regs,\n>                 },\n>                 .link_freq_index = OV13858_LINK_FREQ_INDEX_1,\n>         },\n>         {\n>                 .width = 2112,\n>                 .height = 1188,\n>                 .vts_def = OV13858_VTS_30FPS,\n>                 .vts_min = 1608,\n>                 .reg_list = {\n>                         .num_of_regs = ARRAY_SIZE(mode_2112x1188_regs),\n>                         .regs = mode_2112x1188_regs,\n>                 },\n>                 .link_freq_index = OV13858_LINK_FREQ_INDEX_1,\n>         },\n>         {\n>                 .width = 1056,\n>                 .height = 784,\n>                 .vts_def = OV13858_VTS_30FPS,\n>                 .vts_min = 804,\n>                 .reg_list = {\n>                         .num_of_regs = ARRAY_SIZE(mode_1056x784_regs),\n>                         .regs = mode_1056x784_regs,\n>                 },\n>                 .link_freq_index = OV13858_LINK_FREQ_INDEX_1,\n>         }\n> };\n>\n> We might get to use full size only for full-resolution mode.\n> (not verified, only by looking at the code)\n>\n> Clarifying what sensor mode gets selected for what output mode, and\n> what is the reported frame durations for each sensor mode, might help\n> clarify what actually happens.\n>\n> Looking at numbers from \"Question on camera stream durations\" [2] ov13858\n> can do 60fps@1080p (which is likely produced by 2112x1568 sensor mode),\n> and can do 29@full-res. Hence I'm missing why 1080p doesn't get registered\n> as 30-FPS-capable in you case.\n>\n> For the Soraka ov5670 front camera that instead can do 33336000 for\n> all modes > 720p so far we got away with the 0.05 rounding, but as you\n> said we miss adjusting the AE_AVAILABLE_TARGET_FPS_RANGE.\n>\n> > The only way I can think of is to change the FrameDurationLimit\n> > calculation in close sourced IPA.\n>\n> As a general consideration, this is an android specific requirement\n> and I see it better placed in the HAL. However the closed source IPA\n> serves only for Android so far...\n>\n> What I would do is:\n>\n> - Move the 0.05 adjustment to when minFrameDuration is calculated, so\n>   that we keep AE_AVAILABLE_TARGET_FPS_RANGE and\n>   ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT in sync.\n>\n>   The adjustment can be expressed as a percentage, and since CTS\n>   accepts a 1.5% tolerance we could do the same (which means adjusting\n>   to 30FPS streams that can only do 29.55 which seems -a lot- of\n>   adjustment to me).\n>\n> - Clarify how 1080p gets generated on Soraka ov13858, from which sensor mode\n>   and what durations are reported. From the calculations in [2] it\n>   should be capable of 60 FPS (capped at 30), but you see CCA falling\n>   back to 480p.\n>\n>   Apart from this, if sensor full resolution can do 29.94 I think a\n>   tiny 0.2% adjustment is fine as we can register full resolution as\n>   30-FPS capable if CTS doesn't complain. Be aware though that full\n>   resolution modes for both the front and back camera are reported as\n>   being 24FPS in the Intel camera HAL as per the discussion in [2]\n>   (this is said to be because of the ImgU processing bandwidth\n>   limitations iirc) so if we want to get in-par we should really only\n>   care about 1080p being @30FPS.\n\nI think there was a mix of two scenarios and I created some confusion\nhere. I'm sorry about that.\n\nThere are two scenarios:\nCase [A] Without configuration:\n1. 1080p for ov13858 works as you mentioned.\n2. Front camera needs adjustment for its min frame duration: 33336000\nwhen resolution > 720p\nThis follows the calculation in [2]. The tolerance is less than 1%. All is good.\n\nCase [B] With the configuration file:\nAs in [1], although it lists resolutions with half and smaller raw\nframes, the use case is only for width < height.\nYou can see the similar lines: <main width=\"960\" height=\"1280\"\nformat=\"NV12\" peer=\"main\"/>\nIn Intel HAL, those cases are not used. In fact, they shouldn't exist\nfrom the beginning. It's bad.\nIf we filter out the case where width < height. You can see all\nconfigurations are using full size raw frames.\n\nIn result, it only left us the case.\n(4160x3104)[33389000]@29 for all resolutions, i.e., even if the user\nonly requests 1080p.\n333389000 is awkward, since its tolerance is 1.67%. This is where 2%\ncomes from. And it's why the patch is sent with the configuration file\nseries.\nAll of these are bad.\n\nI think we agree that we should adjust the min frame duration for case [A].\nFor [B], it's more tricky, because it's not that the sensor is not\ncapable. It's more like a problem caused by the pipeline configuration\nfile.\nIt makes me think [B] should be fixed by overriding the frame duration\nby the pipeline configuration file.\nIf so, we tolerate 1% for the general solution and leave the quirk to\nthe pipeline configuration file.\n\nWould it be better?\n\n>\n> Thanks\n>    j\n>\n> >\n> > >\n> > > >\n> > > > After a rethink, maybe I should elevate the min frame duration together\n> > > > with where we elevate the FPS, instead of a 2% cap.\n> > > > Or try to centralize all adjustments on FPS/frame duration to an earlier\n> > > > stage.\n> > > >\n>\n> [1]\n>\n>  cat ./media-libs/cros-camera-hal-configs-poppy/files/gcss/graph_settings_ov13858.xml | grep -A3 \\<input | grep -v 4224  | grep \\<input -A3\n>\n>     <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n>     <vf width=\"960\" height=\"1280\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n>     <vf width=\"720\" height=\"1280\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n>     <vf width=\"480\" height=\"640\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n>     <vf width=\"480\" height=\"640\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"720\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"1056\" height=\"784\" format=\"CIO2\" />\n>     <vf width=\"480\" height=\"640\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"480\" height=\"640\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n>     <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"960\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"2112\" height=\"1568\" format=\"CIO2\" />\n>     <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"720\" height=\"1280\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"1056\" height=\"784\" format=\"CIO2\" />\n>     <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"480\" height=\"640\" format=\"NV12\" peer=\"main\"/>\n>\n> --\n>     <input width=\"1056\" height=\"784\" format=\"CIO2\" />\n>     <vf width=\"240\" height=\"320\" format=\"NV12\" peer=\"vf\"/>\n>     <main width=\"240\" height=\"320\" format=\"NV12\" peer=\"main\"/>\n>\n> [2]\n> - ov5670\n>  (320x240)[16149000]@61\n>  (640x480)[16149000]@61\n>  (1280x720)[33336000]@30\n>  (1280x960)[33336000]@30\n>  (1920x1080)[33336000]@30\n>  (2560x1920)[33336000]@30\n>\n> - ov13858\n>  (320x240)[8352000]@119\n>  (640x480)[8352000]@119\n>  (1280x720)[16705000]@59\n>  (1920x1080)[16705000]@59\n>  (4160x3104)[33389000]@29\n>\n> - imx258\n>  (320x240)[17644000]@56\n>  (640x480)[17644000]@56\n>  (1280x720)[33282000]@30\n>  (1920x1080)[34100000]@29\n>  (4160x3104)[34100000]@29\n>\n> Which can be summarized as:\n> - ov5670 can do 30FPS at max res and 1080p\n> - ov13858 can do 29.94 FPS at max res and 60 in 1080p\n> - imx258 can do 29.3 FPS at max res and 1080p\n>\n> > >\n> > > It would be indeed better to centralize all the adjustments, probably\n> > > at CameraCapabilities::initializeStreamConfigurations() time.\n> > >\n> > > The way we handle minFrameDurations is\n> > >\n> > > CameraCapabilities::initializeStreamConfigurations() {\n> > >         int64_t minFrameDuration = frameDurations->second.min().get<int64_t>() * 1000;\n> > >         ..\n> > >\n> > >         int64_t minFrameDurationCap = 1e9 / 30.0;\n> > >         if (minFrameDuration < minFrameDurationCap) {\n> > >                 float tolerance =\n> > >                         (minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n> > >\n> > >                 /*\n> > >                  * If the tolerance is less than 1%, do not cap\n> > >                  * the frame duration.\n> > >                  */\n> > >                 if (tolerance > 1.0)\n> > >                         minFrameDuration = minFrameDurationCap;\n> > >         }\n> > >\n> > >         streamConfigurations_.push_back({\n> > >                 res, androidFormat, minFrameDuration, maxFrameDuration,\n> > > });\n> > >\n> > > So here we adjust faster cameras to report max 30 FPS +- 1%\n> > > This was due to get in par with the Intel HAL, but might cause errors\n> > > as some streams are -faster- than what we report here.\n> > >\n> > > When populating the ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT\n> > > camera property, as you noticed, we add a 0.05 to the calculated FPS to\n> > > accept as 30-fps-capable streams that can do > 29.95.\n> > >\n> > >         unsigned int fps = static_cast<unsigned int>\n> > >                            (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n> > >         if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n> > >                 continue;\n> > >\n> > > And we use the adjusted FPS to later populate\n> > > AE_AVAILABLE_TARGET_FPS_RANGE\n> > >\n> > >         /*\n> > >          * Collect the FPS of the maximum YUV output size to populate\n> > >          * AE_AVAILABLE_TARGET_FPS_RANGE\n> > >          */\n> > >         if (entry.androidFormat == HAL_PIXEL_FORMAT_YCbCr_420_888 &&\n> > >             entry.resolution > maxYUVSize) {\n> > >                 maxYUVSize = entry.resolution;\n> > >                 maxYUVFps = fps;\n> > >         }\n> > >\n> > >         int32_t availableAeFpsTarget[] = {\n> > >                 minFps, maxYUVFps, maxYUVFps, maxYUVFps,\n> > >         };\n> > >\n> > >         staticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n> > >                                   availableAeFpsTarget);\n> > >\n> > >\n> > > Then we populate ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS with the\n> > > entry.minFrameDurationNsec value, without adjusting it.\n> > >\n> > >         /* Per-stream durations. */\n> > >         minFrameDurations.push_back(entry.androidFormat);\n> > >         minFrameDurations.push_back(entry.resolution.width);\n> > >         minFrameDurations.push_back(entry.resolution.height);\n> > >         minFrameDurations.push_back(entry.minFrameDurationNsec);\n> > >\n> > >         staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n> > >                                   minFrameDurations);\n> > >\n> > > So yes, we report a faster FPS in AE_AVAILABLE_TARGET_FPS_RANGE than the min\n> > > frame duration reported in ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS.\n> > >\n> > > Now, a 2% tolerance seems a lot, but CTS has 1.5%, so it might be\n> > > acceptable.\n> > >\n> > > I'm just afraid that if we adjust too much, then CTS will\n> > > detect that we report a min duration that doesn't match the actual\n> > > measured one and complains because a stream slower than expected is\n> > > detected.\n> > >\n> > > Anyway, yes, we should adjust frame durations in a single place to\n> > > avoid reporting inconsistent information in the camera capabilities.\n> > > The question is how much to adjust ? :)\n> > >\n> > > }\n> > > >\n> > > > >\n> > > > > > > > On Wed, Feb 09, 2022 at 03:19:17PM +0800, Han-Lin Chen wrote:\n> > > > > > > > > It's notice that Chrome Camera App filters out the resolutions\n> > > > > which cannot\n> > > > > > > > > achieve 30 FPS. Elevate the minimum frame duration to 30 FPS if\n> > > > > FPS is lower\n> > > > > > > > > within 2%.\n> > > > > > > >\n> > > > > > > > Unless I'm mistaken this patch doesn't depend on the rest of the\n> > > > > series,\n> > > > > > > > so we can review and merge it separately.\n> > > > > > > >\n> > > > > > > > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > > > > > > > > ---\n> > > > > > > > >  src/android/camera_capabilities.cpp | 31\n> > > > > +++++++++++++++++++----------\n> > > > > > > > >  1 file changed, 20 insertions(+), 11 deletions(-)\n> > > > > > > > >\n> > > > > > > > > diff --git a/src/android/camera_capabilities.cpp\n> > > > > b/src/android/camera_capabilities.cpp\n> > > > > > > > > index 55d651f3..e10ab036 100644\n> > > > > > > > > --- a/src/android/camera_capabilities.cpp\n> > > > > > > > > +++ b/src/android/camera_capabilities.cpp\n> > > > > > > > > @@ -655,7 +655,9 @@ int\n> > > > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > > > >                         int64_t maxFrameDuration =\n> > > > > frameDurations->second.max().get<int64_t>() * 1000;\n> > > > > > > > >\n> > > > > > > > >                         /*\n> > > > > > > > > -                        * Cap min frame duration to 30 FPS with\n> > > > > 1% tolerance.\n> > > > > > > > > +                        * Cap min frame duration to 30 FPS with\n> > > > > 1% tolerance,\n> > > > > > > > > +                        * and elevate min frame duration to 30\n> > > > > FPS with 2%\n> > > > > > > > > +                        * tolerance.\n> > > > > > > > >                          *\n> > > > > > > > >                          * 30 frames per second has been validated\n> > > > > as the most\n> > > > > > > > >                          * opportune frame rate for quality\n> > > > > tuning, and power\n> > > > > > > > > @@ -675,17 +677,24 @@ int\n> > > > > CameraCapabilities::initializeStreamConfigurations()\n> > > > > > > > >                          * to the in-development configuration API\n> > > > > rework.\n> > > > > > > > >                          */\n> > > > > > > > >                         int64_t minFrameDurationCap = 1e9 / 30.0;\n> > > > > > > > > -                       if (minFrameDuration <\n> > > > > minFrameDurationCap) {\n> > > > > > > > > -                               float tolerance =\n> > > > > > > > > -                                       (minFrameDurationCap -\n> > > > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > > > > +                       float tolerance =\n> > > > > > > > > +                               (minFrameDurationCap -\n> > > > > minFrameDuration) * 100.0 / minFrameDurationCap;\n> > > > > > > > >\n> > > > > > > > > -                               /*\n> > > > > > > > > -                                * If the tolerance is less than\n> > > > > 1%, do not cap\n> > > > > > > > > -                                * the frame duration.\n> > > > > > > > > -                                */\n> > > > > > > > > -                               if (tolerance > 1.0)\n> > > > > > > > > -                                       minFrameDuration =\n> > > > > minFrameDurationCap;\n> > > > > > > > > -                       }\n> > > > > > > > > +                       /*\n> > > > > > > > > +                        * If the tolerance is less than 1%, do\n> > > > > not cap\n> > > > > > > > > +                        * the frame duration.\n> > > > > > > > > +                        */\n> > > > > > > > > +                       if (tolerance > 1.0)\n> > > > > > > > > +                               minFrameDuration =\n> > > > > minFrameDurationCap;\n> > > > > > > > > +\n> > > > > > > > > +                       /*\n> > > > > > > > > +                        * Some applications, ex: Chrome Camera\n> > > > > App filters out\n> > > > > > > > > +                        * the resolutions which cannot achieve 30\n> > > > > FPS. Elevate\n> > > > > > > > > +                        * the minimum frame duration to 30 FPS if\n> > > > > FPS is lower\n> > > > > > > > > +                        * within 2%.\n> > > > > > > > > +                        */\n> > > > > > > > > +                       if (tolerance < 0 && tolerance > -2.0)\n> > > > > > > > > +                               minFrameDuration =\n> > > > > minFrameDurationCap;\n> > > > > > > > >\n> > > > > > > > >                         streamConfigurations_.push_back({\n> > > > > > > > >                                 res, androidFormat,\n> > > > > minFrameDuration, maxFrameDuration,\n> > > > > >\n> > > > > > --\n> > > > > > Regards,\n> > > > > >\n> > > > > > Laurent Pinchart\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 77DB8C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Apr 2022 15:29:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C8A9F65641;\n\tFri, 15 Apr 2022 17:29:34 +0200 (CEST)","from mail-oa1-x34.google.com (mail-oa1-x34.google.com\n\t[IPv6:2001:4860:4864:20::34])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E4CE60207\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 17:29:33 +0200 (CEST)","by mail-oa1-x34.google.com with SMTP id\n\t586e51a60fabf-e2a00f2cc8so8365426fac.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Apr 2022 08:29:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650036574;\n\tbh=bqK2GYos0JfeOfIr590mqhVbSBO38G7BpE1DUmAlsKk=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=wjNgY71RZMgXoyyClYWs92S7hURgaPbmISainkniPWWR3js0k4rXfOPzG7ktQDR+g\n\taIKFSkI0IZXnbCk6zhxw+t4HCGSSYiY+gt4VLqBIVtcUeAetBeio9gjUQHu35nVx7V\n\tc8wdAOFaAbUCfScZdvhh4EeATVE9PV1jkcU4lLItpV/rJfFZ9/4C3n43tAuKjWKUxi\n\tk80RDQgpM2bfkjhnDIYTaSZERhLq24R6fRpP0o8qjK3z9ABNLELUO0ZW3elqZAqriw\n\t6oRcIkZ5g3qLo1UR1rPuxMZ/pk7kzECrY9uw32UHHhUcHQdItDBOGoXHHCK7vg9/01\n\tBG6iSJ81SXkog==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=DfL0PxifWGrJRzR9b6362WRZwhfKV2DgINPMvr74hNE=;\n\tb=J19iwrqvF6HiIFLRzMmVuiBQjgPbJZncNt/NqIKCbEFofOMXM2LrRxcpKYkMZaG/gx\n\trizdzLpGIANJLNeVIQxQPC0tm5N2p0Rkj1CyjEIDYYl538NKIZbkWANBHID1gWC1UgV2\n\tcrlfoJAKIJygOAe0A4epBYVOS53cuEzDeTmDM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"J19iwrqv\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=DfL0PxifWGrJRzR9b6362WRZwhfKV2DgINPMvr74hNE=;\n\tb=SVH26EgLPUCFn6LZXIchgHXPSugDg8tf5P88Jthc2MzHe4j/sEKoxrRe9Np0NycQnn\n\tl1R0YkrJ5dkbXDZolYIkwD4Y/xcKmJ05xwZQPZDvkrn0YCJzTq6E3mJagf6RnlzA1azn\n\tbX/24HK4YwyNzyXz5Q1tN6NWn5g2sSbLThCUKtWXg3JfozwFojrrPDOTE/Z1XlxFvaNS\n\tUpMxWi/Rc9phZyecMyfuMfl+AvWP6jm+d7JeMOdj9V4im0HuEUc8ByQp6kkQHd0PCP/w\n\t9qoUc00TrciLI+kQ0pPu8jJ55TL5xNPFKdg6Kz7chvBhIMZgI289+sQFx4YyhjX8DVOM\n\tFtCg==","X-Gm-Message-State":"AOAM532yxGK/JG/NAnw4dZLFFwI9xeEyo2TyPpNFxxmltji0aKBOohFT\n\th/WGqLXseJrPy90L14mHFzq1Zm1jbCabAt7VoQJZIl3k0NCaGQ==","X-Google-Smtp-Source":"ABdhPJwtaRlAfAz4UPYDI4YKjlku/X9o6V+gkcPYgBScUbWOm5Ag05/8UvbBKJT0OSQBvKwu3D4pGKRZsii1DDGVgP8=","X-Received":"by 2002:a05:6870:328b:b0:e2:6f09:87f0 with SMTP id\n\tq11-20020a056870328b00b000e26f0987f0mr1650071oac.62.1650036571910;\n\tFri, 15 Apr 2022 08:29:31 -0700 (PDT)","MIME-Version":"1.0","References":"<20220209071917.559993-1-hanlinchen@chromium.org>\n\t<20220209071917.559993-10-hanlinchen@chromium.org>\n\t<YgxMuseqssph20mR@pendragon.ideasonboard.com>\n\t<YgxM2NhKhmJDYW+4@pendragon.ideasonboard.com>\n\t<YkzvLehc2HYQfhuN@pendragon.ideasonboard.com>\n\t<20220406070946.4q4wipxqloqa5lgg@uno.localdomain>\n\t<CAJAuwMmPCRgx-Cvt1Xwo6c1RNLBMrbBQBbUkH7p-ikOqVaH7Ag@mail.gmail.com>\n\t<20220414202917.tyiqarac2scxvzrt@uno.localdomain>\n\t<CAJAuwMk5sCNngNXFdisBDHe5WyK8oaMCBBBjxyWvqgseGj-4UQ@mail.gmail.com>\n\t<20220415074952.nihwrh72biehfcrs@uno.localdomain>","In-Reply-To":"<20220415074952.nihwrh72biehfcrs@uno.localdomain>","Date":"Fri, 15 Apr 2022 23:29:21 +0800","Message-ID":"<CAJAuwM==43gy-J2ZK8Rm3CczT=WJrTHMwdedrs4OxwoWLQ2H1g@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 9/9] android: Elevate min duration to\n\t30 FPS if it's lower within 2%","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>","From":"Hanlin Chen via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Hanlin Chen <hanlinchen@chromium.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]