[{"id":21547,"web_url":"https://patchwork.libcamera.org/comment/21547/","msgid":"<4a5eba93-bd41-c68a-b4ef-876ff7250d74@ideasonboard.com>","date":"2021-12-02T13:32:32","subject":"Re: [libcamera-devel] [RFC PATCH] android: Do not cap those\n\tminFrameDuration nearabout 30fps","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"On 12/2/21 6:51 PM, 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>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n> On LIMITED level - no regressions were found : 230/231 pass rate\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 3e566755..6421456a 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -810,8 +810,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> -\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 > 0.01)\noops. this should be 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,","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 A1B2CBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Dec 2021 13:32:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CFEAB6082A;\n\tThu,  2 Dec 2021 14:32:39 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 047936011A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Dec 2021 14:32:38 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.170])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E2BF3D8C;\n\tThu,  2 Dec 2021 14:32:37 +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=\"PuvqVU7i\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638451958;\n\tbh=rYpeLAJG/bcw3Fg/6t9eiZocMnNoK3jN0cf2ww72DfE=;\n\th=Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=PuvqVU7i9SP7xEjWRnZSrkK/z0HPdmbdqSEFJACFyijcraI+SgMLcI+gB5ghsf9Xt\n\tZmBMqfH93wtYe7Ph+JAzIwb3fHXi673ev/CU4qPDbXrYtzJ5IjTk/fdO5B0RMvY1RP\n\tNIBvQhvGTHnYLgN0xO65O9205tTGrvITXLqETqf8=","To":"libcamera-devel@lists.libcamera.org","References":"<20211202132110.1067409-1-umang.jain@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<4a5eba93-bd41-c68a-b4ef-876ff7250d74@ideasonboard.com>","Date":"Thu, 2 Dec 2021 19:02:32 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20211202132110.1067409-1-umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [RFC PATCH] 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]