[{"id":22910,"web_url":"https://patchwork.libcamera.org/comment/22910/","msgid":"<YnkYDLBB0KtRNC7A@pendragon.ideasonboard.com>","date":"2022-05-09T13:33:00","subject":"Re: [libcamera-devel] [PATCH 0/3] Sequence Observer","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Fri, Apr 29, 2022 at 09:34:31PM +0200, Kieran Bingham via libcamera-devel wrote:\n> This fell out of some more work I did in the past catching and detecting\n> frame drops in streams. While the method of reporting this event to\n> userspace is debated, this pulls out some core functionality and wraps\n> some generic code into a Sequence Observer to provide an easy to use\n> check on any monotonic sequence.\n> \n> For now - it simply reports a warning if a V4L2 device detects a frame\n> drop, which is more notification that we have currently... as we are\n> silently dropping frames at the moment.\n\nEven if we haven't finalized the way to handle frame drops in the\napplication-facing API, I think it's useful to be able to be notified of\nframe drops already. I'm however thinking that the sequence observer\nclass is a bit overkill at this point. I'd recommend starting with an\nad-hoc solution in V4L2VideoDevice only, and later extend it if\nrequired.\n\n> Kieran Bingham (3):\n>   libcamera: Add sequence value observer\n>   test: Add Sequence observer tests\n>   libcamera: v4l2: Detect frame drops on V4L2VideoDevice\n> \n>  include/libcamera/internal/v4l2_videodevice.h |  2 +\n>  include/libcamera/meson.build                 |  1 +\n>  include/libcamera/sequence.h                  | 20 +++++\n>  src/libcamera/meson.build                     |  1 +\n>  src/libcamera/sequence.cpp                    | 66 +++++++++++++++\n>  src/libcamera/v4l2_videodevice.cpp            | 10 +++\n>  test/meson.build                              |  1 +\n>  test/sequence.cpp                             | 80 +++++++++++++++++++\n>  8 files changed, 181 insertions(+)\n>  create mode 100644 include/libcamera/sequence.h\n>  create mode 100644 src/libcamera/sequence.cpp\n>  create mode 100644 test/sequence.cpp","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 DCF04C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 May 2022 13:33:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1B87F65646;\n\tMon,  9 May 2022 15:33:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 165EE604A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 May 2022 15:33:05 +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 7BB4555A;\n\tMon,  9 May 2022 15:33:04 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652103186;\n\tbh=pFaJA0lMtrjOnarbKp2niV83tDF6KOkgvoERhB3AM/s=;\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=ywy5JNyn+bgGXPEaOxnvxxcpPhDDo+YN3rHDn6S837EP2IJINhFKRoesDYCTUesbO\n\tp7IqtohcA0xR4d/kuTWMcM/RIzX9XnKYE3ZP6CjVGvk0UW0MSNEXjJv7//p7EEAkgj\n\tk3FNky2PfDK/Aq4BCexiS3crvbEDox+DU2jPKob+pA0OTOfqka+Qr0nBLOAptejD2m\n\twMkzUk4fewDsZigjOpxitoTNkKS/RSYl8CLBDUgTcgBUSQ/9MWuyvPsNyPiJYf5xWM\n\tAeXYfF2UCKY2Wk76hTIfpUlegtdEsAU3l4UKI7wsnRA4EL+5tiX+q/kN2eUs2jVVm2\n\trWgtdvUIuSyzw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652103184;\n\tbh=pFaJA0lMtrjOnarbKp2niV83tDF6KOkgvoERhB3AM/s=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gujdm2p+PkM73sybJL28aN/gn3NrU7mA5KY9p8iwYUMjDrQuSXbSAjLr+O+nzXWkb\n\t0y+BhvkT8Cng3B6Xvhy8ieo35P6o1q9zreER4XgjcKcLvyyiC2zuNdBcA8tCw7b8Lh\n\tama5Tasa61QnD68ocblHLLU/mpIfi3BeHnUASNqk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"gujdm2p+\"; dkim-atps=neutral","Date":"Mon, 9 May 2022 16:33:00 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YnkYDLBB0KtRNC7A@pendragon.ideasonboard.com>","References":"<20220429193434.167990-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220429193434.167990-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 0/3] Sequence Observer","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22914,"web_url":"https://patchwork.libcamera.org/comment/22914/","msgid":"<165212871610.2416244.4757914782034852252@Monstersaurus>","date":"2022-05-09T20:38:36","subject":"Re: [libcamera-devel] [PATCH 0/3] Sequence Observer","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2022-05-09 14:33:00)\n> Hi Kieran,\n> \n> On Fri, Apr 29, 2022 at 09:34:31PM +0200, Kieran Bingham via libcamera-devel wrote:\n> > This fell out of some more work I did in the past catching and detecting\n> > frame drops in streams. While the method of reporting this event to\n> > userspace is debated, this pulls out some core functionality and wraps\n> > some generic code into a Sequence Observer to provide an easy to use\n> > check on any monotonic sequence.\n> > \n> > For now - it simply reports a warning if a V4L2 device detects a frame\n> > drop, which is more notification that we have currently... as we are\n> > silently dropping frames at the moment.\n> \n> Even if we haven't finalized the way to handle frame drops in the\n> application-facing API, I think it's useful to be able to be notified of\n> frame drops already. I'm however thinking that the sequence observer\n> class is a bit overkill at this point. I'd recommend starting with an\n> ad-hoc solution in V4L2VideoDevice only, and later extend it if\n> required.\n\nOf course this did start of as an ad-hoc solution in V4L2VideoDevice and\nthen became the observer because I had the same snippets of\nfunctionality in 4 different places. (But I think you don't like those\neither so ... we'll find out later).\n\nBut anyway, that's why I split this out as I thought it was a helpful\n... helper.\n\nAs it happens, I need to put more thought and consideration into this\nanyway, as a warning print really is too noisy anyway - so I don't think\nit can even suffice as a starting point to print a warning (Perhaps a\nDebug though)\n\n(I am partialy concerned that we can have so many frame drops that a\nwarning print can be too noisy, but I think that it probably would be\nexpected behaviour in some scenarios, even if we weren't using\nlibcamera).\n\n> \n> > Kieran Bingham (3):\n> >   libcamera: Add sequence value observer\n> >   test: Add Sequence observer tests\n> >   libcamera: v4l2: Detect frame drops on V4L2VideoDevice\n> > \n> >  include/libcamera/internal/v4l2_videodevice.h |  2 +\n> >  include/libcamera/meson.build                 |  1 +\n> >  include/libcamera/sequence.h                  | 20 +++++\n> >  src/libcamera/meson.build                     |  1 +\n> >  src/libcamera/sequence.cpp                    | 66 +++++++++++++++\n> >  src/libcamera/v4l2_videodevice.cpp            | 10 +++\n> >  test/meson.build                              |  1 +\n> >  test/sequence.cpp                             | 80 +++++++++++++++++++\n> >  8 files changed, 181 insertions(+)\n> >  create mode 100644 include/libcamera/sequence.h\n> >  create mode 100644 src/libcamera/sequence.cpp\n> >  create mode 100644 test/sequence.cpp\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 32CC4C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 May 2022 20:38:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6368565641;\n\tMon,  9 May 2022 22:38:40 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D54CC604A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 May 2022 22:38:38 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 53367A1C;\n\tMon,  9 May 2022 22:38:38 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652128720;\n\tbh=KmuoxL71eEXd4n/oN7hSiU6ZgbldGbsObKiDfsUmc/k=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=zJy/SKrJJq0X+bUDk90Cwxk4SE7eKbjjmerpsClcxUBaJiKfaqD1IBS9odFNjtmBI\n\tjxXCRbbFPL5wr3n3pEEqryPLXgbjQA4huLtguwMOxm3/lO408FBGauHoreFenw14eW\n\toIcNnxXy6nvSSMHJ2cDT2I9GBU1zoWCAq2SdE+tMEPXcvcc76tkxGeO14siIM9Czpn\n\taj3Nb3IpqKaiJA4nwYhnvnO34MrJtwM1FSntEmVlt6uYhT0raAI87KWiC7fN5bof6j\n\tj9qbhTbRVjF2MUqedPTWnWiTSSuc271EW02GiN6RKee0rT7rOBDzZWS8sBdZqt/zrN\n\tgbqI1qpYJPVUw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652128718;\n\tbh=KmuoxL71eEXd4n/oN7hSiU6ZgbldGbsObKiDfsUmc/k=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=rRxDY6Yr5A+XAxFr4aHfqLCCev2CmQZBR8cSHnSR/4U6oNhbCT408uZsPcC2X9Hi5\n\tpkPRBEgjVNXutm6M3SZFvIb2Vpmk6fIsDlUqhgK1rTS80baPG0Eh6ao/wOfM0AuKGa\n\trcpzssOSHgROHe5MXXz1s4WoiGpqjsDUD0uq27vQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rRxDY6Yr\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YnkYDLBB0KtRNC7A@pendragon.ideasonboard.com>","References":"<20220429193434.167990-1-kieran.bingham@ideasonboard.com>\n\t<YnkYDLBB0KtRNC7A@pendragon.ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Mon, 09 May 2022 21:38:36 +0100","Message-ID":"<165212871610.2416244.4757914782034852252@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 0/3] Sequence Observer","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.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>"}}]