[{"id":16482,"web_url":"https://patchwork.libcamera.org/comment/16482/","msgid":"<CAO5uPHNxg3daFeNptpa2auhLdQ0SNKF65jPb7R8UPhbLQ_=PnQ@mail.gmail.com>","date":"2021-04-22T04:59:29","subject":"Re: [libcamera-devel] [PATCH v3 09/16] libcamera: simple: 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 a patch,\n\nOn Thu, Apr 22, 2021 at 1:02 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Report the sensor's timestamp in the Request metadata using the\n> completed buffer timestamp.\n>\n> The buffer's timestamp is recorded at DMA-transfer time, and it does not\n> theoretically matches the 'start of exposure' definition. Record this with\n> a \\todo entry.\n>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 12 +++++++++++-\n>  1 file changed, 11 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index f6095d38e97a..e1ee640b0a92 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -22,6 +22,7 @@\n>  #include <linux/media-bus-format.h>\n>\n>  #include <libcamera/camera.h>\n> +#include <libcamera/control_ids.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n>\n> @@ -1116,6 +1117,16 @@ void SimplePipelineHandler::bufferReady(FrameBuffer *buffer)\n>                 return;\n>         }\n>\n> +       /*\n> +        * Record the sensor's timestamp in the request metadata.\n> +        *\n> +        * \\todo The sensor timestamp should be better estimated by connecting\n> +        * to the V4L2Device::frameStart signal if the platform provides it.\n> +        */\n> +       Request *request = buffer->request();\n> +       request->metadata().set(controls::SensorTimestamp,\n> +                               buffer->metadata().timestamp);\n> +\n>         /*\n>          * Queue the captured and the request buffer to the converter if format\n>          * conversion is needed. If there's no queued request, just requeue the\n> @@ -1133,7 +1144,6 @@ void SimplePipelineHandler::bufferReady(FrameBuffer *buffer)\n>         }\n>\n>         /* Otherwise simply complete the request. */\n> -       Request *request = buffer->request();\n>         completeBuffer(request, buffer);\n>         completeRequest(request);\n>  }\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 9C728BDB15\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Apr 2021 04:59:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0FE7A68850;\n\tThu, 22 Apr 2021 06:59:42 +0200 (CEST)","from mail-ej1-x630.google.com (mail-ej1-x630.google.com\n\t[IPv6:2a00:1450:4864:20::630])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B3CF260516\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Apr 2021 06:59:40 +0200 (CEST)","by mail-ej1-x630.google.com with SMTP id mh2so45221735ejb.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Apr 2021 21:59:40 -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=\"RJZ6LJEe\"; 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=4PkjXj5wSF51grB7bOonGVDE0CP/3cmAStra2r2VvKg=;\n\tb=RJZ6LJEedqSScMQcAZvjWKhjxfT3TkYybk5JjryTwCWJGxOgLkUhFiO6DHwTY2OzOL\n\twUXCeBnLz3yoJy/NC5ii+nFWmJYakd+TfDgPF6jBMS8f/UoC0xsuKx8kCvb/778Y5ShU\n\tLl8/yd0xCloMiTj7BGIN8x+Q110Lm2EnbO4qM=","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=4PkjXj5wSF51grB7bOonGVDE0CP/3cmAStra2r2VvKg=;\n\tb=S9VU8WIovS3eOySJdAt1BQK+oGyxILOjJZ/CMaHiW6o1T0GSXNp6eHEuwcDuCgNu+8\n\tuMqkGfSrVqwKmvcymy0myEj+vEJZDSMIKmNaTnFfbRLtp84911Je0yOWF/1Z+njkr95F\n\tqfUUmnBblZx+3pnYfnJenjV2gKsr3IsuewtmjYBRy7aOGzHU0BbShcdpZu/3+bY/3Det\n\tLxsFkJUI9CQHFbDMgZd74fHImZ43DHTEH8raBaMlcDEulOADCBi8bEseLhLdE/DP+YPx\n\tDK5LUdbrC6XzHo/9ByzpWvuHFrMrMhtYQFwcXQi+Aetm0teH+4rzmAqunGLybMX+QMbu\n\tMk+w==","X-Gm-Message-State":"AOAM533gynQXOp00b0GpU+Xftrvbjop3GcTNTkIW4l/atYSLu4GYABOg\n\tqSKiquBN9nePNhYuzlpQVTxeqKageFYvyS1y56PIBg==","X-Google-Smtp-Source":"ABdhPJwehbIqo3vXImcS1GgAU3ETGWEilaOtgkRN91U89B7Z1pQDdsPzQqAEaV3wjvOtH6626koCIpuB/5MaKu1e+Q4=","X-Received":"by 2002:a17:906:13d6:: with SMTP id\n\tg22mr1306736ejc.475.1619067580412; \n\tWed, 21 Apr 2021 21:59:40 -0700 (PDT)","MIME-Version":"1.0","References":"<20210421160319.42251-1-jacopo@jmondi.org>\n\t<20210421160319.42251-10-jacopo@jmondi.org>","In-Reply-To":"<20210421160319.42251-10-jacopo@jmondi.org>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Thu, 22 Apr 2021 13:59:29 +0900","Message-ID":"<CAO5uPHNxg3daFeNptpa2auhLdQ0SNKF65jPb7R8UPhbLQ_=PnQ@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 09/16] libcamera: simple: 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":16561,"web_url":"https://patchwork.libcamera.org/comment/16561/","msgid":"<YIZJJl5k70BGFZbe@pendragon.ideasonboard.com>","date":"2021-04-26T05:01:26","subject":"Re: [libcamera-devel] [PATCH v3 09/16] libcamera: simple: 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:12PM +0200, Jacopo Mondi wrote:\n> Report the sensor's timestamp in the Request metadata using the\n> completed buffer timestamp.\n> \n> The buffer's timestamp is recorded at DMA-transfer time, and it does not\n> theoretically matches the 'start of exposure' definition. Record this with\n> a \\todo entry.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 12 +++++++++++-\n>  1 file changed, 11 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index f6095d38e97a..e1ee640b0a92 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -22,6 +22,7 @@\n>  #include <linux/media-bus-format.h>\n>  \n>  #include <libcamera/camera.h>\n> +#include <libcamera/control_ids.h>\n>  #include <libcamera/request.h>\n>  #include <libcamera/stream.h>\n>  \n> @@ -1116,6 +1117,16 @@ void SimplePipelineHandler::bufferReady(FrameBuffer *buffer)\n>  \t\treturn;\n>  \t}\n>  \n> +\t/*\n> +\t * Record the sensor's timestamp in the request metadata.\n> +\t *\n> +\t * \\todo The sensor timestamp should be better estimated by connecting\n> +\t * to the V4L2Device::frameStart signal if the platform provides it.\n> +\t */\n> +\tRequest *request = buffer->request();\n> +\trequest->metadata().set(controls::SensorTimestamp,\n> +\t\t\t\tbuffer->metadata().timestamp);\n> +\n>  \t/*\n>  \t * Queue the captured and the request buffer to the converter if format\n>  \t * conversion is needed. If there's no queued request, just requeue the\n> @@ -1133,7 +1144,6 @@ void SimplePipelineHandler::bufferReady(FrameBuffer *buffer)\n>  \t}\n>  \n>  \t/* Otherwise simply complete the request. */\n> -\tRequest *request = buffer->request();\n>  \tcompleteBuffer(request, buffer);\n>  \tcompleteRequest(request);\n>  }","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 65488BDC91\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Apr 2021 05:01:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CEC26688A9;\n\tMon, 26 Apr 2021 07:01:33 +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 2F528605BD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Apr 2021 07:01:32 +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 992E74FB;\n\tMon, 26 Apr 2021 07:01:31 +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=\"nOF+X8bM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1619413291;\n\tbh=ODzJGseMD06CcJQatKwvSmZ7oBI4JtnNCHzLeIEylUE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nOF+X8bMaAofMHXQx8h5VTUyVWkg/TPZYvtQ5t2GC00rWHTLmspWTPOuWXQL0h7QC\n\t4+W4rV1cIbR399PnLK1COKD0WyBJ8IVb08GqU2b78moos/nFujkCfeXFNg3QtIVyAR\n\tEm//WL4hQErLr+cYw6i+/acMu+0KzYETTJqcCwoM=","Date":"Mon, 26 Apr 2021 08:01:26 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YIZJJl5k70BGFZbe@pendragon.ideasonboard.com>","References":"<20210421160319.42251-1-jacopo@jmondi.org>\n\t<20210421160319.42251-10-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210421160319.42251-10-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v3 09/16] libcamera: simple: 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>"}}]