{"id":15152,"url":"https://patchwork.libcamera.org/api/covers/15152/?format=json","web_url":"https://patchwork.libcamera.org/cover/15152/","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":"<20211213152215.17584-1-david.plowman@raspberrypi.com>","date":"2021-12-13T15:22:14","name":"[libcamera-devel,RFC,0/1] Autofocus controls","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"mbox":"https://patchwork.libcamera.org/cover/15152/mbox/","series":[{"id":2841,"url":"https://patchwork.libcamera.org/api/series/2841/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2841","date":"2021-12-13T15:22:14","name":"Autofocus controls","version":1,"mbox":"https://patchwork.libcamera.org/series/2841/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/15152/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 C2D11BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Dec 2021 15:22:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1DC6B60894;\n\tMon, 13 Dec 2021 16:22:25 +0100 (CET)","from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com\n\t[IPv6:2a00:1450:4864:20::42a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 27A2460868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Dec 2021 16:22:23 +0100 (CET)","by mail-wr1-x42a.google.com with SMTP id a9so27648459wrr.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Dec 2021 07:22:23 -0800 (PST)","from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\tu2sm13001060wrs.17.2021.12.13.07.22.21\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 13 Dec 2021 07:22:21 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"EgQ5wMOG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=n4ylPtirDjzrDsOVDw6Cw22CrPM0WbCJz/95nrdlGOY=;\n\tb=EgQ5wMOGYAfguTevB62KCGjAyh+jMJFEmpEZXDa0lJZSTBSOmO/JkaCpsOT6LFqjL5\n\ttxQ+mbFL2MPG/UI6ICYaOIvmKoo4gfISe145eryFel+EHxYXpBY4Ut1V9XwghC93AsOg\n\tw0sPrSDlzUzPZdi1PMAy8aenMU6wIPuupN684qhjgtNhtExN9CZwj2yTbvy0skLS1CtQ\n\th5YtYy/i3/vRE7LXNZ5uajHQV42Y3H0si2Cn2WCyk8+xz5vCTTjtfpoUkWUrgAwyxeGO\n\tHYfPPUrvnXsHC2tIHtw2becMOljbdGx31Pl2oBthoBRe3DWKpPr5EGrLMMULaGVzoTw5\n\tVlkg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=n4ylPtirDjzrDsOVDw6Cw22CrPM0WbCJz/95nrdlGOY=;\n\tb=ozsJlpjtJ3afb086W92Or58NBSeFlcITUb0Ca22cWlJuPG2gSKPo6kI3fcSKNT90tJ\n\t60vxmgEY1aQ731f07yz7pACH5cTCHhcCnFxMoGz9W+y65Qs8XoaqAE/y5GhDNB8ANQrg\n\t1XZEAXWyd6/nWi1fORMvmLGseo4ZLMcL6GjRAlVehhCb1xWq/BWGaAOQr5rn+rics5VY\n\t0rfQfkoVIShsS7bCkafZarGHO0UPPWsg+cVH/IItXdrARCIJBQ7jz+ncTRwaxiIZRb6F\n\tMxFO3Dmqp9J8Fxl9vCSbWJi2SItoDEqTAxIcMYT8ZVfm/FAaTVFlE2SsFuDv/IxQabya\n\trB2g==","X-Gm-Message-State":"AOAM53100gpYZzEnlm2YbiQ+0g/2dvWF/u0TQ06HCxwZjgb8aFKjI0AR\n\tL6abEdj4synPS6IUCTMHj53aQGin0YYO4Q==","X-Google-Smtp-Source":"ABdhPJzRkVxuvDDLB+aH/TOKOlYmGLdBU9Y4KCqeo+hzhaDjfDo3gnz0Yy5kxsUTgFAaEUmLLG/R6w==","X-Received":"by 2002:adf:f088:: with SMTP id\n\tn8mr31711844wro.411.1639408942365; \n\tMon, 13 Dec 2021 07:22:22 -0800 (PST)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 13 Dec 2021 15:22:14 +0000","Message-Id":"<20211213152215.17584-1-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH 0/1] Autofocus controls","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":"Hi everyone\n\nI thought it was time for a slightly more formal API proposal for AF\n(autofocus).\n\nI've sent a patch listing all the new controls that I think we would\nneed. These controls cover both the use-cases that I can imagine we\n(Raspberry Pi) would expect, and I think it covers all the Android\nuse-cases too. Nonetheless, I think a few words of additional\ndiscussion and questions are warranted.\n\n\n1. AfState\n\nThis closely follows what Android does, only Android duplicates them\nall, once for \"passive\" (aka. continuous) AF and once for \"active\"\n(user-triggered) AF. I can't really see why duplicating them would be\nnecessary, it seems pretty clear to me what mode we're in, but of\ncourse we could if there is a good reason.\n\nI wondered a bit about having an \"Error\" state. Maybe that would get\nreported if the AfWindow rectangles are ill-defined?\n\n2. AfWindow\n\nAllowing applications to set the AF windows seems required. For\nexample, you might be running some kind of object or face detector,\nand then you want to feed those results back to the AF algorithm.\n\nI was unsure what units to use for the Rectangles. It seemed to me\nthat you'd want the rectangles automatically to follow whatever\nScalerCrop you are using. For example, doing digital zoom and leaving\nthe focus windows in a part of the image you can't see seems\nparticularly unhelpful!\n\nSo anyway, I went with the units being \"a proportion of the ScalerCrop\nregion\". Can we think of something better? Would floating point\nRectangles be less annoying?\n\n3. AfMode\n\nAs you probably already know, I'm not really seeing the need for an\n\"off\" mode as it seems the same as \"auto\" to me - so I didn't define\none.\n\nOne thing I wondered about was \"pausing\" CAF (continuous AF). You\nmight want to let it run, then \"pause\" for a moment to take some\ncaptures, and then let it re-start from where it was previously. How\nto accomplish this?\n\nWe could have a separate \"pause\" control, just for CAF. Or I've\nsuggested that you could set the mode back to \"auto\" which would have\nthe same effect. But then how would you go back to CAF \"from where it\nleft off\" as opposed to letting it re-start as though it wasn't\nrunning before? Maybe the \"pause\" control isn't such a bad idea.\n\n4. LensPosition\n\nI've proposed using the lens driver's units for controlling the lens\nposition. It's easy and naturally mimics what we tend to do for\nexposure/gain.\n\nAnother option would be to go a bit more Android-y and insist that\nzero means \"infinity\". Android seems to categorise lenses into\n\"calibrated\" and \"uncalibrated\" types. For the latter type, it looks\nlike pretty much the only stipulation is that zero means\n\"infinity\". For \"calibrated\" lenses the units are formally defined to\nbe dioptres, but I'm thinking that we don't need to go there right\nnow.\n\nThere's also the question of exactly where we get the lens range from.\nIt will be different for each module, even ones using the same lens\nand/or driver - it will in each case be a different subset of the\nrange that the driver advertises. But I think that's not a question\nfor this control API.\n\n\nHopefully all that's enough to start taking this forward. There are of\ncourse lots of points of detail to think about here, but clearly the\n\"big picture\" is most important in the first instance.\n\nThanks!\n\nDavid\n\nDavid Plowman (1):\n  libcamera: controls: Controls for driving AF (autofocus) algorithms\n\n src/libcamera/control_ids.yaml | 227 ++++++++++++++++++++++++---------\n 1 file changed, 167 insertions(+), 60 deletions(-)"}