[{"id":16485,"web_url":"https://patchwork.libcamera.org/comment/16485/","msgid":"<CAO5uPHP9g=zLPegbLV9touc6gszqDEzRnaggJYGtwhvfG-sGkA@mail.gmail.com>","date":"2021-04-22T05:23:34","subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Jacopo, thank you for the patch.\n\nOn Thu, Apr 22, 2021 at 1:03 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Report the sensor's timestamp in the Request metadata by using the\n> Unicam::Image buffer timestamp as an initial approximation.\n>\n> The buffer's timestamp is recorded at DMA-transfer time, and it does not\n> theoretically matches the 'start of exposure' definition, but when used\n> to compare two consecutive frames it gives an acceptable estimation of\n> the sensor frame period duration.\n>\n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 6c6d31f78c88..ac135f95de12 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1414,6 +1414,18 @@ void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)\n>                         << \", timestamp: \" << buffer->metadata().timestamp;\n>\n>         if (stream == &unicam_[Unicam::Image]) {\n> +               /*\n> +                * Record the sensor timestamp in the Request.\n> +                *\n> +                * \\todo Do not assume the request in the front of the queue\n> +                * is the correct one\n> +                */\n\nCan you have any idea how to get rid of this assumption?\nI am ok with this patch as-is while the todo should be resolved in the\nnear future.\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n> +               Request *request = requestQueue_.front();\n> +               ASSERT(request);\n> +\n> +               request->metadata().set(controls::SensorTimestamp,\n> +                                       buffer->metadata().timestamp);\n> +\n>                 /*\n>                  * Lookup the sensor controls used for this frame sequence from\n>                  * DelayedControl and queue them along with the frame buffer.\n> --\n> 2.31.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 9A38EBDB17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Apr 2021 05:23:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 025BB68850;\n\tThu, 22 Apr 2021 07:23:47 +0200 (CEST)","from mail-ed1-x535.google.com (mail-ed1-x535.google.com\n\t[IPv6:2a00:1450:4864:20::535])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0015860516\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Apr 2021 07:23:45 +0200 (CEST)","by mail-ed1-x535.google.com with SMTP id g17so51209216edm.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Apr 2021 22:23:45 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"Ril5juca\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=4civtLguM7g5dZDu2Lf8mVC1qfYHJikeTSXESEIyaxQ=;\n\tb=Ril5jucap3modpbKBphznf6tX8p5rLt7eKvStfm3Hsu1iIL+j+tyJMmrargxnB7VPa\n\tXcS0nBo10Y2qdU2LSZCfteg9QDS3/KRXMJcwa9Ud1h5u/t5hshuJ4aPZadE43NAqvEDI\n\twwmE1aOT/KADWdUC04TWEq8ACZjcJIcZMMb58=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=4civtLguM7g5dZDu2Lf8mVC1qfYHJikeTSXESEIyaxQ=;\n\tb=qfecxo5HNbBECHHKoCmoyvVR1o0Ku1BEskE4jdObfFgVO6ZHh5p1/EDO93GtiiIw/s\n\tdXPJERLvzbfGHuPxHijKK4D8quEkCQSgNv1bCzgGOF9IEEi0p5gT/uV/s23I4WTqjEqK\n\t/lPO8/6hD9RqHwnNdbtMZqgIkqANlGdCyzP5PFWAARzeeQWExeZnMgePe/DUQ5tSHDYd\n\ty+tdhPS/FVy/+kdJOfCf4/8nwg00RvUBVTKylh5TFbVq2GIqi+hY5/WkPa2wrltohwTr\n\tHYKURYdgw/XUf2tA5rNf0UqeFYmcngL7HfX2dDSzVkJyGXCWi9Of/MVYKo8htX4k/pxk\n\tiXGw==","X-Gm-Message-State":"AOAM533krVRdoZOBMZPjRwpOWFGU8qXEpoANB+/rriDADwzSfUG7zUvG\n\t7xO0DC7oUG2hnbvFNXJ698wvFuZCSeZ+AR6b50gbYqm2eNoYig==","X-Google-Smtp-Source":"ABdhPJy7qridYRr7qyWtKCBp/AfW1Nas0jhSacTKl5LzpNGLcMZ0MO/v9vTZMtdp6H+a8XusWR2ylnEQ8Pqf6CoAGZo=","X-Received":"by 2002:aa7:d48a:: with SMTP id\n\tb10mr1532110edr.202.1619069025612; \n\tWed, 21 Apr 2021 22:23:45 -0700 (PDT)","MIME-Version":"1.0","References":"<20210421160319.42251-1-jacopo@jmondi.org>\n\t<20210421160319.42251-14-jacopo@jmondi.org>","In-Reply-To":"<20210421160319.42251-14-jacopo@jmondi.org>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Thu, 22 Apr 2021 14:23:34 +0900","Message-ID":"<CAO5uPHP9g=zLPegbLV9touc6gszqDEzRnaggJYGtwhvfG-sGkA@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16496,"web_url":"https://patchwork.libcamera.org/comment/16496/","msgid":"<20210422071227.ojwlve44ne4ql4ps@uno.localdomain>","date":"2021-04-22T07:12:27","subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Hiro,\n\nOn Thu, Apr 22, 2021 at 02:23:34PM +0900, Hirokazu Honda wrote:\n> Hi Jacopo, thank you for the patch.\n>\n> On Thu, Apr 22, 2021 at 1:03 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> >\n> > Report the sensor's timestamp in the Request metadata by using the\n> > Unicam::Image buffer timestamp as an initial approximation.\n> >\n> > The buffer's timestamp is recorded at DMA-transfer time, and it does not\n> > theoretically matches the 'start of exposure' definition, but when used\n> > to compare two consecutive frames it gives an acceptable estimation of\n> > the sensor frame period duration.\n> >\n> > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 ++++++++++++\n> >  1 file changed, 12 insertions(+)\n> >\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index 6c6d31f78c88..ac135f95de12 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -1414,6 +1414,18 @@ void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)\n> >                         << \", timestamp: \" << buffer->metadata().timestamp;\n> >\n> >         if (stream == &unicam_[Unicam::Image]) {\n> > +               /*\n> > +                * Record the sensor timestamp in the Request.\n> > +                *\n> > +                * \\todo Do not assume the request in the front of the queue\n> > +                * is the correct one\n> > +                */\n>\n> Can you have any idea how to get rid of this assumption?\n> I am ok with this patch as-is while the todo should be resolved in the\n> near future.\n\nYes, there's a plan\nhttps://patchwork.libcamera.org/patch/11992/\n\n>\n> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n>\n> > +               Request *request = requestQueue_.front();\n> > +               ASSERT(request);\n> > +\n> > +               request->metadata().set(controls::SensorTimestamp,\n> > +                                       buffer->metadata().timestamp);\n> > +\n> >                 /*\n> >                  * Lookup the sensor controls used for this frame sequence from\n> >                  * DelayedControl and queue them along with the frame buffer.\n> > --\n> > 2.31.1\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel","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 F272ABDB17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Apr 2021 07:11:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C166768852;\n\tThu, 22 Apr 2021 09:11:47 +0200 (CEST)","from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 15BD368847\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Apr 2021 09:11:47 +0200 (CEST)","from uno.localdomain (host-82-57-193-192.retail.telecomitalia.it\n\t[82.57.193.192]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 53E60FF842;\n\tThu, 22 Apr 2021 07:11:46 +0000 (UTC)"],"X-Originating-IP":"82.57.193.192","Date":"Thu, 22 Apr 2021 09:12:27 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<20210422071227.ojwlve44ne4ql4ps@uno.localdomain>","References":"<20210421160319.42251-1-jacopo@jmondi.org>\n\t<20210421160319.42251-14-jacopo@jmondi.org>\n\t<CAO5uPHP9g=zLPegbLV9touc6gszqDEzRnaggJYGtwhvfG-sGkA@mail.gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<CAO5uPHP9g=zLPegbLV9touc6gszqDEzRnaggJYGtwhvfG-sGkA@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16498,"web_url":"https://patchwork.libcamera.org/comment/16498/","msgid":"<CAO5uPHPa+AN1rWjiVqU8a8+JuUrZ6HM6mbzrui5kAfmo2U4NpA@mail.gmail.com>","date":"2021-04-22T07:27:54","subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Jacopo,\n\nOn Thu, Apr 22, 2021 at 4:11 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Hi Hiro,\n>\n> On Thu, Apr 22, 2021 at 02:23:34PM +0900, Hirokazu Honda wrote:\n> > Hi Jacopo, thank you for the patch.\n> >\n> > On Thu, Apr 22, 2021 at 1:03 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n> > >\n> > > Report the sensor's timestamp in the Request metadata by using the\n> > > Unicam::Image buffer timestamp as an initial approximation.\n> > >\n> > > The buffer's timestamp is recorded at DMA-transfer time, and it does not\n> > > theoretically matches the 'start of exposure' definition, but when used\n> > > to compare two consecutive frames it gives an acceptable estimation of\n> > > the sensor frame period duration.\n> > >\n> > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > ---\n> > >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 ++++++++++++\n> > >  1 file changed, 12 insertions(+)\n> > >\n> > > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > index 6c6d31f78c88..ac135f95de12 100644\n> > > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > > @@ -1414,6 +1414,18 @@ void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)\n> > >                         << \", timestamp: \" << buffer->metadata().timestamp;\n> > >\n> > >         if (stream == &unicam_[Unicam::Image]) {\n> > > +               /*\n> > > +                * Record the sensor timestamp in the Request.\n> > > +                *\n> > > +                * \\todo Do not assume the request in the front of the queue\n> > > +                * is the correct one\n> > > +                */\n> >\n> > Can you have any idea how to get rid of this assumption?\n> > I am ok with this patch as-is while the todo should be resolved in the\n> > near future.\n>\n> Yes, there's a plan\n> https://patchwork.libcamera.org/patch/11992/\n>\n\nGood to know. I look forward to it.\n\n-Hiro\n> >\n> > Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n> >\n> > > +               Request *request = requestQueue_.front();\n> > > +               ASSERT(request);\n> > > +\n> > > +               request->metadata().set(controls::SensorTimestamp,\n> > > +                                       buffer->metadata().timestamp);\n> > > +\n> > >                 /*\n> > >                  * Lookup the sensor controls used for this frame sequence from\n> > >                  * DelayedControl and queue them along with the frame buffer.\n> > > --\n> > > 2.31.1\n> > >\n> > > _______________________________________________\n> > > libcamera-devel mailing list\n> > > libcamera-devel@lists.libcamera.org\n> > > https://lists.libcamera.org/listinfo/libcamera-devel","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 67BDBBDB15\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Apr 2021 07:28:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1FCCA68852;\n\tThu, 22 Apr 2021 09:28:06 +0200 (CEST)","from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com\n\t[IPv6:2a00:1450:4864:20::62f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BA02A68847\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Apr 2021 09:28:04 +0200 (CEST)","by mail-ej1-x62f.google.com with SMTP id r9so67259693ejj.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Apr 2021 00:28:04 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"IZZHbMt6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=Wgb8UaD57O0oRGZFFAjZXZnfJkFI8C/A26y7fDkhmXg=;\n\tb=IZZHbMt6scpUujmqyP1PvVZbJxf/2npUK1Ak9Zz46+M19g67jGZB66bK+yXvU2xJVX\n\tApjG7pkp3nwGUy0CxL2fs6IcnmmGdSDaVZG/PPE5dRrUX4esxF3nXZXBNMk3Ry+vvHKC\n\t0F3kROpQ8KXw+4AUHKUnaFSGFbjRdhALvEuKw=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=Wgb8UaD57O0oRGZFFAjZXZnfJkFI8C/A26y7fDkhmXg=;\n\tb=XG8IYLXpzVmNGk9XuHFT5QtwwGy4rOsUDcns73+QNKL/t7HmsVYW0Md/F6fASJ/PNZ\n\tSl/q0FCmWueUEPRSPPLLehascIiJiXMlbMlREpdB4iR4zcZOJDlG6lJgWN5v/lSRRdNk\n\tmCE8T81H0lKzHOL/GuG0Ljq+eSj8mMMHPTkBPecCmBKWqyq4DH7bVy8pjpA0M5T/QO8g\n\tmUkzrzj16DOM0lvSwjQS16VIexXTCcagmAPnIlc0pv5XIJmUyXyPZb85O5OX1FMH1mmo\n\tZEzLr0YT1Lxqc9YrbytnwiY4loVqbp/CeDEWRsyPXVRJH7fbfwOurhY9CTclXa7tmIit\n\tZtmQ==","X-Gm-Message-State":"AOAM531NR48KMc8GEGic+5Wyof0UQ2a0fw1C1+A/eJ8uKivmRqgfcDta\n\tapqxGWMu3tLbHrvgTfsw7tbDT3I50/2nG7UF1+DKzQ==","X-Google-Smtp-Source":"ABdhPJx+iaV6QXExKoVCrBf9B2HcJlLVtEoMh8OrhO2HI7J5h62wmiFfLcLvHxOkR7FBnE2GDYv44YGWgDBq7j15AvA=","X-Received":"by 2002:a17:906:13d6:: with SMTP id\n\tg22mr1858310ejc.475.1619076484473; \n\tThu, 22 Apr 2021 00:28:04 -0700 (PDT)","MIME-Version":"1.0","References":"<20210421160319.42251-1-jacopo@jmondi.org>\n\t<20210421160319.42251-14-jacopo@jmondi.org>\n\t<CAO5uPHP9g=zLPegbLV9touc6gszqDEzRnaggJYGtwhvfG-sGkA@mail.gmail.com>\n\t<20210422071227.ojwlve44ne4ql4ps@uno.localdomain>","In-Reply-To":"<20210422071227.ojwlve44ne4ql4ps@uno.localdomain>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Thu, 22 Apr 2021 16:27:54 +0900","Message-ID":"<CAO5uPHPa+AN1rWjiVqU8a8+JuUrZ6HM6mbzrui5kAfmo2U4NpA@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16562,"web_url":"https://patchwork.libcamera.org/comment/16562/","msgid":"<YIZJ5URc/UTjt1k/@pendragon.ideasonboard.com>","date":"2021-04-26T05:04:37","subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Wed, Apr 21, 2021 at 06:03:16PM +0200, Jacopo Mondi wrote:\n> Report the sensor's timestamp in the Request metadata by using the\n> Unicam::Image buffer timestamp as an initial approximation.\n> \n> The buffer's timestamp is recorded at DMA-transfer time, and it does not\n> theoretically matches the 'start of exposure' definition, but when used\n> to compare two consecutive frames it gives an acceptable estimation of\n> the sensor frame period duration.\n> \n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 6c6d31f78c88..ac135f95de12 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1414,6 +1414,18 @@ void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)\n>  \t\t\t<< \", timestamp: \" << buffer->metadata().timestamp;\n>  \n>  \tif (stream == &unicam_[Unicam::Image]) {\n> +\t\t/*\n> +\t\t * Record the sensor timestamp in the Request.\n> +\t\t *\n> +\t\t * \\todo Do not assume the request in the front of the queue\n> +\t\t * is the correct one\n> +\t\t */\n> +\t\tRequest *request = requestQueue_.front();\n> +\t\tASSERT(request);\n> +\n> +\t\trequest->metadata().set(controls::SensorTimestamp,\n> +\t\t\t\t\tbuffer->metadata().timestamp);\n> +\n>  \t\t/*\n>  \t\t * Lookup the sensor controls used for this frame sequence from\n>  \t\t * DelayedControl and queue them along with the frame buffer.","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 53CBBBDC92\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Apr 2021 05:04:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D537C6889D;\n\tMon, 26 Apr 2021 07:04:43 +0200 (CEST)","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 CE959605BD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Apr 2021 07:04:42 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4D9454FB;\n\tMon, 26 Apr 2021 07:04:42 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"GJlqZ/ym\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1619413482;\n\tbh=xNuN8Z50tLTHsOFmrWaPRN3HxVYiuJce19XMmTcZUjo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=GJlqZ/ymlH2qMMMTnwgtLcUJrHGLgQBf+nqx+vCFsYdIaK+ssOQDHpxKCMrKhqxXB\n\t1+P6jQcWZ2y1eLSWytMmvOgI5uP7VHOi/RcPx3UncqdGYSLl4cXDa4CMHJKiSkawmU\n\tcpfWDkt2gnKXTH9R1Il20EkrgMhr9dH5FVzQl/uY=","Date":"Mon, 26 Apr 2021 08:04:37 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YIZJ5URc/UTjt1k/@pendragon.ideasonboard.com>","References":"<20210421160319.42251-1-jacopo@jmondi.org>\n\t<20210421160319.42251-14-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210421160319.42251-14-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 13/16] libcamera: raspberry: Report\n\tsensor timestamp","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]