{"id":13965,"url":"https://patchwork.libcamera.org/api/1.1/covers/13965/?format=json","web_url":"https://patchwork.libcamera.org/cover/13965/","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":"<20210928122515.28034-1-jacopo@jmondi.org>","date":"2021-09-28T12:25:14","name":"[libcamera-devel,v3,0/1] android: Wait on acquisition fences in CameraStream","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/cover/13965/mbox/","series":[{"id":2580,"url":"https://patchwork.libcamera.org/api/1.1/series/2580/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2580","date":"2021-09-28T12:25:14","name":"android: Wait on acquisition fences in CameraStream","version":3,"mbox":"https://patchwork.libcamera.org/series/2580/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/13965/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 0A8E4C3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Sep 2021 12:24:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4BEA76918D;\n\tTue, 28 Sep 2021 14:24:34 +0200 (CEST)","from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2149469185\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Sep 2021 14:24:33 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id A82D6200013;\n\tTue, 28 Sep 2021 12:24:32 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 28 Sep 2021 14:25:14 +0200","Message-Id":"<20210928122515.28034-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.32.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 0/1] android: Wait on acquisition\n\tfences in CameraStream","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"An acquisition fence is associated to each camera3_stream_buffer_t part of a\ncapture request.\n\nStreams generated by libcamera (Type::Direct) are queued to the\nlibcamera::Camera and their fences are waited on by the CameraWorker class.\n\nAcquisition fences for Streams generated by post-processing have been so far\nignored and the fence was not closed, resulting in a leak that crashed the\ncamera service with:\n\n FATAL FileDescriptor file_descriptor.cpp:265 Failed to dup() fd: Too many open files\n\nFix this by instrumenting CameraStream to handle fences in the process()\nfunction.\n\nv3:\n- Squash the two patches in one\n- Set acquire_fence = -1 in post-processor\n- Correct handling of buffer status in CameraDevice::requestCompleted()\n\nv2:\n- Handle ::Internal stream type and shuffle the patch order as suggested by\n  Hiro.\n\nJacopo Mondi (1):\n  android: Wait on fences in CameraStream::process()\n\n src/android/camera_device.cpp | 39 +++++++++++++++++++++++----\n src/android/camera_stream.cpp | 50 +++++++++++++++++++++++++++++++++--\n src/android/camera_stream.h   |  4 ++-\n 3 files changed, 85 insertions(+), 8 deletions(-)\n\n--\n2.32.0"}