From patchwork Fri Jun 9 05:58:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Bara X-Patchwork-Id: 18721 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 86A00C3220 for ; Fri, 9 Jun 2023 05:58:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BDD8361E69; Fri, 9 Jun 2023 07:58:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686290301; bh=hUjcz+JotkNmiVSBTn2a6SkiTlUD2e3xCOhKgETAjuI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=0qNzboQsJIXv0bRwaJaPJJFam5lBtByCpVG7XiX5jAUj3MWzjvhjiSN5MGl0SBNl+ FXl3OKHIDM0+3IE9HKsRLSOcEXVGWWnM30O4vtG9l7iLoG8oXcZ2RRj4g/RD8+Y1/A +cjVLZFOgU4YTupZLge954K4C7QpvRk5zn/oc/x0cq92Aq1LnC05GW5j20cpZ1R6wV Qs0zDNgXig+53uyupCtwqmYB2sHfvZ0+twEeS4ifOTuZnYv+P9U9ubSrWn9JSgYgO8 JAAA8yhMMG5cnHicfYIiyktao7eDPeT65OvZ8olvZyR0qPg93CuNV2TlRo4xOMCtXy oR49F8MvYs0Cg== Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4057861E4D for ; Fri, 9 Jun 2023 07:58:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DZpeIHIk"; dkim-atps=neutral Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9745baf7c13so213802766b.1 for ; Thu, 08 Jun 2023 22:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686290299; x=1688882299; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=Ezb00DyzjDxbAEuL5Up5vHyUtGg3rVvktPuyFH+G06o=; b=DZpeIHIk3d6r6j+4Nl+27QA+8JHIFVBlApSoUfPjfIIY2/rMTbImfSdgUi+BOjHzlL tH6+NiA0zpe8W2ww/kj7PIy++KGiZdNYLC2v9QHiIldfYotfHZKwpNyjXuNp1j7uGAmR koU74UH2zZgBZ6QfP2N3OriVvs/rzZnpV6wFauFlKODTKV/kEuDGDbghvX+Gz8W7CfA+ POx5R6a1SRTlaqXTvvxc8tBK0jNVAR0U28T5Xf/qHgWCbHbxve0bzRqfqeMjstyyqZH0 cnLUJVILcjy1Yvb7O1lkLY+/4Sbs4X26DZEFbw00o/UlOydUvZgZTOAnLE6l3AD3SR/Q 83RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686290299; x=1688882299; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ezb00DyzjDxbAEuL5Up5vHyUtGg3rVvktPuyFH+G06o=; b=Gia6tg9WzAIsLrwu93fWg7GzDfA2odOzQEPi0ecjlKDJIOcLGVlMwYvLYkeLmtJFgR FEFu7kbkKV0TUxTfLk8cI83JmzcSDy2EpE8J/g6qsos9Me6avHcDg3k/aeykvZmvu120 itDSLs/m5aIFFafKe/UhO4Zdmqfqvmv8L0KXWjDhz4LxADekmS40rKF3cgHe58CGnsLE jOuUZZo4tk5Dz76WHLpj6Uxm3yLwYCy5bFLCJpkogaYhR/c2V9/M4QKc4YZ59Yjs5D4o GcQzDzMPXlLYjZVLn8xC4ha2TEEtkQ2ESPykY4+VsC0NgX6KAIfnJV/FragxBQqijwVN Lh+A== X-Gm-Message-State: AC+VfDy52hVavkDjI/Br5izb/+HDDg23cXbc912JS91BIjUrzTK4DOzn +RHD3bJstmqNJN+OCtd5pjiiW71ZwFY= X-Google-Smtp-Source: ACHHUZ5QYK1aHJsRMg3tR6DDHhLglZ5GaXpOUBi9q9qIWJYgiR2ryrzGAz5UHwoNDUQTX7sT2zvOfA== X-Received: by 2002:a17:907:84a:b0:96b:4ed5:a1c9 with SMTP id ww10-20020a170907084a00b0096b4ed5a1c9mr683675ejb.51.1686290299277; Thu, 08 Jun 2023 22:58:19 -0700 (PDT) Received: from [127.0.1.1] ([91.230.2.244]) by smtp.gmail.com with ESMTPSA id y21-20020a170906471500b00974564fa7easm853681ejq.5.2023.06.08.22.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 22:58:19 -0700 (PDT) Date: Fri, 09 Jun 2023 07:58:16 +0200 MIME-Version: 1.0 Message-Id: <20230609-empty-devnode-v1-1-e2c37c7b7dc9@skidata.com> X-B4-Tracking: v=1; b=H4sIAHi/gmQC/x2NwQqDMBAFf0X23IU0Skr7K6WHmH2tORhlV6RF/ Hdjj8MwzEYGzTB6NBsp1mx5KhWul4bSEMsHnKUyeedbF9ydMc7LjwVrmQTcBhEfulsSOKpNHw3 cayxpOKsx2gI9xax45+9/9Hzt+wGcqAY1eAAAAA== To: libcamera-devel@lists.libcamera.org X-Mailer: b4 0.12.2 Subject: [libcamera-devel] [PATCH] libcamera: device_enumerator: ensure deviceNode is not empty X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Benjamin Bara via libcamera-devel From: Benjamin Bara Reply-To: Benjamin Bara Cc: Benjamin Bara Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Benjamin Bara When activating both ISP nodes on the i.MX8MP, but only connecting one camera sensor, libcamera aborts because it couldn't find the chosen entity's device node: [37:54:40.779902250] [3631] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media1: rkisp1 [37:54:40.780196750] [3631] DEBUG DeviceEnumerator device_enumerator_udev.cpp:322 All dependencies for media device /dev/media0 found [37:54:40.780237875] [3631] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media0: rkisp1 [37:54:40.780505125] [3631] DEBUG Camera camera_manager.cpp:152 Found registered pipeline handler 'PipelineHandlerRkISP1' [37:54:40.780599875] [3631] DEBUG DeviceEnumerator device_enumerator.cpp:312 Successful match for media device "rkisp1" [37:54:40.780731375] [3631] ERROR V4L2 v4l2_device.cpp:93 'rkisp1_isp': Failed to open V4L2 device '': No such file or directory Fix this by skipping empty device nodes: [37:49:05.172672000] [3603] DEBUG DeviceEnumerator device_enumerator_udev.cpp:322 All dependencies for media device /dev/media1 found [37:49:05.172720625] [3603] DEBUG DeviceEnumerator device_enumerator.cpp:256 Added device /dev/media1: rkisp1 [37:49:05.172973875] [3603] DEBUG DeviceEnumerator device_enumerator_udev.cpp:322 All dependencies for media device /dev/media0 found [37:49:05.173012125] [3603] DEBUG DeviceEnumerator device_enumerator.cpp:256 Added device /dev/media0: rkisp1 [37:49:05.173281625] [3603] DEBUG Camera camera_manager.cpp:152 Found registered pipeline handler 'PipelineHandlerRkISP1' [37:49:05.173376875] [3603] DEBUG DeviceEnumerator device_enumerator.cpp:107 Skip rkisp1_isp: no device node [37:49:05.173414375] [3603] DEBUG DeviceEnumerator device_enum erator.cpp:316 Successful match for media device "rkisp1" [37:49:05.173671250] [3603] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video1[15:cap]: Opened device platform:rkisp1: rkisp1: rkisp1_stats [37:49:05.173775125] [3603] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video2[16:out]: Opened device platform:rkisp1: rkisp1: rkisp1_params [37:49:05.173880500] [3603] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video0[18:cap]: Opened device platform:rkisp1: rkisp1: rkisp1 Signed-off-by: Benjamin Bara --- src/libcamera/device_enumerator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- base-commit: 0ee9339331c648232e87d2de2ccd5a92cc61cab2 change-id: 20230609-empty-devnode-36dd2647cde0 Best regards, diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp index f2e055de..f2d943d1 100644 --- a/src/libcamera/device_enumerator.cpp +++ b/src/libcamera/device_enumerator.cpp @@ -100,9 +100,13 @@ bool DeviceMatch::match(const MediaDevice *device) const bool found = false; for (const MediaEntity *entity : device->entities()) { - if (name == entity->name()) { + if (name == entity->name() && !entity->deviceNode().empty()) { found = true; break; + } else if (name == entity->name()) { + LOG(DeviceEnumerator, Debug) + << "Skip " << entity->name() + << ": no device node"; } }