[{"id":4899,"web_url":"https://patchwork.libcamera.org/comment/4899/","msgid":"<c948c8d23e02a78610bda7516e10badd3aeb85be.camel@ndufresne.ca>","date":"2020-05-25T12:04:03","subject":"Re: [libcamera-devel] [PATCH v2 0/3] raspberrypi: FPS control","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le mercredi 13 mai 2020 à 10:11 +0100, Naushir Patuck a écrit :\n> Hi,\n> \n> This is the v2 patchset for framerate control on the Raspberry Pi platform.\n> \n> There are quite substantial updates from the v1 patch:\n> - Added min/max frame duration controls to libcamera.\n\nThe cover letter says FPS control, this patch adds frame duration\ncontrol. Did we chose frame duration simply because V4L2 works that\nway? What do we want to standard on? How is sensor programmed in this\nregard? What is the most natural configuration? An FPS fraction, or a\nframe duration ?\n\n> - Control vblanking for both min and max frame duration.\n> - Moved GetVBlanking() into the CamHelper base class.\n> - Updated tunings for the imx219, imx477 and ov5647 sensors to limit maximum exposure times.\n> \n> Thanks,\n> Naush\n> \n> Naushir Patuck (3):\n>   libcamera: controls: Add frame duration control\n>   libcamera: raspberrypi: Add control of sensor vblanking\n>   ipa: raspberrypi: config: Update shutter speeds for imx219/477 and\n>     ov5647\n> \n>  include/ipa/raspberrypi.h                     |  1 +\n>  src/ipa/raspberrypi/cam_helper.cpp            | 38 ++++++++++++++-\n>  src/ipa/raspberrypi/cam_helper.hpp            | 15 +++++-\n>  src/ipa/raspberrypi/cam_helper_imx219.cpp     | 11 ++++-\n>  src/ipa/raspberrypi/cam_helper_imx477.cpp     | 11 ++++-\n>  src/ipa/raspberrypi/cam_helper_ov5647.cpp     | 11 ++++-\n>  src/ipa/raspberrypi/data/imx219.json          | 15 +++++-\n>  src/ipa/raspberrypi/data/imx477.json          | 15 +++++-\n>  src/ipa/raspberrypi/data/ov5647.json          | 15 +++++-\n>  src/ipa/raspberrypi/raspberrypi.cpp           | 48 ++++++++++++++++---\n>  src/libcamera/control_ids.yaml                | 14 ++++++\n>  .../pipeline/raspberrypi/raspberrypi.cpp      |  2 +\n>  12 files changed, 177 insertions(+), 19 deletions(-)\n>","headers":{"Return-Path":"<nicolas@ndufresne.ca>","Received":["from mail-qt1-x841.google.com (mail-qt1-x841.google.com\n\t[IPv6:2607:f8b0:4864:20::841])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 519B4603D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 May 2020 14:04:06 +0200 (CEST)","by mail-qt1-x841.google.com with SMTP id y1so2905743qtv.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 May 2020 05:04:06 -0700 (PDT)","from skullcanyon ([192.222.193.21])\n\tby smtp.gmail.com with ESMTPSA id\n\tt74sm13904146qka.21.2020.05.25.05.04.04\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 25 May 2020 05:04:04 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ndufresne-ca.20150623.gappssmtp.com\n\theader.i=@ndufresne-ca.20150623.gappssmtp.com header.b=\"o1u3WXvc\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20150623.gappssmtp.com; s=20150623;\n\th=message-id:subject:from:to:date:in-reply-to:references:user-agent\n\t:mime-version:content-transfer-encoding;\n\tbh=0Ujv8ivqO4tzfxo8nF+fjjmYAgWF5YBMNngRlrGoffQ=;\n\tb=o1u3WXvc7TBKxu30vKd5vrAAYUn9c4g1oDm8GqDjA0J539QH/e0+eyHbQeO0R5cGTv\n\tkUHfp49DEAqglzttLhEEMiDJSvMHLILPesYKa371487hjoHReeJ9dKXn6I/KQDW5r0pB\n\tXxn20s4Tzyy+/+ouFDldNV51gyvtRsxVaXqkuff4gWWUvqo1oSmUSLNZGIgCaoDAffe3\n\t92QrKrVIo2KwUyRgv4CXWWccnQLqRqvR+GzfSefpdZ8/BzZgVbsLWB0+asjzlyTFvvdf\n\tRbib27dlW/ueH0JCrwV5mGsK6FS0x8Kl9lwoMrowF6NHqvyRhGhgwi7JtKnh7KlHSo9S\n\tnXLA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:message-id:subject:from:to:date:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=0Ujv8ivqO4tzfxo8nF+fjjmYAgWF5YBMNngRlrGoffQ=;\n\tb=J3nyKIF0WPloKppbOezmz64MFGaY3iUFS8XBerlyYnWxQVtoyAe4h1P6v0r+9AcbgE\n\tFVkI8zUYjoKNywxJj8zZwbe6qPn0X2BKM0zy5+Uj5ks6m1hqK2SyZhp0rRyxSN4Stozx\n\tIIT3Xd2KQFyG5KI1XwzmtuV4wLef9ySd++GNIIx7V+wrzL3gEhK/s0S1BiHfVe3xIv7C\n\tlxHe105EKs1GZ9UzIlqkzRX7/c5ER7ED4hGJ2Qwwazjo5xILl5Goidjv8O9bCAqZrJDe\n\t24cpZO4YnSe3RSBOsHtvUkBXYpLhyIOzYJANk/3GUuMaYBY9Rczldf7Y+1dyOEPwMW8U\n\tGriA==","X-Gm-Message-State":"AOAM533j8ND/bE06ikQJOJFhOJK7/BwsVatehT6Nd7sdeqvR5SpM5IiB\n\tdvR3DMa3rlkLytOQoyIq+EBLPQ==","X-Google-Smtp-Source":"ABdhPJxlKVAo/mABmXXnnStwn+A1HXppTPxbhf16lxMhtnR6U4kAmuQnSGCJQXjpxYBUpFK7+Ttieg==","X-Received":"by 2002:ac8:32d6:: with SMTP id\n\ta22mr28886928qtb.367.1590408244937; \n\tMon, 25 May 2020 05:04:04 -0700 (PDT)","Message-ID":"<c948c8d23e02a78610bda7516e10badd3aeb85be.camel@ndufresne.ca>","From":"Nicolas Dufresne <nicolas@ndufresne.ca>","To":"Naushir Patuck <naush@raspberrypi.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 25 May 2020 08:04:03 -0400","In-Reply-To":"<20200513091120.1653-1-naush@raspberrypi.com>","References":"<20200513091120.1653-1-naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","User-Agent":"Evolution 3.36.2 (3.36.2-1.fc32) ","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v2 0/3] raspberrypi: FPS control","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>","X-List-Received-Date":"Mon, 25 May 2020 12:04:06 -0000"}},{"id":4901,"web_url":"https://patchwork.libcamera.org/comment/4901/","msgid":"<20200526023549.GE6179@pendragon.ideasonboard.com>","date":"2020-05-26T02:35:49","subject":"Re: [libcamera-devel] [PATCH v2 0/3] raspberrypi: FPS control","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicolas,\n\nOn Mon, May 25, 2020 at 08:04:03AM -0400, Nicolas Dufresne wrote:\n> Le mercredi 13 mai 2020 à 10:11 +0100, Naushir Patuck a écrit :\n> > Hi,\n> > \n> > This is the v2 patchset for framerate control on the Raspberry Pi platform.\n> > \n> > There are quite substantial updates from the v1 patch:\n> > - Added min/max frame duration controls to libcamera.\n> \n> The cover letter says FPS control, this patch adds frame duration\n> control. Did we chose frame duration simply because V4L2 works that\n> way?\n\nNo, V4L2 wasn't considered to make this decision.\n\n> What do we want to standard on? How is sensor programmed in this\n> regard?\n\nIn most cases, sensors are programmed with a pixel rate (which directly\nderives from the input clock), an analog crop rectangle and horizontal\nand vertical blanking. The frame rate is equal to the pixel rate divided\nby the product of the total vertical and total horizontal sizes.\n\n\"Smart\" sensors integrate an ISP and a microcontroller that runs an\nauto-exposure algorithm. The microcode configures the blanking values,\nbased on higher-level parameters such as a target frame rate or minimum\nand maximum frame rates (sometimes with a step). How those frame rates\nare expressed is sensor-specific, some sensors use frame durations, some\nsensors use frame rates expressed as a fraction (sometimes with\nconstraints on the numerator and denominator, possible with the\nnumerator being fixed to 1).\n\nThe V4L2 subdev API has an operation to set the frame rate as a fraction\n(this comes from TV capture devices), and an API to configure the pixel\nrate and blanking (though V4L2 controls). The former is abused by sensor\ndrivers that should really use the latter, and I've called for the\nV4L2 FPS-based API to be deprecated for camera sensors in most cases.\n\n> What is the most natural configuration? An FPS fraction, or a\n> frame duration ?\n\nSee\nhttps://lists.libcamera.org/pipermail/libcamera-devel/2020-May/008741.html\nfor discussions on this topic.\n\n> > - Control vblanking for both min and max frame duration.\n> > - Moved GetVBlanking() into the CamHelper base class.\n> > - Updated tunings for the imx219, imx477 and ov5647 sensors to limit maximum exposure times.\n> > \n> > Thanks,\n> > Naush\n> > \n> > Naushir Patuck (3):\n> >   libcamera: controls: Add frame duration control\n> >   libcamera: raspberrypi: Add control of sensor vblanking\n> >   ipa: raspberrypi: config: Update shutter speeds for imx219/477 and\n> >     ov5647\n> > \n> >  include/ipa/raspberrypi.h                     |  1 +\n> >  src/ipa/raspberrypi/cam_helper.cpp            | 38 ++++++++++++++-\n> >  src/ipa/raspberrypi/cam_helper.hpp            | 15 +++++-\n> >  src/ipa/raspberrypi/cam_helper_imx219.cpp     | 11 ++++-\n> >  src/ipa/raspberrypi/cam_helper_imx477.cpp     | 11 ++++-\n> >  src/ipa/raspberrypi/cam_helper_ov5647.cpp     | 11 ++++-\n> >  src/ipa/raspberrypi/data/imx219.json          | 15 +++++-\n> >  src/ipa/raspberrypi/data/imx477.json          | 15 +++++-\n> >  src/ipa/raspberrypi/data/ov5647.json          | 15 +++++-\n> >  src/ipa/raspberrypi/raspberrypi.cpp           | 48 ++++++++++++++++---\n> >  src/libcamera/control_ids.yaml                | 14 ++++++\n> >  .../pipeline/raspberrypi/raspberrypi.cpp      |  2 +\n> >  12 files changed, 177 insertions(+), 19 deletions(-)","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5245A603CF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 May 2020 04:36:04 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8C62C562;\n\tTue, 26 May 2020 04:36:03 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"g/ybtA+8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1590460563;\n\tbh=2lCXJSaa+4z6w6zJYrw9FOsXbF8diLhPyDqkaXiveyk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=g/ybtA+8tf1SXRy0oyrgRVTofxHbJkaygU1y+0sWBvtvlY+3AdFwyBVNJzLIQ+INk\n\tEifO6WrZRH75+xB5Kq/v8zwARL8bs/1eIgOpUPaHRsUjY+xA5hV3YdgO/sEhX6eOqg\n\tynJVEPX5iQ6hOrHZ8MZzFkKnwYd92leIytCh0aRE=","Date":"Tue, 26 May 2020 05:35:49 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<20200526023549.GE6179@pendragon.ideasonboard.com>","References":"<20200513091120.1653-1-naush@raspberrypi.com>\n\t<c948c8d23e02a78610bda7516e10badd3aeb85be.camel@ndufresne.ca>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<c948c8d23e02a78610bda7516e10badd3aeb85be.camel@ndufresne.ca>","Subject":"Re: [libcamera-devel] [PATCH v2 0/3] raspberrypi: FPS control","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>","X-List-Received-Date":"Tue, 26 May 2020 02:36:05 -0000"}}]