Patch Detail
Show a patch.
GET /api/patches/10334/?format=api
{ "id": 10334, "url": "https://patchwork.libcamera.org/api/patches/10334/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10334/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20201104082719.25190-1-laurent.pinchart@ideasonboard.com>", "date": "2020-11-04T08:27:19", "name": "[libcamera-devel] gstreamer: libcamerasrc: Delete configuration before stopping camera manager", "commit_ref": "fa63d428aef62bacf0a6ad1622a7965b3ff2ba2f", "pull_url": null, "state": "accepted", "archived": false, "hash": "7871bd2598f55985710ca7a8212006fc955c4cf7", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/10334/mbox/", "series": [ { "id": 1444, "url": "https://patchwork.libcamera.org/api/series/1444/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1444", "date": "2020-11-04T08:27:19", "name": "[libcamera-devel] gstreamer: libcamerasrc: Delete configuration before stopping camera manager", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1444/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10334/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10334/checks/", "tags": {}, "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 12A31BDB89\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 4 Nov 2020 08:28:13 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9D8E660346;\n\tWed, 4 Nov 2020 09:28:12 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EC68760344\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 4 Nov 2020 09:28:10 +0100 (CET)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4D1D2563;\n\tWed, 4 Nov 2020 09:28:10 +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=\"JdDBFyuy\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1604478490;\n\tbh=HerGvADrPRahOums1qspvtzop0yYXU9NmbgNVUlQrPM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=JdDBFyuyfh3YocYuq1FGVDzWd5srBf+6mfr57+7vnLxgVZNjFk2y+K8iP+LW6VUcJ\n\ta5CayRH4lINlSbis6qaGg14WdNz+hUaHRuAOkQwhDRHsnOGkfpgbdH6Vx5/mCHWV8D\n\tl+bmrT3LrTqmwFZSOxnVyWZuhL3rjHC3XoYhcV0E=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 4 Nov 2020 10:27:19 +0200", "Message-Id": "<20201104082719.25190-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH] gstreamer: libcamerasrc: Delete\n\tconfiguration before stopping camera manager", "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": "Nicolas Dufresne <nicolas.dufresne@collabora.com>", "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>" }, "content": "When closing the libcamerasrc, the reference to camera is released and\nthe camera manager is stopped. However, the camera configuration still\nexists at that point, and holds a reference to the camera. This leads to\na warning from the device enumerator complaining that the media devices\nare still in use:\n\n[1:53:48.792327560] [408] ERROR DeviceEnumerator device_enumerator.cpp:165 Removing media device /dev/media1 while still in use\n[1:53:48.792354022] [408] ERROR DeviceEnumerator device_enumerator.cpp:165 Removing media device /dev/media0 while still in use\n\nA crash follows when the libcamerasrc is finalized, as deleting the\ncamera configuration will then release the last reference to the camera,\nwhich attempts to delete the camera object with deleteLater() without an\nevent dispatcher.\n\nFix it by deleting the camera configuration before stopping the camera\nmanager.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/gstreamer/gstlibcamerasrc.cpp | 2 ++\n 1 file changed, 2 insertions(+)", "diff": "diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex a099508c122a..636c14dff64e 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -499,6 +499,8 @@ gst_libcamera_src_close(GstLibcameraSrc *self)\n \n \tGST_DEBUG_OBJECT(self, \"Releasing resources\");\n \n+\tstate->config_.reset();\n+\n \tret = state->cam_->release();\n \tif (ret) {\n \t\tGST_ELEMENT_WARNING(self, RESOURCE, BUSY,\n", "prefixes": [ "libcamera-devel" ] }