[{"id":11362,"web_url":"https://patchwork.libcamera.org/comment/11362/","msgid":"<20200713113954.GE2866302@oden.dyn.berto.se>","date":"2020-07-13T11:39:54","subject":"Re: [libcamera-devel] [PATCH 3/9] libcamera: pipeline: raspberrypi:\n\tAdd some debug logging","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Naushir,\n\nThanks for your work.\n\nOn 2020-07-13 09:47:22 +0100, Naushir Patuck wrote:\n> No functional changes, only added some more trace points.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++++++++-\n>  1 file changed, 8 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 8b6f578f..65c8557d 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1175,6 +1175,11 @@ void RPiCameraData::ispInputDequeue(FrameBuffer *buffer)\n>  \tif (state_ == State::Stopped)\n>  \t\treturn;\n>  \n> +\tLOG(RPI, Debug) << \"Stream ISP Input buffer complete\"\n> +\t\t\t<< \", buffer id \" << buffer->cookie()\n\nThis worries me a bit. For buffers coming from the application the \ncookie is controlled by the application. This means that pipeline \nhandlers can't set the cookie for any buffer it receives in a Request.  \nMaybe we need to create something in libcamera core to allow \npipelines/IPA to have an internal cookie value for buffers?\n\nOr maybe I'm misunderstanding the code and cookies are only used for \nbuffers that are not seen by the applications at all (such as ISP \nstatistics and parameters)?\n\n> +\t\t\t<< \", timestamp: \" << buffer->metadata().timestamp;\n> +\n> +\t/* The ISP input buffer gets re-queued into Unicam. */\n>  \thandleStreamBuffer(buffer, &unicam_[Unicam::Image]);\n>  \thandleState();\n>  }\n> @@ -1339,6 +1344,8 @@ void RPiCameraData::checkRequestCompleted()\n>  \t\tpipe_->completeRequest(camera_, request);\n>  \t\trequestQueue_.pop_front();\n>  \t\trequestCompleted = true;\n> +\n> +\t\tLOG(RPI, Debug) << \"Request is complete\";\n>  \t}\n>  \n>  \t/*\n> @@ -1477,7 +1484,7 @@ FrameBuffer *RPiCameraData::updateQueue(std::queue<FrameBuffer *> &q, uint64_t t\n>  \t\tif (b->metadata().timestamp < timestamp) {\n>  \t\t\tq.pop();\n>  \t\t\tdev->queueBuffer(b);\n> -\t\t\tLOG(RPI, Error) << \"Dropping input frame!\";\n> +\t\t\tLOG(RPI, Warning) << \"Dropping input frame!\";\n>  \t\t} else if (b->metadata().timestamp == timestamp) {\n>  \t\t\t/* The calling function will pop the item from the queue. */\n>  \t\t\treturn b;\n> -- \n> 2.25.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 9826BBD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jul 2020 11:39:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 24FAC605C5;\n\tMon, 13 Jul 2020 13:39:57 +0200 (CEST)","from mail-lf1-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 258DD603A6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jul 2020 13:39:56 +0200 (CEST)","by mail-lf1-x144.google.com with SMTP id g139so8780562lfd.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jul 2020 04:39:56 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tq128sm4051311ljb.140.2020.07.13.04.39.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 13 Jul 2020 04:39:54 -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=\"KBaf4j4A\"; 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=ERynoyXxLMfUMhZL7d9ep1VK9eBPZuYqpVDhX9UWYEQ=;\n\tb=KBaf4j4As0FWvcZRdJCWHZOh9grMDfMaqb6UXZUHPWrpanhyY4kFC+yRNVkkZDnYjg\n\tGtyW/97MEXJ3vg0xnu4InJrGecMe2CwgflDKvw2Nv2A41ITv3KGjy5H7tg9zstU4sTGu\n\tiMD24E4g1yE+t195oErQYuG/b/lQ9PpsqNdff20wzGtxoUu+q+/zRX27BcZ6+fTobU6G\n\tKNH5zqoQCiS1/C9p/mvfziswo5i9Oi8Rx6dSd6mV8fi4+Rwa2GYwGAd3r43Lx2R/KHa9\n\tfOP6DEm5mNQ1jo/Gx+Pzt1JnI6rpbGR5EYxVvwtnZ2WjmVEyArzF/XxW2WAl9pKB2Loi\n\tHkLA==","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=ERynoyXxLMfUMhZL7d9ep1VK9eBPZuYqpVDhX9UWYEQ=;\n\tb=QaG4j9pXds1xBeq1Cc3XJZEPUrcbXUu/vOtcMXMYfdArdDSkK4OQO1+K5QFUJ+Hajx\n\t4q/H0RYlqT6JqjUj4pGq1aRP+3nKiVRxPfBgck3L5cbZRBblCajkXWLNPIvBu05NziPi\n\t1yPKjpXlhfiaM9PlZ4l/8Cpqu7IYnIa9iLJszMZeoJYkzqtSAI0Vu9/GvD+/6u9Ea7Pw\n\tHEJfSTOnqv6auB6pcV5RSrNsp6RFKYtPU2eeDczASjk4OvXLLYZ6v3EG1ZmmsL945qCN\n\taAWAoRi4eUi1WgTKhy2YC632Aa+S96UJsbNTa8qQZzNR8eGJQaqxwvTNOU6/M/cCsaFx\n\tUrAg==","X-Gm-Message-State":"AOAM531kkYZRnEAQEIQB5qVlwPq2weoAWOVAPTd1whtv3+aVG08sOfmB\n\tznr2n0VcnjVjxH0CGahEZpPiOQ==","X-Google-Smtp-Source":"ABdhPJyiTJCAhOLihTabX+anFYmqiY1fjIPTB4gvuUt+sfKi76Y/g1yGFceZFbSF4k6bbpUBuAKRsA==","X-Received":"by 2002:a19:7014:: with SMTP id\n\th20mr51246933lfc.49.1594640395497; \n\tMon, 13 Jul 2020 04:39:55 -0700 (PDT)","Date":"Mon, 13 Jul 2020 13:39:54 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20200713113954.GE2866302@oden.dyn.berto.se>","References":"<20200713084727.232422-1-naush@raspberrypi.com>\n\t<20200713084727.232422-4-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200713084727.232422-4-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 3/9] libcamera: pipeline: raspberrypi:\n\tAdd some debug logging","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":11370,"web_url":"https://patchwork.libcamera.org/comment/11370/","msgid":"<CAEmqJPotqxEfx_sn5d_4wRqPEaVGbw4-TXnLL4KJ7b3_YsYLiw@mail.gmail.com>","date":"2020-07-13T13:05:08","subject":"Re: [libcamera-devel] [PATCH 3/9] libcamera: pipeline: raspberrypi:\n\tAdd some debug logging","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Niklas,\n\n\nOn Mon, 13 Jul 2020 at 12:39, Niklas Söderlund\n<niklas.soderlund@ragnatech.se> wrote:\n>\n> Hi Naushir,\n>\n> Thanks for your work.\n>\n> On 2020-07-13 09:47:22 +0100, Naushir Patuck wrote:\n> > No functional changes, only added some more trace points.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++++++++-\n> >  1 file changed, 8 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > index 8b6f578f..65c8557d 100644\n> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> > @@ -1175,6 +1175,11 @@ void RPiCameraData::ispInputDequeue(FrameBuffer *buffer)\n> >       if (state_ == State::Stopped)\n> >               return;\n> >\n> > +     LOG(RPI, Debug) << \"Stream ISP Input buffer complete\"\n> > +                     << \", buffer id \" << buffer->cookie()\n>\n> This worries me a bit. For buffers coming from the application the\n> cookie is controlled by the application. This means that pipeline\n> handlers can't set the cookie for any buffer it receives in a Request.\n> Maybe we need to create something in libcamera core to allow\n> pipelines/IPA to have an internal cookie value for buffers?\n>\n\nActually I did not realise that the application was meant to use the\ncookie.  I thought it was a pipeline handler thing to identify\nbuffers.\n\n> Or maybe I'm misunderstanding the code and cookies are only used for\n> buffers that are not seen by the applications at all (such as ISP\n> statistics and parameters)?\n\nThis is correct, it was only used for internal buffers, but I relied\non it for this change as well.  This is not a problem, I use it\ncurrently to identify buffers passed to/from the IPA, and I can use a\nsimple linear index to do the same.\n\n>\n> > +                     << \", timestamp: \" << buffer->metadata().timestamp;\n> > +\n> > +     /* The ISP input buffer gets re-queued into Unicam. */\n> >       handleStreamBuffer(buffer, &unicam_[Unicam::Image]);\n> >       handleState();\n> >  }\n> > @@ -1339,6 +1344,8 @@ void RPiCameraData::checkRequestCompleted()\n> >               pipe_->completeRequest(camera_, request);\n> >               requestQueue_.pop_front();\n> >               requestCompleted = true;\n> > +\n> > +             LOG(RPI, Debug) << \"Request is complete\";\n> >       }\n> >\n> >       /*\n> > @@ -1477,7 +1484,7 @@ FrameBuffer *RPiCameraData::updateQueue(std::queue<FrameBuffer *> &q, uint64_t t\n> >               if (b->metadata().timestamp < timestamp) {\n> >                       q.pop();\n> >                       dev->queueBuffer(b);\n> > -                     LOG(RPI, Error) << \"Dropping input frame!\";\n> > +                     LOG(RPI, Warning) << \"Dropping input frame!\";\n> >               } else if (b->metadata().timestamp == timestamp) {\n> >                       /* The calling function will pop the item from the queue. */\n> >                       return b;\n> > --\n> > 2.25.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\n\nRegards,\nNaush","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 2F77ABD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jul 2020 13:05:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B32076057E;\n\tMon, 13 Jul 2020 15:05:27 +0200 (CEST)","from mail-lj1-x244.google.com (mail-lj1-x244.google.com\n\t[IPv6:2a00:1450:4864:20::244])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F337F6057E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jul 2020 15:05:25 +0200 (CEST)","by mail-lj1-x244.google.com with SMTP id e8so17720214ljb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jul 2020 06:05:25 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"NbG8Wzb4\"; dkim-atps=neutral","DKIM-Signature":"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:content-transfer-encoding;\n\tbh=U5oWoiBIbcQdFV0+dudhUVNwKEAadxqJEKuyLTXqOWk=;\n\tb=NbG8Wzb4gDt1zdf+tePQEeAam79EvnQqnNJrpa2opsnm7+hyVYzYWCaJ76fKLAw+VD\n\t2SUwLLxDvb3Ad37JRFr1Av5aSKmzFIhD+auQPR3g1GJTBw66a02KwCjWcbfW2x99R/YH\n\tH+oym/s0N4HBQ1A8cjNmu6yQUAF7AggIxQ+2jxkNEwYV/z7zcJi2wBHXaB3lzWanH0bP\n\trFeGpW4IaCzYGs6fpQwFf0VkjGyxUxoTNePOxikDAH+raG1I8f3GQKuJl7EPBXsJpn18\n\t1w8m0Coq2XJ9FsLLnXJsKJD2IDj/WdGcqY+4Etzb+i6yI6WAN1j3REW4U8IvZJs23V9/\n\tUNmw==","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:content-transfer-encoding;\n\tbh=U5oWoiBIbcQdFV0+dudhUVNwKEAadxqJEKuyLTXqOWk=;\n\tb=W7Qu1Pp31ThZsX+jLbO3j1vHVe/g8qErUIxjROQg/yoE8xQ70ll33XVW2rMG+Ra5pd\n\th5wkMObyeuTimUVPEpuIzK4IEsWNK5tqc2GXfiXYLCwRBWppIZ9bzsEF+a8N0WDiJ1qf\n\t9lB6ruIvR4O+juipIRGH+1tCUwId8WFiTU2ehmDgPmWqyaZXk/XEnyxTTGYUhVocqJ8O\n\tns93Z57qLf4vFKlmPVc47kGeKLQ/GGjhicLrkjVrkdKFCCzBlHxWAoOPGYcsfJzPl8Yu\n\tPnomNCv5xFOzKDq6CCh3Kym7HTCe5OWfcvJ1u94xADhHVMQvB6d4p1Z3SBDnFMMC88gs\n\tHN9Q==","X-Gm-Message-State":"AOAM531IbW4lWDMaOMu6DW50BdVvYK+bP2lqtqJxKTNlp+QbuUXEKmbu\n\t2JR5zuzWz/HMFKJe6s8WTyisyWqeec7kFMJwUCV3LkqznKk=","X-Google-Smtp-Source":"ABdhPJx4LfEfJ46bD8FTjH4/3XcyONmBjXht7FMXpQZRsbXxd9vOu/3EZUiuaxzH5VI6DRxDWyCqg4Y/agepX8dewsU=","X-Received":"by 2002:a2e:a30f:: with SMTP id\n\tl15mr48948820lje.228.1594645524565; \n\tMon, 13 Jul 2020 06:05:24 -0700 (PDT)","MIME-Version":"1.0","References":"<20200713084727.232422-1-naush@raspberrypi.com>\n\t<20200713084727.232422-4-naush@raspberrypi.com>\n\t<20200713113954.GE2866302@oden.dyn.berto.se>","In-Reply-To":"<20200713113954.GE2866302@oden.dyn.berto.se>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 13 Jul 2020 14:05:08 +0100","Message-ID":"<CAEmqJPotqxEfx_sn5d_4wRqPEaVGbw4-TXnLL4KJ7b3_YsYLiw@mail.gmail.com>","To":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH 3/9] libcamera: pipeline: raspberrypi:\n\tAdd some debug logging","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>"}}]