[{"id":14055,"web_url":"https://patchwork.libcamera.org/comment/14055/","msgid":"<CAEmqJPqnWBrbW+LFnzwqRV+1kmvcDezZKQrA7Xigc5jnGv9-Zw@mail.gmail.com>","date":"2020-12-04T15:51:32","subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\nThank you for your patch.\n\nOn Wed, 2 Dec 2020 at 11:53, David Plowman <david.plowman@raspberrypi.com>\nwrote:\n\n> This makes it possible to tell whether we're starting the sensor for\n> the first time, or whether it's happening because of a mode switch or\n> because the camera has been paused and re-started. Depending on this,\n> some sensors may require us to drop different numbers of frames.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n> ---\n>  src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp\n> b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 69be5e4e..b8298768 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -67,7 +67,7 @@ public:\n>         IPARPi()\n>                 : lastMode_({}), controller_(), controllerInit_(false),\n>                   frameCount_(0), checkCount_(0), mistrustCount_(0),\n> -                 lsTable_(nullptr)\n> +                 lsTable_(nullptr), firstStart_(true)\n>         {\n>         }\n>\n> @@ -145,6 +145,9 @@ private:\n>         /* LS table allocation passed in from the pipeline handler. */\n>         FileDescriptor lsTableHandle_;\n>         void *lsTable_;\n> +\n> +       /* Distinguish the first camera start from others. */\n> +       bool firstStart_;\n>  };\n>\n>  int IPARPi::init(const IPASettings &settings)\n> @@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig,\n> IPAOperationData *result)\n>                 result->operation |= RPi::IPA_CONFIG_SENSOR;\n>         }\n>\n> +       firstStart_ = false;\n> +\n>         return 0;\n>  }\n>\n> --\n> 2.20.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel\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 D328ABE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  4 Dec 2020 15:51:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5F483635D6;\n\tFri,  4 Dec 2020 16:51:51 +0100 (CET)","from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6DE53635D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  4 Dec 2020 16:51:49 +0100 (CET)","by mail-lf1-x141.google.com with SMTP id s27so8269873lfp.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 04 Dec 2020 07:51:49 -0800 (PST)"],"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=\"n2ETnLDv\"; 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; bh=7Sx5r5VPtc4QopqVQ4sOXHFN32JYssuJiMrrt2hT5RE=;\n\tb=n2ETnLDv2VvV7aDWYklo7uoT3hgY7O3fCniRWH6StAXrxQMxdbw8t4Oc5yTapypuR4\n\t6uZZz1SJkRFM2TTWJSiI7u/dRuMZydTqYx4FxdQNdFeDf7yLkVojZrsVHxRwrIKgGUbd\n\t2aEtLSwRnXGa2Ayk7M/zE6SYSnpbL/DYVMT96LFWGq6FBDSCcmvkH52iM59d9rFHFFYz\n\t4+4bQ4/y6LZgg13QLDWsrEEepMhxc0Bjvdqi1Dep5ObvIYapnbtuiua99dwXezNqLEvN\n\tIkRLyFjGPU0X7d0P3CW6GdBzoX6x9ayJvEhzNWPZk8uguNmrvIAh8kyy1qd9UIZeKzT/\n\t98eQ==","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=7Sx5r5VPtc4QopqVQ4sOXHFN32JYssuJiMrrt2hT5RE=;\n\tb=qU4qsVUEw46QjgKg5+03qF7b6XVmap7Q2Nu3y+GbiubpExpFJ9/HV9FXC9iE74SgBV\n\tyC0dzdHH5hSaIMwByOMQjvq1f18AKO94XUPSJhqjRNqZQunCL+vgyRUuGRlH3PdhQKTS\n\tcpPQwEZmKVKcpdKvwW8U383+c8Tcr8TJiPSiJndyCImn4Ufi8UCcQNXho8MLZlFIgMIr\n\taFyIc4onENfKiLRPHFH/7UKkZsS4kB1YSBIhUA81+d2+9l2E19iX6bwk58N17EJqR1m5\n\t6BVRlVZcMCweg5JRbHdiGq8rfJI1vnQt94Ce4GDFyOOn1iDZMxd85GdK3CGiLzC6fpe5\n\tbhGg==","X-Gm-Message-State":"AOAM533llDlZPnU/hMZ3Q/B93x1bLeDg/repfmhz12w5ded7yHTsP1rG\n\t/aHc+i4aOO827JcUDfFufngEHrLHRSi6W3re7kCFrg==","X-Google-Smtp-Source":"ABdhPJz4x/akBbJe8ISpDT874pOBkHFQUB7jRM27IWPTYTTVXiqlooMSbzGTcPXINd7FlisK2nMasWw0/XWuir+ZfYM=","X-Received":"by 2002:ac2:53ad:: with SMTP id\n\tj13mr3603250lfh.177.1607097108853; \n\tFri, 04 Dec 2020 07:51:48 -0800 (PST)","MIME-Version":"1.0","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-2-david.plowman@raspberrypi.com>","In-Reply-To":"<20201202115253.14705-2-david.plowman@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Fri, 4 Dec 2020 15:51:32 +0000","Message-ID":"<CAEmqJPqnWBrbW+LFnzwqRV+1kmvcDezZKQrA7Xigc5jnGv9-Zw@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","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":"multipart/mixed;\n\tboundary=\"===============7424927793293502565==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":14081,"web_url":"https://patchwork.libcamera.org/comment/14081/","msgid":"<X8vmPBR48gmCcmeL@pendragon.ideasonboard.com>","date":"2020-12-05T19:57:48","subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nThank you for the patch.\n\nOn Wed, Dec 02, 2020 at 11:52:49AM +0000, David Plowman wrote:\n> This makes it possible to tell whether we're starting the sensor for\n> the first time, or whether it's happening because of a mode switch or\n> because the camera has been paused and re-started. Depending on this,\n> some sensors may require us to drop different numbers of frames.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n\nThis looks good to me, but I'd squash it with patch 2/5 as the chance is\nvery small and it's easier to review it when also seeing how the new\nvariable is used.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nOn a side note, how does mode change and initial start differ ? Don't we\nstop the sensor when reconfiguring the camera ?\n\n> ---\n>  src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 69be5e4e..b8298768 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -67,7 +67,7 @@ public:\n>  \tIPARPi()\n>  \t\t: lastMode_({}), controller_(), controllerInit_(false),\n>  \t\t  frameCount_(0), checkCount_(0), mistrustCount_(0),\n> -\t\t  lsTable_(nullptr)\n> +\t\t  lsTable_(nullptr), firstStart_(true)\n>  \t{\n>  \t}\n>  \n> @@ -145,6 +145,9 @@ private:\n>  \t/* LS table allocation passed in from the pipeline handler. */\n>  \tFileDescriptor lsTableHandle_;\n>  \tvoid *lsTable_;\n> +\n> +\t/* Distinguish the first camera start from others. */\n> +\tbool firstStart_;\n>  };\n>  \n>  int IPARPi::init(const IPASettings &settings)\n> @@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig, IPAOperationData *result)\n>  \t\tresult->operation |= RPi::IPA_CONFIG_SENSOR;\n>  \t}\n>  \n> +\tfirstStart_ = false;\n> +\n>  \treturn 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 45227BDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  5 Dec 2020 19:57:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CDDC8615AF;\n\tSat,  5 Dec 2020 20:57:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9384860327\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  5 Dec 2020 20:57:50 +0100 (CET)","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 0E95FD2F;\n\tSat,  5 Dec 2020 20:57:49 +0100 (CET)"],"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=\"iszwY9jP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1607198270;\n\tbh=rspogYFK0TZ66ssHu8vqeRKuNgGWlUvQGbgDvDXHVaY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=iszwY9jPvT+K5ZWR7fqU8ShrEG73HWxb5e/FS0O7wXi9iUBSFe8KM+oigXVQuTb5T\n\tvWi5vVgCgTdxgnhlu+h6295RAP3SP47iv0H/tf6A7WK+uCikXZLPIkoXoaAL2Q80Pq\n\tnQEWU6EYH5hAAJOoRnXkGrOqHtgbmtbdxVdS2hR0=","Date":"Sat, 5 Dec 2020 21:57:48 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<X8vmPBR48gmCcmeL@pendragon.ideasonboard.com>","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-2-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201202115253.14705-2-david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","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>"}},{"id":14086,"web_url":"https://patchwork.libcamera.org/comment/14086/","msgid":"<CAHW6GYJRVK_FXt_6d7RLGbA18y__5M17ogTHtNVfNccbpZLXhw@mail.gmail.com>","date":"2020-12-05T22:39:55","subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Laurent\n\nThanks for the review.\n\nOn Sat, 5 Dec 2020 at 19:57, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi David,\n>\n> Thank you for the patch.\n>\n> On Wed, Dec 02, 2020 at 11:52:49AM +0000, David Plowman wrote:\n> > This makes it possible to tell whether we're starting the sensor for\n> > the first time, or whether it's happening because of a mode switch or\n> > because the camera has been paused and re-started. Depending on this,\n> > some sensors may require us to drop different numbers of frames.\n> >\n> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n>\n> This looks good to me, but I'd squash it with patch 2/5 as the chance is\n> very small and it's easier to review it when also seeing how the new\n> variable is used.\n\nWill do!\n\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> On a side note, how does mode change and initial start differ ? Don't we\n> stop the sensor when reconfiguring the camera ?\n\nThe difference is that on first camera start, the algorithms are\nstarting \"from scratch\", with no idea what initial values to use. On\nsubsequent mode switches, the algorithms are known to be in a sensible\nplace and we just leave them be (we don't reset them, though the\nchange of camera mode can some some other effects).\n\nBest regards\nDavid\n\n>\n> > ---\n> >  src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++-\n> >  1 file changed, 6 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> > index 69be5e4e..b8298768 100644\n> > --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> > +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> > @@ -67,7 +67,7 @@ public:\n> >       IPARPi()\n> >               : lastMode_({}), controller_(), controllerInit_(false),\n> >                 frameCount_(0), checkCount_(0), mistrustCount_(0),\n> > -               lsTable_(nullptr)\n> > +               lsTable_(nullptr), firstStart_(true)\n> >       {\n> >       }\n> >\n> > @@ -145,6 +145,9 @@ private:\n> >       /* LS table allocation passed in from the pipeline handler. */\n> >       FileDescriptor lsTableHandle_;\n> >       void *lsTable_;\n> > +\n> > +     /* Distinguish the first camera start from others. */\n> > +     bool firstStart_;\n> >  };\n> >\n> >  int IPARPi::init(const IPASettings &settings)\n> > @@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig, IPAOperationData *result)\n> >               result->operation |= RPi::IPA_CONFIG_SENSOR;\n> >       }\n> >\n> > +     firstStart_ = false;\n> > +\n> >       return 0;\n> >  }\n> >\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 25239BDB20\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  5 Dec 2020 22:40:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 93F5D635F2;\n\tSat,  5 Dec 2020 23:40:10 +0100 (CET)","from mail-oi1-x241.google.com (mail-oi1-x241.google.com\n\t[IPv6:2607:f8b0:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 442CB60327\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  5 Dec 2020 23:40:08 +0100 (CET)","by mail-oi1-x241.google.com with SMTP id y74so10796362oia.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 05 Dec 2020 14:40:08 -0800 (PST)"],"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=\"g34TA2fa\"; 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; bh=XK0aYa6qrq0THyNfa8fryuyN2Z99mJjfvVZ2xyCTKGo=;\n\tb=g34TA2faERk14rx9606q/+zi4Uo7LsTLS2uJyM5sZcAf4WBsyZBORejQ4yetB2VyJp\n\thDCKGcuFWeQmWXN9fnXxi9Ic1TXjy8gS0XIzHl/5ddTDeg/iM6kQELAQYWH6RRBK9SYb\n\trlctuCaaKr7Hb4DB9ygQWF4K1e8o9Ds+7BO2k2dmbOzfDBe9NwQUZ8petAcFOoetfC26\n\tFG6rFB/BHPKTX2dy2x1IxlKqny2om5jetDtugST7fJM/JT1zcbn4fhY4V8hiVDr5grCC\n\tQSmhEsy3shago9KU0cAgq79TPSQRygZ7Pwve6INKCQbs0CT4AzKX3E6g7/BjjPLD6rH/\n\tUT8w==","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=XK0aYa6qrq0THyNfa8fryuyN2Z99mJjfvVZ2xyCTKGo=;\n\tb=JrMub4PLrLc5hH7ncin3r30VIzeUJxi7/mUd9QfTCOe8BZG0lcGX+Qpkcuqrd9h6wS\n\ttCROlR42cdD7XHqE0YE0v2KdTPTd2FiHAf7qhfBmKVp4DZ2tE/ATBvb88ETe+/5LsQYH\n\trWdGRn3lLkK+0ZzjQF0vZGhBT9k4vgyNUQsy6ZnlgDhiKM8R+cos9aGUUz+NWqLJf3AR\n\tzJcTfDYY+aD7/OnHHorLkEq1hn/tTmrdxuqTKpt64UKOOr56xV1gAW/Xz45d/7OfAPC7\n\tOmgQpIUgg+YTH02suAF0fMEjN3KWfN2YmEbHjd0oxL0q9lf/QbAfKIF29Jkgcupy1YYD\n\tBPiA==","X-Gm-Message-State":"AOAM531qGHZHFSQBiUHpmr77P1O+0TawdWMU3pmx9BTtw5yELoMPfi3f\n\tHs5eBy98cSYEm9YrGons+VJZCVjSgeC9sVdQKZXKmQ==","X-Google-Smtp-Source":"ABdhPJzYJM4T167iYWG2njSIx4hx4/wzmMXG8OSqnH9EMVg/msgj/buhFbsTUKye+C/4fB8lhnGLHbSNamOjCvnX2t8=","X-Received":"by 2002:aca:3c3:: with SMTP id 186mr7619832oid.22.1607208006909; \n\tSat, 05 Dec 2020 14:40:06 -0800 (PST)","MIME-Version":"1.0","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-2-david.plowman@raspberrypi.com>\n\t<X8vmPBR48gmCcmeL@pendragon.ideasonboard.com>","In-Reply-To":"<X8vmPBR48gmCcmeL@pendragon.ideasonboard.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Sat, 5 Dec 2020 22:39:55 +0000","Message-ID":"<CAHW6GYJRVK_FXt_6d7RLGbA18y__5M17ogTHtNVfNccbpZLXhw@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","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":14087,"web_url":"https://patchwork.libcamera.org/comment/14087/","msgid":"<X8wRoIZqmGjOGEX9@pendragon.ideasonboard.com>","date":"2020-12-05T23:02:56","subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nOn Sat, Dec 05, 2020 at 10:39:55PM +0000, David Plowman wrote:\n> On Sat, 5 Dec 2020 at 19:57, Laurent Pinchart wrote:\n> > On Wed, Dec 02, 2020 at 11:52:49AM +0000, David Plowman wrote:\n> > > This makes it possible to tell whether we're starting the sensor for\n> > > the first time, or whether it's happening because of a mode switch or\n> > > because the camera has been paused and re-started. Depending on this,\n> > > some sensors may require us to drop different numbers of frames.\n> > >\n> > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> >\n> > This looks good to me, but I'd squash it with patch 2/5 as the chance is\n> > very small and it's easier to review it when also seeing how the new\n> > variable is used.\n> \n> Will do!\n> \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >\n> > On a side note, how does mode change and initial start differ ? Don't we\n> > stop the sensor when reconfiguring the camera ?\n> \n> The difference is that on first camera start, the algorithms are\n> starting \"from scratch\", with no idea what initial values to use. On\n> subsequent mode switches, the algorithms are known to be in a sensible\n> place and we just leave them be (we don't reset them, though the\n> change of camera mode can some some other effects).\n\nAh yes that makes sense. What if the application stops the camera and\nrestarts it \"a long time\" later ? Would we need some kind of timeout\nafter which algorithms should drop their state (or at least consider the\nstate doesn't shorten the convergence time anymore) ?\n\n> > > ---\n> > >  src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++-\n> > >  1 file changed, 6 insertions(+), 1 deletion(-)\n> > >\n> > > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> > > index 69be5e4e..b8298768 100644\n> > > --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> > > +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> > > @@ -67,7 +67,7 @@ public:\n> > >       IPARPi()\n> > >               : lastMode_({}), controller_(), controllerInit_(false),\n> > >                 frameCount_(0), checkCount_(0), mistrustCount_(0),\n> > > -               lsTable_(nullptr)\n> > > +               lsTable_(nullptr), firstStart_(true)\n> > >       {\n> > >       }\n> > >\n> > > @@ -145,6 +145,9 @@ private:\n> > >       /* LS table allocation passed in from the pipeline handler. */\n> > >       FileDescriptor lsTableHandle_;\n> > >       void *lsTable_;\n> > > +\n> > > +     /* Distinguish the first camera start from others. */\n> > > +     bool firstStart_;\n> > >  };\n> > >\n> > >  int IPARPi::init(const IPASettings &settings)\n> > > @@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig, IPAOperationData *result)\n> > >               result->operation |= RPi::IPA_CONFIG_SENSOR;\n> > >       }\n> > >\n> > > +     firstStart_ = false;\n> > > +\n> > >       return 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 E972BBDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  5 Dec 2020 23:03:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6D223635F2;\n\tSun,  6 Dec 2020 00:03:01 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D680635D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  6 Dec 2020 00:02:59 +0100 (CET)","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 BF5E729A;\n\tSun,  6 Dec 2020 00:02:58 +0100 (CET)"],"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=\"A5fMdGjz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1607209379;\n\tbh=evsRvKRt1ToUcYK7iKlCfKd21Jurbxywljisigg5AQs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=A5fMdGjz1ZE2sWNG6nNMESGmWiSGDI+dvgJNaaTD9e324VoCtthrD8raZoLTOcTG+\n\tVcfGr7G7loKB/vdWEEEK9NO2jJO7nIfqPp0mXIpKx46E6HcihO5x3RSZgvH2AZsGo+\n\taqLziNO+NCgCwGAG5PclvPlDc1TIj35puQzJ7zws=","Date":"Sun, 6 Dec 2020 01:02:56 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<X8wRoIZqmGjOGEX9@pendragon.ideasonboard.com>","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-2-david.plowman@raspberrypi.com>\n\t<X8vmPBR48gmCcmeL@pendragon.ideasonboard.com>\n\t<CAHW6GYJRVK_FXt_6d7RLGbA18y__5M17ogTHtNVfNccbpZLXhw@mail.gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<CAHW6GYJRVK_FXt_6d7RLGbA18y__5M17ogTHtNVfNccbpZLXhw@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","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":14088,"web_url":"https://patchwork.libcamera.org/comment/14088/","msgid":"<CAHW6GYLU7SxVgMt6VuWCL8-wzv3naLK+Nf44kzMxMtD6E0iXtw@mail.gmail.com>","date":"2020-12-05T23:10:48","subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi again!\n\nOn Sat, 5 Dec 2020 at 23:03, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi David,\n>\n> On Sat, Dec 05, 2020 at 10:39:55PM +0000, David Plowman wrote:\n> > On Sat, 5 Dec 2020 at 19:57, Laurent Pinchart wrote:\n> > > On Wed, Dec 02, 2020 at 11:52:49AM +0000, David Plowman wrote:\n> > > > This makes it possible to tell whether we're starting the sensor for\n> > > > the first time, or whether it's happening because of a mode switch or\n> > > > because the camera has been paused and re-started. Depending on this,\n> > > > some sensors may require us to drop different numbers of frames.\n> > > >\n> > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > >\n> > > This looks good to me, but I'd squash it with patch 2/5 as the chance is\n> > > very small and it's easier to review it when also seeing how the new\n> > > variable is used.\n> >\n> > Will do!\n> >\n> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > >\n> > > On a side note, how does mode change and initial start differ ? Don't we\n> > > stop the sensor when reconfiguring the camera ?\n> >\n> > The difference is that on first camera start, the algorithms are\n> > starting \"from scratch\", with no idea what initial values to use. On\n> > subsequent mode switches, the algorithms are known to be in a sensible\n> > place and we just leave them be (we don't reset them, though the\n> > change of camera mode can some some other effects).\n>\n> Ah yes that makes sense. What if the application stops the camera and\n> restarts it \"a long time\" later ? Would we need some kind of timeout\n> after which algorithms should drop their state (or at least consider the\n> state doesn't shorten the convergence time anymore) ?\n\nYes, I guess that's a possibility. Though I think I'd be reluctant to\nmake the algorithms handle that themselves, probably an application\nshould know better whether this might be the situation - at which\npoint there would have to be some way to \"reset\" the camera system,\nwhich would in turn \"reset\" all the IPAs.\n\nSo maybe that's one to think about a bit. In the meantime I suppose\nclosing and re-opening the camera system is not a terrible\nworkaround...\n\nThanks!\nDavid\n\n>\n> > > > ---\n> > > >  src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++-\n> > > >  1 file changed, 6 insertions(+), 1 deletion(-)\n> > > >\n> > > > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> > > > index 69be5e4e..b8298768 100644\n> > > > --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> > > > +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> > > > @@ -67,7 +67,7 @@ public:\n> > > >       IPARPi()\n> > > >               : lastMode_({}), controller_(), controllerInit_(false),\n> > > >                 frameCount_(0), checkCount_(0), mistrustCount_(0),\n> > > > -               lsTable_(nullptr)\n> > > > +               lsTable_(nullptr), firstStart_(true)\n> > > >       {\n> > > >       }\n> > > >\n> > > > @@ -145,6 +145,9 @@ private:\n> > > >       /* LS table allocation passed in from the pipeline handler. */\n> > > >       FileDescriptor lsTableHandle_;\n> > > >       void *lsTable_;\n> > > > +\n> > > > +     /* Distinguish the first camera start from others. */\n> > > > +     bool firstStart_;\n> > > >  };\n> > > >\n> > > >  int IPARPi::init(const IPASettings &settings)\n> > > > @@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig, IPAOperationData *result)\n> > > >               result->operation |= RPi::IPA_CONFIG_SENSOR;\n> > > >       }\n> > > >\n> > > > +     firstStart_ = false;\n> > > > +\n> > > >       return 0;\n> > > >  }\n> > > >\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 CE6ABBDB20\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  5 Dec 2020 23:11:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 631CA635F2;\n\tSun,  6 Dec 2020 00:11:02 +0100 (CET)","from mail-oi1-x243.google.com (mail-oi1-x243.google.com\n\t[IPv6:2607:f8b0:4864:20::243])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 20E24635D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  6 Dec 2020 00:11:01 +0100 (CET)","by mail-oi1-x243.google.com with SMTP id y74so10852255oia.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 05 Dec 2020 15:11:01 -0800 (PST)"],"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=\"VsL18HdO\"; 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; bh=CoaOOu0fOrt5QQ26OAgnBDtM+N9HIkDS66S3zguAA9k=;\n\tb=VsL18HdOTjDdBEYMYCXk8BVDsyDtIhtK4QI/ASryX2hj7eZtGdYq3WdkFlOlcPdpqz\n\ta0eMHLXMAhlMaXOpGJbD1R+kTQivmWbnBwvWsfPuNKhmzMD314LM9OnUw/4IdOeJf648\n\tQKxDFMKt8oz7FrXBvbe3qES72zxgeVDkihhYznXN5kMiOQSBntuUzjs+O+VJCkKinjnN\n\tLprXlSvCZvT0f45c8qdznb+49G6TwXrp964uwRneGjju/zPFVPM5mTPELcfROtsQkg/9\n\taj2slzt6c4JGkBSrKZRKvM4ccZsMtzBGkj92sOtz9Nyp+S9R5Sp2t9cCmKeAq3rXZEf/\n\tzefw==","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=CoaOOu0fOrt5QQ26OAgnBDtM+N9HIkDS66S3zguAA9k=;\n\tb=c9IveU2ziq4yrDTg5J3cFG8i1KU+8Tft10pXXVMoCNpcOfxoFZQ2bHHmxG1AN/YEb3\n\tGHtjD+2Kf2Tb3F+IP3LhAyXfkJCuUvglfgW85X+udm9QwLjCAxnOG74TZek0jYPqN95p\n\tXPwVvHV9Ugecuab+HTZ+BZwPYisyo8rs8Y9voFkRgnaYH7KGQy0pH8M0zsHPleL/09JM\n\t8UK5tIR8XTbb69ndXgOJOIcyAoI1Xa4OZCIzrB7dQWKaISVJ2RPQnQ/3cj4Ls1pvRslh\n\tLcLtQBcZTxrZCtNCNCqtVA+7RxPiqHJREcC+ec3dzyMiBvAY2nMKA/sSDP1Wi6qRMdSW\n\toFxw==","X-Gm-Message-State":"AOAM530eru1rJITnJZut1RZv6mXRYO8sr5Dnc7AaeFFx56GbOKRt/Wur\n\tFdYJHh43VMrHrkSh/HBDk4gsn4+0TDFPCSNmEgASFnKOS5C5gA==","X-Google-Smtp-Source":"ABdhPJzSCbsIyjBFwFvnx16QRUtOMoPW5MSMxlvzIpV0LUzwe/hLXv1OJg74VvdM6MTU4NSXsZylBVBBdVfu7bfOl+s=","X-Received":"by 2002:aca:3c3:: with SMTP id 186mr7676133oid.22.1607209860019; \n\tSat, 05 Dec 2020 15:11:00 -0800 (PST)","MIME-Version":"1.0","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-2-david.plowman@raspberrypi.com>\n\t<X8vmPBR48gmCcmeL@pendragon.ideasonboard.com>\n\t<CAHW6GYJRVK_FXt_6d7RLGbA18y__5M17ogTHtNVfNccbpZLXhw@mail.gmail.com>\n\t<X8wRoIZqmGjOGEX9@pendragon.ideasonboard.com>","In-Reply-To":"<X8wRoIZqmGjOGEX9@pendragon.ideasonboard.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Sat, 5 Dec 2020 23:10:48 +0000","Message-ID":"<CAHW6GYLU7SxVgMt6VuWCL8-wzv3naLK+Nf44kzMxMtD6E0iXtw@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","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":14147,"web_url":"https://patchwork.libcamera.org/comment/14147/","msgid":"<X8+2/pangQKa2CVb@pendragon.ideasonboard.com>","date":"2020-12-08T17:25:18","subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nOn Sat, Dec 05, 2020 at 11:10:48PM +0000, David Plowman wrote:\n> On Sat, 5 Dec 2020 at 23:03, Laurent Pinchart wrote:\n> > On Sat, Dec 05, 2020 at 10:39:55PM +0000, David Plowman wrote:\n> > > On Sat, 5 Dec 2020 at 19:57, Laurent Pinchart wrote:\n> > > > On Wed, Dec 02, 2020 at 11:52:49AM +0000, David Plowman wrote:\n> > > > > This makes it possible to tell whether we're starting the sensor for\n> > > > > the first time, or whether it's happening because of a mode switch or\n> > > > > because the camera has been paused and re-started. Depending on this,\n> > > > > some sensors may require us to drop different numbers of frames.\n> > > > >\n> > > > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > > >\n> > > > This looks good to me, but I'd squash it with patch 2/5 as the chance is\n> > > > very small and it's easier to review it when also seeing how the new\n> > > > variable is used.\n> > >\n> > > Will do!\n> > >\n> > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > >\n> > > > On a side note, how does mode change and initial start differ ? Don't we\n> > > > stop the sensor when reconfiguring the camera ?\n> > >\n> > > The difference is that on first camera start, the algorithms are\n> > > starting \"from scratch\", with no idea what initial values to use. On\n> > > subsequent mode switches, the algorithms are known to be in a sensible\n> > > place and we just leave them be (we don't reset them, though the\n> > > change of camera mode can some some other effects).\n> >\n> > Ah yes that makes sense. What if the application stops the camera and\n> > restarts it \"a long time\" later ? Would we need some kind of timeout\n> > after which algorithms should drop their state (or at least consider the\n> > state doesn't shorten the convergence time anymore) ?\n> \n> Yes, I guess that's a possibility. Though I think I'd be reluctant to\n> make the algorithms handle that themselves, probably an application\n> should know better whether this might be the situation - at which\n> point there would have to be some way to \"reset\" the camera system,\n> which would in turn \"reset\" all the IPAs.\n\nThat's a good point. A timeout in the IPA would be fairly arbitrary,\nespecially consider the use case of stop motion capture in a controlled\nlight environment (although in that case one would probably want to set\nexposure and gains explicitly).\n\n> So maybe that's one to think about a bit. In the meantime I suppose\n> closing and re-opening the camera system is not a terrible\n> workaround...\n\nHaving to stop and restart the camera manager is a bit harsh as it will\naffect all cameras. A different API is likely needed. Let's just keep it\nin mind.\n\n> > > > > ---\n> > > > >  src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++-\n> > > > >  1 file changed, 6 insertions(+), 1 deletion(-)\n> > > > >\n> > > > > diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> > > > > index 69be5e4e..b8298768 100644\n> > > > > --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> > > > > +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> > > > > @@ -67,7 +67,7 @@ public:\n> > > > >       IPARPi()\n> > > > >               : lastMode_({}), controller_(), controllerInit_(false),\n> > > > >                 frameCount_(0), checkCount_(0), mistrustCount_(0),\n> > > > > -               lsTable_(nullptr)\n> > > > > +               lsTable_(nullptr), firstStart_(true)\n> > > > >       {\n> > > > >       }\n> > > > >\n> > > > > @@ -145,6 +145,9 @@ private:\n> > > > >       /* LS table allocation passed in from the pipeline handler. */\n> > > > >       FileDescriptor lsTableHandle_;\n> > > > >       void *lsTable_;\n> > > > > +\n> > > > > +     /* Distinguish the first camera start from others. */\n> > > > > +     bool firstStart_;\n> > > > >  };\n> > > > >\n> > > > >  int IPARPi::init(const IPASettings &settings)\n> > > > > @@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig, IPAOperationData *result)\n> > > > >               result->operation |= RPi::IPA_CONFIG_SENSOR;\n> > > > >       }\n> > > > >\n> > > > > +     firstStart_ = false;\n> > > > > +\n> > > > >       return 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 1C9E6BDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Dec 2020 17:25:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5EF1067F09;\n\tTue,  8 Dec 2020 18:25:23 +0100 (CET)","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 3C80067E4D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Dec 2020 18:25:22 +0100 (CET)","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 AA525543;\n\tTue,  8 Dec 2020 18:25:21 +0100 (CET)"],"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=\"T86lWsOA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1607448321;\n\tbh=a1BozJqQsUog3eDqGhf2X2MDjY/ZPnkIECJR2+GitGk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=T86lWsOAkIiLw8DE+/XcV9aESZzooqPGTduCexaLwo4OTmW0n3CwbqFhb1kbAM4u6\n\tbmARI/NdLj4kQurRd2sensGgisXN5AzOKT67TJyUyzFvHGfzXtGBt2YgV50IabpkR0\n\tB4sj0TT2IgCP/dYNPWtVWXBW0AmhdtoMvx6gmXO8=","Date":"Tue, 8 Dec 2020 19:25:18 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<X8+2/pangQKa2CVb@pendragon.ideasonboard.com>","References":"<20201202115253.14705-1-david.plowman@raspberrypi.com>\n\t<20201202115253.14705-2-david.plowman@raspberrypi.com>\n\t<X8vmPBR48gmCcmeL@pendragon.ideasonboard.com>\n\t<CAHW6GYJRVK_FXt_6d7RLGbA18y__5M17ogTHtNVfNccbpZLXhw@mail.gmail.com>\n\t<X8wRoIZqmGjOGEX9@pendragon.ideasonboard.com>\n\t<CAHW6GYLU7SxVgMt6VuWCL8-wzv3naLK+Nf44kzMxMtD6E0iXtw@mail.gmail.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<CAHW6GYLU7SxVgMt6VuWCL8-wzv3naLK+Nf44kzMxMtD6E0iXtw@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi:\n\tDistinguish the first camera start from others","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>"}}]