[{"id":16710,"web_url":"https://patchwork.libcamera.org/comment/16710/","msgid":"<YIz1HpHf4GDenvOc@oden.dyn.berto.se>","date":"2021-05-01T06:28:46","subject":"Re: [libcamera-devel] [PATCH v4 06/16] libcamera: uvc: Report\n\tsensor timestamp","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your patch.\n\nOn 2021-04-30 18:00:16 +0200, Jacopo Mondi wrote:\n> Report the sensor's timestamp in the Request metadata using the\n> completed buffer timestamp.\n> \n> The UVC driver reports timestamps of SOE event through metadata, for\n> which there is no support in the current pipeline implementation.\n> \n> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index b6c6ade5ebaf..faa8d6b05f46 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -662,6 +662,10 @@ void UVCCameraData::bufferReady(FrameBuffer *buffer)\n>  {\n>  \tRequest *request = buffer->request();\n>  \n> +\t/* \\todo Use the UVC metadata to calculate a more precise timestamp */\n\nHow?\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> +\trequest->metadata().set(controls::SensorTimestamp,\n> +\t\t\t\tbuffer->metadata().timestamp);\n> +\n>  \tpipe_->completeBuffer(request, buffer);\n>  \tpipe_->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 051C3BDE6A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 May 2021 06:28:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 86EFD688E4;\n\tSat,  1 May 2021 08:28:49 +0200 (CEST)","from mail-lf1-x130.google.com (mail-lf1-x130.google.com\n\t[IPv6:2a00:1450:4864:20::130])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C4E6602BF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 May 2021 08:28:48 +0200 (CEST)","by mail-lf1-x130.google.com with SMTP id 124so401038lff.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Apr 2021 23:28:48 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tq9sm488513lfc.201.2021.04.30.23.28.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 30 Apr 2021 23:28:47 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"HOF0qU0D\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=JyVGbVPApQQJkHw2SyIDTQP7FAhioyZL5Xub0IGh6zM=;\n\tb=HOF0qU0DTnz2luP8jDXNkjmPm7Iq5wDHhdhI5lLzSgEzrkQf4EnxNnVh+wwzfJpNE4\n\taTZULN0DmDwgZzhiPfmvCX0iEXuhiKL4kNZSoD39R8p2HA3pA3exUfhSMLM2S82fMUGQ\n\tQpuiUvhl066XV2uFLm4COXADd9xadjdeNbLibtkoB3XxBbShngY/giJ7OVMRyl1tGVej\n\tx8ilDGYQYi2bfFuWQcbq4cBh0P2AErgMPrsXyV+bqMtrPdlC0VRzSdb7EGWZoe9C0CS+\n\tpd4DSs6xjrzMALDLJf32gdPOe+PduFZ2OUq+5Rs+6nK4bgHHdWOy/98buEe9M86+lANs\n\tiSnQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=JyVGbVPApQQJkHw2SyIDTQP7FAhioyZL5Xub0IGh6zM=;\n\tb=N4NQcY4Ml0Bm0oSyR/pykDxdpliDHOMizHxYwWGjfn3rcXMTcrHud9BhLHqirXXs0G\n\tJIs5cUvGB34ZjxD7g0qW+mrxQJFY4G2jeDmfXmjVtjgzzgQMtgGKzsdiYrDvhLdNAak5\n\tUtzp5knRCmbUFGuXUOkBWmUBfc/fotFqmCTPQmf83T/6oPAPcu4wCJuiSVEohH0UNYo+\n\td+4PBlAFtXu6hpKs0+bE693SVzt7aC15FChhvaaTuCqBtWJGWUdUfnxvf6UxcLlV7GDq\n\t3es7hy1r0LqNz1j/s1dNlGluhln9aSIB+UUaGsjgS6dSW74N7KnKt0yj9jiGtlQHw4f0\n\tDrBA==","X-Gm-Message-State":"AOAM530bbDpf1fDxmaduaFjY1oAElKTV5XOOKzuarzZ4yjHVExMizGlc\n\t42ga7dAK0P6cbAAPaqKJ+Er9Jw==","X-Google-Smtp-Source":"ABdhPJzmnEfECZvazmLA1mAxOXOptzbXjf0pP+5ZHQzmPfBiKbxeWhx9c8PmOmXD/LXul1z/saNGrQ==","X-Received":"by 2002:ac2:5d4e:: with SMTP id\n\tw14mr5870694lfd.585.1619850527571; \n\tFri, 30 Apr 2021 23:28:47 -0700 (PDT)","Date":"Sat, 1 May 2021 08:28:46 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YIz1HpHf4GDenvOc@oden.dyn.berto.se>","References":"<20210430160026.190724-1-jacopo@jmondi.org>\n\t<20210430160026.190724-7-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210430160026.190724-7-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v4 06/16] libcamera: uvc: 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=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16718,"web_url":"https://patchwork.libcamera.org/comment/16718/","msgid":"<20210501075213.vkg3dps4ftmdlrpj@uno.localdomain>","date":"2021-05-01T07:52:13","subject":"Re: [libcamera-devel] [PATCH v4 06/16] libcamera: uvc: Report\n\tsensor timestamp","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Sat, May 01, 2021 at 08:28:46AM +0200, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your patch.\n>\n> On 2021-04-30 18:00:16 +0200, Jacopo Mondi wrote:\n> > Report the sensor's timestamp in the Request metadata using the\n> > completed buffer timestamp.\n> >\n> > The UVC driver reports timestamps of SOE event through metadata, for\n> > which there is no support in the current pipeline implementation.\n> >\n> > Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 ++++\n> >  1 file changed, 4 insertions(+)\n> >\n> > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > index b6c6ade5ebaf..faa8d6b05f46 100644\n> > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > @@ -662,6 +662,10 @@ void UVCCameraData::bufferReady(FrameBuffer *buffer)\n> >  {\n> >  \tRequest *request = buffer->request();\n> >\n> > +\t/* \\todo Use the UVC metadata to calculate a more precise timestamp */\n>\n> How?\n\nMy understanding is that UVC is capable of producing metadata (no idea\nhow they're provided to uspace though) and the frame timestamp is part\nof the metadata.\n\n>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>\n> > +\trequest->metadata().set(controls::SensorTimestamp,\n> > +\t\t\t\tbuffer->metadata().timestamp);\n> > +\n> >  \tpipe_->completeBuffer(request, buffer);\n> >  \tpipe_->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\n>\n> --\n> Regards,\n> Niklas Söderlund","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 32060BDE6C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  1 May 2021 07:51:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 01AAD688CA;\n\tSat,  1 May 2021 09:51:32 +0200 (CEST)","from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 28FA4688AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  1 May 2021 09:51:31 +0200 (CEST)","from uno.localdomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id AFD4AE0002;\n\tSat,  1 May 2021 07:51:30 +0000 (UTC)"],"X-Originating-IP":"93.61.96.190","Date":"Sat, 1 May 2021 09:52:13 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20210501075213.vkg3dps4ftmdlrpj@uno.localdomain>","References":"<20210430160026.190724-1-jacopo@jmondi.org>\n\t<20210430160026.190724-7-jacopo@jmondi.org>\n\t<YIz1HpHf4GDenvOc@oden.dyn.berto.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<YIz1HpHf4GDenvOc@oden.dyn.berto.se>","Subject":"Re: [libcamera-devel] [PATCH v4 06/16] libcamera: uvc: 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=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]