{"id":16437,"url":"https://patchwork.libcamera.org/api/1.1/covers/16437/?format=json","web_url":"https://patchwork.libcamera.org/cover/16437/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220630000251.31295-1-laurent.pinchart@ideasonboard.com>","date":"2022-06-30T00:02:39","name":"[libcamera-devel,v2,00/12] gstreamer: Queue multiple requests","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/16437/mbox/","series":[{"id":3234,"url":"https://patchwork.libcamera.org/api/1.1/series/3234/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3234","date":"2022-06-30T00:02:39","name":"gstreamer: Queue multiple requests","version":2,"mbox":"https://patchwork.libcamera.org/series/3234/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/16437/comments/","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 54EBDBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Jun 2022 00:03:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7906D6563A;\n\tThu, 30 Jun 2022 02:03:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2832E6059D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Jun 2022 02:03:15 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E72459D;\n\tThu, 30 Jun 2022 02:03:14 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656547396;\n\tbh=yonNPQNM2/4igsNp+6bqM1tZ+CXM4KyZoUINzJPMXmI=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=vOprCBJ83hPygBhlJuxvFByMBlQlErQJDstPNhF/5+GsWr29JCpFX4HcpJhuv1fsI\n\tSz/PHtATScYOcW7up5VGyNEcdaRLZHXOo1uDWi3g25VuUt5wcBochnxIEb0F8vpW3C\n\tVrcVZj5QoGVzjFUYzgyA+HXksEj5CibqKJ66T+/JFwuKem9y+ZlfteQBKDyxa8qKes\n\tO/m8wIdYPOkX9AaEzlLFMTV/icLd1gN2AbdCr1647nrPemyGjKwINo3NlAzymQgXEm\n\t05hGgQkfTO3lWQ9g9gGRnZ9oxSvF+pnsDfSjumWNblHrcX+3O0fzWUtuUdP76/aGfN\n\tTdNpM7f5e3EZg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656547394;\n\tbh=yonNPQNM2/4igsNp+6bqM1tZ+CXM4KyZoUINzJPMXmI=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=RTNzzDDqYEjlpMu75ALxNeNvXenGt2oOy/zS1bB0kAgUE9lCerPKc/yEzwHgjkr00\n\t2ofNcQVqN08OSyixgZzwv0Yq3qPVT+k78wF/W7p84Sd2h3hpwVhkXBROuAY6HkPXJz\n\tpwpqW/57aFNAk3yjox2YL43/OdkzLSUjdwgSHW8A="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"RTNzzDDq\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 30 Jun 2022 03:02:39 +0300","Message-Id":"<20220630000251.31295-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 00/12] gstreamer: Queue multiple\n\trequests","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":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hello,\n\nThis patch series fixes a long-standing issue in the libcamerasrc\nelement, namely the fact that it never queues more than one request at a\ntime.\n\nMany thanks to Nicolas and Umang for reviewing v1. This version takes\nall review comments into account, save for the inverted logic in patch\n12/12 as the result didn't seem to me that it would match what Nicolas\nintended.\n\nIt took me quite a while to grasp the implementation of libcamerasrc,\nand this probably shows through the patch series. I don't claim any of\nthis is particularly great, only that it enables libcamerasrc usage with\nrkisp1 and vimc, which isn't possible today, and that it didn't\nintroduce any regression I could notice.\n\nI've also performed additional performance testing. With a sensor frame\nrate of 30fps, the libcamerasrc task runs ~80 times / second, is resumed\n~55 times / second, and paused ~26 times / second. This can most likely\nbe improved by peeking into the available buffer pools to avoid running\nthe task another time if not enough buffers are available to queue a\nrequest, but I don't know if it's worth it. In any case, I believe\nimprovements can be made incrementally.\n\nNicolas, only patches 04/12, 06/12 and 12/12 are missing a review from\nyou.  I would be very grateful for your help there.\n\nPlease see individual patches for changes compared to v1.\n\nLaurent Pinchart (12):\n  gstreamer: Use gst_task_resume() when available\n  gstreamer: Move variable to loop scope\n  gstreamer: Pass Stream to RequestWrap::addBuffer()\n  gstreamer: Move timestamp calculation out of pad loop\n  gstreamer: Rename queued requests queue to queuedRequests_\n  gstreamer: Handle completed requests in the libcamerasrc task\n  gstreamer: Combine the two pad loops in the task run handler\n  gstreamer: Use dedicated lock for request queues\n  gstreamer: Fix pads locking\n  gstreamer: Split request creation to a separate function\n  gstreamer: Split completed request processing to a separate function\n  gstreamer: Fix race conditions in task pause/resume\n\n src/gstreamer/gstlibcamera-utils.cpp |  16 +-\n src/gstreamer/gstlibcamera-utils.h   |   4 +-\n src/gstreamer/gstlibcamerapad.cpp    |  35 ---\n src/gstreamer/gstlibcamerapad.h      |   6 -\n src/gstreamer/gstlibcamerapool.cpp   |   7 -\n src/gstreamer/gstlibcamerapool.h     |   2 -\n src/gstreamer/gstlibcamerasrc.cpp    | 322 +++++++++++++++++++--------\n 7 files changed, 238 insertions(+), 154 deletions(-)\n\n\nbase-commit: 3fa79cc688b540e27f954f156b5ad4bb172ba222"}