[{"id":20189,"web_url":"https://patchwork.libcamera.org/comment/20189/","msgid":"<163420257956.3654017.17055655411217175188@Monstersaurus>","date":"2021-10-14T09:09:39","subject":"Re: [libcamera-devel] [PATCH v3 16/16] android: capabilities: Cap\n\tframe rate to 30 FPS","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2021-10-11 16:11:54)\n> Limit the reported minumum frame duration to 30 FPS.\n> \n> The reason to do is to bring the libcamra HAL in par with the Intel\n> HAL implementation on IPU3 platform, where 30FPS is the frame rate used\n> to perform quality tuning in the closed-source IPA module and has been\n> validated as the most efficient rate for the power/performace budget.\n> \n> This change bring into the HAL a platform specific constraints, which\n> might be opportune for most platforms but should rather be configurable\n> by system integrators. Record that with a \\todo entry.\n> \n> Also record that, even if we report a lower frame rate, we currently\n> do not limit what the camera actually produce.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/android/camera_capabilities.cpp | 24 ++++++++++++++++++++++++\n>  1 file changed, 24 insertions(+)\n> \n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index fbce816c5f61..0d72a1ff07fa 100644\n> --- a/src/android/camera_capabilities.cpp\n> +++ b/src/android/camera_capabilities.cpp\n> @@ -635,6 +635,30 @@ int CameraCapabilities::initializeStreamConfigurations()\n>  \n>                         int64_t minFrameDuration = frameDurations->second.min().get<int64_t>() * 1000;\n>                         int64_t maxFrameDuration = frameDurations->second.max().get<int64_t>() * 1000;\n> +\n> +                       /*\n> +                        * Cap min frame duration to 30 FPS.\n> +                        *\n> +                        * 30 frames per second has been validated as the most\n> +                        * opportune frame rate for quality tuning, and power\n> +                        * vs performances budget on Intel IPU3-based\n> +                        * Chromebooks.\n> +                        *\n> +                        * \\todo This is a platform-specific decision that needs\n> +                        * to be abstracted and delegated to the configuration\n> +                        * file.\n> +                        *\n> +                        * \\todo libcamera only allows to control frame duration\n> +                        * through the per-request controls::FrameDuration\n> +                        * control. If we cap the durations here, we should be\n> +                        * capable of configuring the camera to operate at such\n> +                        * duration without requiring to have the FrameDuration\n> +                        * control to be specified for each Request. Defer this\n> +                        * to the in-development configuration API rework.\n> +                        */\n> +                       if (minFrameDuration < 1e9 / 30.0)\n> +                               minFrameDuration = 1e9 / 30.0;\n> +\n\nIt would be nice to be using std::chrono::durations or something here to\nbe able to use 1s/30 or perhaps some other friendly way of describing\nframe rates..\n\nBut I guess that needs considerably more changes so it doesn't need to\nbe part of this:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n>                         streamConfigurations_.push_back({\n>                                 res, androidFormat, minFrameDuration, maxFrameDuration,\n>                         });\n> -- \n> 2.33.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 48424BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Oct 2021 09:09:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E52F368F4F;\n\tThu, 14 Oct 2021 11:09:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C474D68F4A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Oct 2021 11:09:42 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5DF2A2F3;\n\tThu, 14 Oct 2021 11:09:42 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"R6Q78h9c\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634202582;\n\tbh=2s1NpoFn0nK1HPNdEO9IA6DT8c0VgE7lAC8DD/fWnbY=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=R6Q78h9c/mxo2o+D4XmElw0e135fl3JxmCizCP9NzFckgax7/p7m4MgucxR7e3Die\n\tMDbdRPNzAg3rzh5R9hjwxcFRiZqjNQwaHVyeqncjcKKZ+M64AU3Yd3zcMRUmUn+hSS\n\t8x4CXC984aeI+Q6XycEBnW8z/95JcGQbbZ07/aG0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211011151154.72856-17-jacopo@jmondi.org>","References":"<20211011151154.72856-1-jacopo@jmondi.org>\n\t<20211011151154.72856-17-jacopo@jmondi.org>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","Date":"Thu, 14 Oct 2021 10:09:39 +0100","Message-ID":"<163420257956.3654017.17055655411217175188@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH v3 16/16] android: capabilities: Cap\n\tframe rate to 30 FPS","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>"}}]