{"id":13746,"url":"https://patchwork.libcamera.org/api/1.1/patches/13746/?format=json","web_url":"https://patchwork.libcamera.org/patch/13746/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210907194107.803730-16-jacopo@jmondi.org>","date":"2021-09-07T19:41:05","name":"[libcamera-devel,v2,15/17] android: capabilities: Cap frame rate to 30 FPS","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"5c6feb75fdf680c42a022d218f228ad9a52259b3","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13746/mbox/","series":[{"id":2492,"url":"https://patchwork.libcamera.org/api/1.1/series/2492/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2492","date":"2021-09-07T19:40:50","name":"IPU3 control info update and HAL frame durations","version":2,"mbox":"https://patchwork.libcamera.org/series/2492/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13746/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13746/checks/","tags":{},"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 AA55BBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 19:40:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 645476917D;\n\tTue,  7 Sep 2021 21:40:44 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 270086916F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 21:40:41 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id B55F2240002;\n\tTue,  7 Sep 2021 19:40:40 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  7 Sep 2021 21:41:05 +0200","Message-Id":"<20210907194107.803730-16-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20210907194107.803730-1-jacopo@jmondi.org>","References":"<20210907194107.803730-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 15/17] android: capabilities: Cap frame\n\trate 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>"},"content":"Limit the reported minumum frame duration to 30 FPS.\n\nThe reason to do is to bring the libcamra HAL in par with the Intel\nHAL implementation on IPU3 platform, where 30FPS is the frame rate used\nto perform quality tuning in the closed-source IPA module and has been\nvalidated as the most efficient rate for the power/performace budget.\n\nThis change bring into the HAL a platform specific constraints, which\nmight be opportune for most platforms but should rather be configurable\nby system integrators. Record that with a \\todo entry.\n\nAlso record that, even if we report a lower frame rate, we currently\ndo not limit what the camera actually produce.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_capabilities.cpp | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)","diff":"diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex deaec3282fd7..cff1e30a9567 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -632,6 +632,29 @@ int CameraCapabilities::initializeStreamConfigurations()\n \n \t\t\tint64_t minFrameDuration = frameDurations->second.min().get<int64_t>() * 1000;\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.\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+\t\t\t * vs performances budget on Intel IPU3.\n+\t\t\t *\n+\t\t\t * \\todo This is a platform-specific decision that needs\n+\t\t\t * to be abstracted and delegated to the configuration\n+\t\t\t * file.\n+\t\t\t *\n+\t\t\t * \\todo libcamera only allows to control frame duration\n+\t\t\t * through the per-request controls::FrameDuration\n+\t\t\t * control. If we cap the durations here, we should be\n+\t\t\t * capable of configuring the camera to operate at such\n+\t\t\t * duration without requiring to have the FrameDuration\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+\n \t\t\tstreamConfigurations_.push_back({\n \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,\n \t\t\t});\n","prefixes":["libcamera-devel","v2","15/17"]}