Patch Detail
Show a patch.
GET /api/1.1/patches/8903/?format=api
{ "id": 8903, "url": "https://patchwork.libcamera.org/api/1.1/patches/8903/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8903/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200721112633.103016-1-jacopo@jmondi.org>", "date": "2020-07-21T11:26:33", "name": "[libcamera-devel] android: camera_hal_manager: Fail on no cameras", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1e5a6f20b09e3a2c94a7ad9346db0aaf92692100", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": { "id": 15, "url": "https://patchwork.libcamera.org/api/1.1/users/15/?format=api", "username": "jmondi", "first_name": "Jacopo", "last_name": "Mondi", "email": "jacopo@jmondi.org" }, "mbox": "https://patchwork.libcamera.org/patch/8903/mbox/", "series": [ { "id": 1122, "url": "https://patchwork.libcamera.org/api/1.1/series/1122/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1122", "date": "2020-07-21T11:26:33", "name": "[libcamera-devel] android: camera_hal_manager: Fail on no cameras", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1122/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/8903/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8903/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 16D70C0109\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Jul 2020 11:23:01 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9883360832;\n\tTue, 21 Jul 2020 13:23:00 +0200 (CEST)", "from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ED1CF60496\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jul 2020 13:22:59 +0200 (CEST)", "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 70F8020005;\n\tTue, 21 Jul 2020 11:22:59 +0000 (UTC)" ], "X-Originating-IP": "93.34.118.233", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 21 Jul 2020 13:26:33 +0200", "Message-Id": "<20200721112633.103016-1-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.27.0", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH] android: camera_hal_manager: Fail on no\n\tcameras", "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>", "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": "The CameraHalManager initialization tries to start the\nlibcamera::CameraManager which enumerate the registered cameras.\n\nWhen initialization is called too early during system boot, it might\nhappen that the media graphs are still being registered to user-space\npreventing any pipeline handler to match and register cameras.\n\nIf that happens, the CameraHalManager silently accepts that no\ncameras are available in the system, reporting that information\nto the camera stack:\n\ncros_camera_service[2054]: (5) StartOnThread(): Camera module \"libcamera camera HALv3 module\" has 0 built-in camera(s)\ncros_camera_service[2054]: (5) StartOnThread(): SuperHAL started with 1 modules and 0 built-in cameras\nCameraProviderManager: Camera provider legacy/0 ready with 0 camera devices\n\nFix this by returning an error code if no camera is registered in the\nsystem at the time CameraHalManager::init() is called. The camera\nframework then tries to re-load the HAL module later in time, hopefully\nafter the media device dependencies have been registered:\n\n2020-07-21T12:26:37.903456+02:00 INFO cros_camera_service[2054]: (5) StartOnThread(): Camera module \"libcamera camera HALv3 module\" has 0 built-in camera(s)\n2020-07-21T12:26:37.903521+02:00 INFO cros_camera_service[2054]: (5) StartOnThread(): SuperHAL started with 1 modules and 0 built-in cameras\n....\n2020-07-21T12:30:36.662877+02:00 INFO cros_camera_service[5908]: (5910) StartOnThread(): Camera module \"libcamera camera HALv3 module\" has 2 built-in camera(s)\n2020-07-21T12:30:36.663196+02:00 INFO cros_camera_service[5908]: (5910) StartOnThread(): SuperHAL started with 1 modules and 2 built-in cameras\n\nReturn -ENODEV as according to camera_common.h specification is the\nonly supported error code. The CrOS HAL adapter does not distinguish\nbetween that and other negative values, so it does not really make\na difference.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_hal_manager.cpp | 11 +++++++++++\n 1 file changed, 11 insertions(+)", "diff": "diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp\nindex 02b6418fb36d..e967d210e547 100644\n--- a/src/android/camera_hal_manager.cpp\n+++ b/src/android/camera_hal_manager.cpp\n@@ -73,6 +73,17 @@ int CameraHalManager::init()\n \t\t++index;\n \t}\n \n+\t/*\n+\t * If no pipeline has registered cameras, defer initialization to give\n+\t * time to media devices to register to user-space.\n+\t */\n+\tif (index == 0) {\n+\t\tLOG(HAL, Debug) << \"Defer CameraHALManager initialization\";\n+\t\tdelete cameraManager_;\n+\t\tcameraManager_ = nullptr;\n+\t\treturn -ENODEV;\n+\t}\n+\n \treturn 0;\n }\n \n", "prefixes": [ "libcamera-devel" ] }