[{"id":21556,"web_url":"https://patchwork.libcamera.org/comment/21556/","msgid":"<20211202173123.74b4zejav72fzxz4@uno.localdomain>","date":"2021-12-02T17:31:23","subject":"Re: [libcamera-devel] [RFC PATCH v2] android: Do not cap those\n\tminFrameDuration nearabout 30fps","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Umang\n\nOn Thu, Dec 02, 2021 at 07:16:44PM +0530, Umang Jain wrote:\n> We have some stream resolution which can provide slightly better\n> frame duration than what we cap (i.e. 1/30 fps). The problem with\n> this is CTS complains if the camera goes faster during the test\n> than minFrameDuration reported for that stream. For instance,\n>\n> 1080p minFrameDuration:\n> \t- Nautilus : 33282000\n> \t- Soraka   : 33147000\n>\n> Both are less than capped minFrameDuration (3333333).\n>\n> This patch considers this situation and doesn't cap the\n> minFrameDuration if the hardware can provide frame durations slightly\n> better. The delta considered is 1% only from the cap.\n\nWe're piling hack over hack, but all of this will go away with a\nproper configuration API that allows to set a frame duration per\nconfiguration session, so this is good if it fixes tests..\n\n>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>\n> On LIMITED level - no regressions were found : 230/231 pass rate\n> (retested locally from RFC v1)\n>\n> On FULL level - this fixes the test:\n> android.hardware.camera2.cts.SurfaceViewPreviewTest#testPreviewFpsRange\n> ---\n>  src/android/camera_capabilities.cpp | 13 +++++++++++--\n>  1 file changed, 11 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index f357902e..66ff1274 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -667,8 +667,17 @@ int CameraCapabilities::initializeStreamConfigurations()\n>  \t\t\t * control to be specified for each Request. Defer this\n>  \t\t\t * to the in-development configuration API rework.\n>  \t\t\t */\n\nDo you think the comment should report we have a 1% tollerance ?\n\n> -\t\t\tif (minFrameDuration < 1e9 / 30.0)\n> -\t\t\t\tminFrameDuration = 1e9 / 30.0;\n> +\t\t\tint64_t capMinFrameDuration = 1e9 / 30.0;\n> +\t\t\tif (minFrameDuration < capMinFrameDuration) {\n> +\t\t\t\tfloat delta = (capMinFrameDuration - minFrameDuration) * 100 / capMinFrameDuration;\n> +\n> +\t\t\t\t/*\n> +\t\t\t\t * If the delta is less than 1%, do not cap the\n> +\t\t\t\t * frame duration.\n> +\t\t\t\t */\n> +\t\t\t\tif (delta > 1)\n> +\t\t\t\t\tminFrameDuration = capMinFrameDuration;\n> +\t\t\t}\n>\n>  \t\t\tstreamConfigurations_.push_back({\n>  \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,\n> --\n> 2.31.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4511EBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Dec 2021 17:30:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B2276082A;\n\tThu,  2 Dec 2021 18:30:33 +0100 (CET)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D22A46011A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Dec 2021 18:30:31 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 4D8031BF20E;\n\tThu,  2 Dec 2021 17:30:30 +0000 (UTC)"],"Date":"Thu, 2 Dec 2021 18:31:23 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<20211202173123.74b4zejav72fzxz4@uno.localdomain>","References":"<20211202134644.1094233-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211202134644.1094233-1-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [RFC PATCH v2] android: Do not cap those\n\tminFrameDuration nearabout 30fps","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>"}}]