[{"id":22628,"web_url":"https://patchwork.libcamera.org/comment/22628/","msgid":"<CAEmqJPrvW-uvQGf=o56kZtRt65uH6CUWACh70X+QZnM=B3HFAg@mail.gmail.com>","date":"2022-04-06T14:53:14","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Fix\n\tuninitialised watchdogDuration_","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Umang,\n\nThank you for fixing this.  Sorry I did not spot it earlier.\n\nOn Wed, 6 Apr 2022 at 15:46, Umang Jain <umang.jain@ideasonboard.com> wrote:\n\n> Initialise the watchdogDuration_ member to 0ms before it is used\n> in rest of the code base. Failing to do so, spews out log warnings\n> regarding dequeue timer being expired.\n>\n> Fixes: 16f3d2de50ff (\"libcamera: v4l2_videodevice: Add a dequeue timer\")\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/v4l2_videodevice.cpp\n> b/src/libcamera/v4l2_videodevice.cpp\n> index 634ac4a5..8e0afffe 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -39,6 +39,8 @@\n>\n>  namespace libcamera {\n>\n> +using namespace std::literals::chrono_literals;\n> +\n>  LOG_DECLARE_CATEGORY(V4L2)\n>\n>  /**\n> @@ -520,7 +522,8 @@ const std::string V4L2DeviceFormat::toString() const\n>   */\n>  V4L2VideoDevice::V4L2VideoDevice(const std::string &deviceNode)\n>         : V4L2Device(deviceNode), formatInfo_(nullptr), cache_(nullptr),\n> -         fdBufferNotifier_(nullptr), state_(State::Stopped)\n> +         fdBufferNotifier_(nullptr), state_(State::Stopped),\n> +         watchdogDuration_(0ms)\n>  {\n>         /*\n>          * We default to an MMAP based CAPTURE video device, however this\n> will\n> --\n> 2.31.0\n>\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 7D20BC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Apr 2022 14:53:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C7CF1633A4;\n\tWed,  6 Apr 2022 16:53:32 +0200 (CEST)","from mail-lj1-x232.google.com (mail-lj1-x232.google.com\n\t[IPv6:2a00:1450:4864:20::232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22899604B8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Apr 2022 16:53:31 +0200 (CEST)","by mail-lj1-x232.google.com with SMTP id h11so3585527ljb.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 06 Apr 2022 07:53:31 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649256812;\n\tbh=b/ARl9/lbN1Wjw53z5WwEkj8Evh6VPoXXvcYyiSE0UI=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=BTJLKXI4hs26qKGc8c+PQz/Glpdl0K24P6pwat59fxC+5UMeb/TAQ3V5Kwv9zWRQv\n\tgtZbF0Z+ureb2/nNNUilcWlEackjyFnqb63UHE0wKHuE84CkJTMzkHdbJqp7a10x10\n\tlkwiShbviHdM0VJZvfIpinD4XYWHenGlZr7E51Y0BHO0WlbDl9EVpTC9f3XyiVMySo\n\tw3CrYROrggLwR/gyD+oQiXRlsmt62MNqw6+gwdvUZhAjxmAt8KNDvFsWgBn7jXn/fk\n\t4iaGtcFN/oVL5F29uAWiTgt11nhM6Rkj/AYoPPkgQSiqSfPIYcjmynoc0jKgHaknvI\n\tkUXkFhRlm+2og==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=FJfbXNl1fBwNid8sSwXVmXqU0ssqsxWMlcV7ZfIAtqg=;\n\tb=gHq01s2iPg7x57PZo1iLWYOVWwW9APNbhdii001TPA/ui+Yk5LZManBW8vBxym7F8y\n\tHsIMixHtuNtOpcyR2IRqDrFulpgTwigfOxKrDeaCflkWExbFRMShbM05sebVE4wv2JxF\n\tLsPkXyUpchSVxv+M12xeO9jce39E78HTn6NtWlr5EiZAKuhBhlU+mvhVciWTzEUrIFG3\n\tgW1Y6+Bw5E36xkbMt08sL0kLXMQP3C52SXNGwAg4HzYJh1vGBA4DbFfVPcBLv3Ym8Xkv\n\tMeH/mtq4mWeXLJcuLcVOY4TWMvaFBs9j2eEFiMJfk7WKRJJaRY9EmdpLjvyH/GU/vxzW\n\tiLkw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"gHq01s2i\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=FJfbXNl1fBwNid8sSwXVmXqU0ssqsxWMlcV7ZfIAtqg=;\n\tb=iAPd9ics1N5jIaySu36R5uZRbNdAxswUvJbd7V0/wsc8FcmNnloQYpZiVOdHyEGSui\n\tl56KZqdrWAjenr38K7yTA5JY+RCKVFFT0o4IW8m4yvQxA0IrDUrLeDcD30WSOiyBnI5+\n\tAtnE8eOQrZfliyVbuPm3QOz6UTjweyqhH18rJElHbt1InjPhSbFluyq5VfBeOcXwWU9N\n\tJUPF0dJzPLnS+Br10SlaAnRSir/eLzONf4hrTtFbnL+y7lhD0Xo+U1GagCG7TpNENlc7\n\tgUw82JWfH9KaL9Ca6asybj7S3FvRjAlCqtqNRtT0djzBletc6LLBHtGR+O1YT5m+9ccd\n\tIsRA==","X-Gm-Message-State":"AOAM533p4n6kMbJLVNW+dSnB6pxI7qikhdEW+alxM6gBXmaE9G+2aD/E\n\tqh2Nq0TPrHWp4iV8yAgD2ZMtav+Q8y1M0jh7kBRd5x99NVs=","X-Google-Smtp-Source":"ABdhPJxeojhLm5fxfhFjmgyyCNKca9z1YykYFU8aoHCZMMaAdqvs5I9w7kqDtB+63D1fHHZJ/6HnsDrHjmQoJ3s8rd0=","X-Received":"by 2002:a2e:b054:0:b0:24b:108d:3792 with SMTP id\n\td20-20020a2eb054000000b0024b108d3792mr5550407ljl.444.1649256810403;\n\tWed, 06 Apr 2022 07:53:30 -0700 (PDT)","MIME-Version":"1.0","References":"<20220406144553.193858-1-umang.jain@ideasonboard.com>","In-Reply-To":"<20220406144553.193858-1-umang.jain@ideasonboard.com>","Date":"Wed, 6 Apr 2022 15:53:14 +0100","Message-ID":"<CAEmqJPrvW-uvQGf=o56kZtRt65uH6CUWACh70X+QZnM=B3HFAg@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"00000000000053e98405dbfd86f0\"","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Fix\n\tuninitialised watchdogDuration_","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22629,"web_url":"https://patchwork.libcamera.org/comment/22629/","msgid":"<Yk2tG0c5JOHD/pvB@pendragon.ideasonboard.com>","date":"2022-04-06T15:09:15","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Fix\n\tuninitialised watchdogDuration_","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nThank you for the patch.\n\nOn Wed, Apr 06, 2022 at 08:15:53PM +0530, Umang Jain wrote:\n> Initialise the watchdogDuration_ member to 0ms before it is used\n> in rest of the code base. Failing to do so, spews out log warnings\n> regarding dequeue timer being expired.\n> \n> Fixes: 16f3d2de50ff (\"libcamera: v4l2_videodevice: Add a dequeue timer\")\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 634ac4a5..8e0afffe 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -39,6 +39,8 @@\n>  \n>  namespace libcamera {\n>  \n> +using namespace std::literals::chrono_literals;\n> +\n>  LOG_DECLARE_CATEGORY(V4L2)\n>  \n>  /**\n> @@ -520,7 +522,8 @@ const std::string V4L2DeviceFormat::toString() const\n>   */\n>  V4L2VideoDevice::V4L2VideoDevice(const std::string &deviceNode)\n>  \t: V4L2Device(deviceNode), formatInfo_(nullptr), cache_(nullptr),\n> -\t  fdBufferNotifier_(nullptr), state_(State::Stopped)\n> +\t  fdBufferNotifier_(nullptr), state_(State::Stopped),\n> +\t  watchdogDuration_(0ms)\n\nThe duration is expressed in nanoseconds internally, but thanks to\nchrono types, that doesn't matter :-)\n\nI would write\n\n\twatchdogDuration_(0.0)\n\nbut that's not possible as the utils::Duration class is missing an\nappropriate constructor. I'll fix this in a separate patch, but for\nthis,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  {\n>  \t/*\n>  \t * We default to an MMAP based CAPTURE video device, however this will","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 2C2E0C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Apr 2022 15:09:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5F01165642;\n\tWed,  6 Apr 2022 17:09:21 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D6C9604B8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 Apr 2022 17:09:20 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A1AF482;\n\tWed,  6 Apr 2022 17:09:20 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649257761;\n\tbh=rI9w4UBvtTQlfvG5iltmpL93sMUtWBoVM+tCwT0O/Do=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=J+DAD+/X/53GdGs7J9y+XWzQAJ7oBaOMDf19OeyNAu+5hOF52FiI3e22YwmO1OeXw\n\tyApDRbgGOwhi2duzPSEz12K0svYyxhFJNaFxusf+QBM+rqBhG1vZnBRfMvj10LWTOS\n\tPksbnt+zaIzAFYD0lHFYcaz9Sk3TXv2LVHPh6BAiRQIk9H948xN6V7hfmmQtNmyhbH\n\t6YRwafP5LC3G4KiLO9E/YBlo99pOvqihZC7+WJ1trFMl/KdTML8GhVhiwWi0jO5dhU\n\tibeqchsriNtcgjmp9onTU3W/zW/EdVQvcN3OuHadqW6v5ttd6ZI/XPTe696BV2mJjj\n\trsXy3UdAnDDCg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649257760;\n\tbh=rI9w4UBvtTQlfvG5iltmpL93sMUtWBoVM+tCwT0O/Do=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=k9nopx0flmGKp7omYHCJF7cOh3hMPUTK3tSTAGkqpC2vlaaOXYmpolWjF4Vn8XzKL\n\tZE9IkViTo9DHbCmL4ZrdGgoSoImRKVa2N7rsqpxt9i+7QvHk5v3hNHyemsYCgBE94g\n\tKQ68xG76NoD+vhzSu+AsIHSfRS0mFTyuRSfpf2NY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"k9nopx0f\"; dkim-atps=neutral","Date":"Wed, 6 Apr 2022 18:09:15 +0300","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<Yk2tG0c5JOHD/pvB@pendragon.ideasonboard.com>","References":"<20220406144553.193858-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220406144553.193858-1-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Fix\n\tuninitialised watchdogDuration_","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]