[{"id":19851,"web_url":"https://patchwork.libcamera.org/comment/19851/","msgid":"<CAO5uPHMWiU9SH4SUEdWiQUo_ejX6snZoOqMYom6U7BfZPgaSgA@mail.gmail.com>","date":"2021-09-27T05:09:38","subject":"Re: [libcamera-devel] [PATCH 0/2] android: Wait on acquisition\n\tfences in CameraStream","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Jacopo, thank you for fixing this.\n\nOn Sat, Sep 25, 2021 at 2:01 AM Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> An acquisition fence is associated to each camera3_stream_buffer_t part of a\n> capture request.\n>\n> Streams generated by libcamera (Type::Direct) are queued to the\n> libcamera::Camera and their fences are waited on by the CameraWorker class.\n>\n> Acquisition fences for Streams generated by post-processing have been so far\n> ignored and the fence was not closed, resulting in a leak that crashed the\n> camera service with:\n>\n>  FATAL FileDescriptor file_descriptor.cpp:265 Failed to dup() fd: Too many open files\n>\n> Fix this by instrumenting CameraStream to handle fences in the process()\n> function.\n>\n> This is a temporary workaround until libcamera is not instrumented with a\n> mechanism to handle fences internally.\n>\n\nLaurent, is this what you mentioned me last week?\n\n-Hiro\n> Thanks\n>    j\n>\n> Jacopo Mondi (2):\n>   android: wait on fences in CameraStream::process()\n>   android: Post-pone fences reset in result\n>\n>  src/android/camera_device.cpp | 46 +++++++++++++++++++++++-----------\n>  src/android/camera_stream.cpp | 47 ++++++++++++++++++++++++++++++++++-\n>  src/android/camera_stream.h   |  4 ++-\n>  3 files changed, 81 insertions(+), 16 deletions(-)\n>\n> --\n> 2.32.0\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 F265BBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Sep 2021 05:09:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 54E506918E;\n\tMon, 27 Sep 2021 07:09:58 +0200 (CEST)","from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com\n\t[IPv6:2a00:1450:4864:20::52b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B009B684C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Sep 2021 07:09:49 +0200 (CEST)","by mail-ed1-x52b.google.com with SMTP id g7so4591255edv.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 26 Sep 2021 22:09:49 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"I2fpCJv0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=Z9zeChXpN9wPL5aWYi4P1bdBDp4r7HMxzKI/wk9GTO0=;\n\tb=I2fpCJv0d975alZBPxF/l/WSAdMxjar5KxWSSC0bjsZDYDYKlDwtAj3vWwEaSMOPFs\n\tTuBsZPowX4z4Q3+zGInL5421TJ4su3oKtwb9sax9eCATnucZdHHBO97slDtJPyVC9q4m\n\tSXYh+vqAphCDYrkRct77a3MLLgFdJ9tdiPT5M=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=Z9zeChXpN9wPL5aWYi4P1bdBDp4r7HMxzKI/wk9GTO0=;\n\tb=lk5elkWl4SftsOPSdBmb/i8CJsXh1DZASki7NC5kplIoUNV+AbJ6J/vcRpQ6SNW7Wc\n\tYNPTncL0UBagGyAaTUg9mSB1BgZqajYCWGcbsmqr/bNK0w45pyH+dnY3OcaBCVvxVzJy\n\tS4ZWnuVC9EZb7dw2y95iYXZXFh8fva92YIBrxTEdVU/x25VmVXk+2Dz6NTisDmge22gb\n\tvOdScjK8uD5dpTALtaxqxKEeRhL+iBq/HC7WlixGCck9uFWVyTFiewM9L9EZa+weHiNY\n\t0rFAg5KuosZDCC1kXpR9UGv1nZSOzIOmIZTYgm+JaxMoEJ1TgxRln3iq06alIIZs6yUM\n\t+CBA==","X-Gm-Message-State":"AOAM532I6FfCuqUbVBfhs3hFYLACJPAkJSmKKSo8o24lpmzGsstAQ0g3\n\tOkTkH3V024r8IoNNz7xLhi0ooi809NnxDm/ZPI/t4Q==","X-Google-Smtp-Source":"ABdhPJxQiDI04PJXNOdAZHTHXVvjk2IG1Sa8gBpcAoPxFB1T91S6XMqEsISBCo3xAx2tTMhaSx17SJAYfLKRNcsO3OY=","X-Received":"by 2002:a17:906:1109:: with SMTP id\n\th9mr12034637eja.296.1632719389165; \n\tSun, 26 Sep 2021 22:09:49 -0700 (PDT)","MIME-Version":"1.0","References":"<20210924170234.152783-1-jacopo@jmondi.org>","In-Reply-To":"<20210924170234.152783-1-jacopo@jmondi.org>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 27 Sep 2021 14:09:38 +0900","Message-ID":"<CAO5uPHMWiU9SH4SUEdWiQUo_ejX6snZoOqMYom6U7BfZPgaSgA@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 0/2] 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>","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>"}}]