{"id":13544,"url":"https://patchwork.libcamera.org/api/covers/13544/?format=json","web_url":"https://patchwork.libcamera.org/cover/13544/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20210827120757.110615-1-jacopo@jmondi.org>","date":"2021-08-27T12:07:41","name":"[libcamera-devel,00/16] IPU3 control info update and HAL frame durations","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/cover/13544/mbox/","series":[{"id":2410,"url":"https://patchwork.libcamera.org/api/series/2410/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2410","date":"2021-08-27T12:07:41","name":"IPU3 control info update and HAL frame durations","version":1,"mbox":"https://patchwork.libcamera.org/series/2410/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/13544/comments/","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 9806FBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Aug 2021 12:07:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F0A7268928;\n\tFri, 27 Aug 2021 14:07:13 +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 EB5E860256\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Aug 2021 14:07:12 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 28BEF2000A;\n\tFri, 27 Aug 2021 12:07:11 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 27 Aug 2021 14:07:41 +0200","Message-Id":"<20210827120757.110615-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.32.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 00/16] IPU3 control info update and HAL\n\tframe durations","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":"As the patch subject suggests, this series is composed of two main parts, which\nconcur in correctly handling the frame durations reported to the Android HAL.\n\nThe series is based on Umang's\nhttps://patchwork.libcamera.org/project/libcamera/list/?series=2328\nwhich I would really like to see integrated soon\n\nand has been tested with\nhttps://patchwork.libcamera.org/project/libcamera/list/?series=2406\nwhich fixes a few CTS tests for devices that do not support manual sensor mode.\n\nThe series starts by allowing the IPU3 pipeline handler to select the optimal\nsensor size to feed the ImgU with. Umang's series is a requirement for this\npatch, otherwise the ImgU configuration fails.\n\nPatches 2 and 3 update the Camera's ControlInfoMap in response to a\nCamera::configure() call, by updating the controls limits in the ph and the IPA.\n\nFrom patch 4 on the Android HAL parts begins by collecting per-stream frame\ndurations. As the frame durations are updated as part of the Camera's\nControlInfoMap limits update it is necessary to configure the camera during the\nHAL startup. A few cleanup patches follows, including the correct handling of\nSTALL durations\n\nPatch 10 introduces a filtering criteria for YUV streams: only streams that can\nproduce 30 FPS can be registered for preview. I was not able to find this\nclearly specified in documentation but the requirement has been confirmed by the\ncros camera team and in the Intel HAL implementation.\n\nAfter two more cleanup patches the way\nANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES gets populated is changed to\ncomply with the documentation. Note that this does not align with the Intel HAL\nimplementation which registers 8 values instead of 4.\n\nThe last part of the series is there mostly for comments.\nThe idea is that streams capable of running at more than 30 FPS should be\nlimited to such frame rate, as it has proven to be the optimal one for the\nplatform, and including more frame rates (in example ov5670 is capable of 60FPS\nat smaller resolutions) would require a different handling of\nANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES which I've not been able to fully\nclarify yet.\n\nAs a confirmation, the Intel HAL limits all its streams to 30 FPS as well for\nIQ optimization reasons.\n\nThe series contains one patch to limit the reported duration to 30 FPS and\nplease CTS without actually limiting the frame rate.\nThe patch is then reverted and the same mechanism is implemented in the IPA,\nthis time actually setting the right vblank to maintain the 30 FPS frame rate\n(confirmed inspecting timestamps reported by 'cam').\n\nWith both solutions applied I got several 0 failures CTS runs. With the HAL-only\nsolution the flaky recording tests failed once, with the IPA solution I got not\nfailures in 3 CTS runs.\n\nThanks\n   j\n\nJacopo Mondi (16):\n  libcamera: ipu3: Use the optimal sensor size\n  libcamera: ipu3: Split controls init/update\n  ipa: ipu3: Update camera controls in configure()\n  android: capabilities: Collect per-stream frame durations\n  android: capabilities: Initialize camera state when building\n    properties\n  android: capabilties: Assume controls::FrameDurationLimits is\n    supported\n  android: capabilities: Use per-configuration durations\n  android: capabilties: Correctly populate STALL durations\n  android: capabilities: Collect absolute max frame durations\n  android: Filter preview streams on FPS\n  android: capabilities: Print output stream list\n  android: Populate streams and duration in the same loop\n  android: capabilties: Fix\n    ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES\n  android: capabilities: Cap frame rate to 30 FPS\n  Revert \"android: capabilities: Cap frame rate to 30 FPS\"\n  ipa: ipu3: Cap frame duration to 30 FPS\n\n include/libcamera/ipa/ipu3.mojom     |   3 +-\n src/android/camera_capabilities.cpp  | 199 +++++++++++++++++----------\n src/android/camera_capabilities.h    |   3 +\n src/ipa/ipu3/ipu3.cpp                | 119 +++++++++++-----\n src/libcamera/pipeline/ipu3/ipu3.cpp |  75 ++++++----\n 5 files changed, 267 insertions(+), 132 deletions(-)\n\n--\n2.32.0"}