From patchwork Fri Jun 9 06:14:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Bara X-Patchwork-Id: 18722 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 26418C31E9 for ; Fri, 9 Jun 2023 06:14:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 95A9161E5F; Fri, 9 Jun 2023 08:14:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686291277; bh=fXnW/UZ/WqTC/piqp+7ntO2brcr8oqSOZ9Rh9PWHCOY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=XZ6KiI8tdbgoH0nbiAMBUbyEcjj+vmzD8bZNoS/Q6zjnUacUt/Nq3+VO1y1PobWNY u+kZyaUZiPtVut68LttQv3ahlnMi2XCk1FqRJPMNzm/D3XhqTqoXwC/ZgfPE8l9NHF dKoKaDTvqhDk+I2n992by/JyKpiB13vSlvxeiVaeMUDKZwwKmgBbZuFeiBDoR83G9U vfuD8iHJkuiq93tGBB25g7HBU8nWaUDjakny3DrGWi9keBHHgojtg42zl02RS6Q80O eHgU9m4b905ALGx7D4pvw6L3SNQFAbNVgZH2prliDekIrEduDUxJUdwyjSi7XcEM0w wCi3cl+4CIFyg== Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2303161E4D for ; Fri, 9 Jun 2023 08:14:36 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ojOxsPj0"; dkim-atps=neutral Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-976a0a1a92bso268141966b.1 for ; Thu, 08 Jun 2023 23:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686291275; x=1688883275; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=GW+fexN6ShDuPRhEn5uLZ+0kwHwGcDQvLrzO5O/QGr4=; b=ojOxsPj0UdxHFycPIVzK269KKQZC3RZihS0MefSryzaPgtUKA6DbW1DN92opDVE1wx 6cnQ+GcWqYfiBv7Nh7IzHq6qRPtgxAGLf1PA7akw4zYS8q+y6dXxLljOyiQ9/DjtCtp/ 9juEneeD5R4bQkBdO6sYTyfgYKMckemUnfGW5jxehXvW3sIPgZEHYidAnE7oY2x9K26S 4Yi8mFwbvrBN0sDtOr8eE69Ztp6ClW5+3paW+Z66uK+hN4Iz4gEhVP+bbbNrGcT65rwR JhJcJ7iI5Yfc7x2lxx2VgeNi2IcsmLnkSYZMKDLh6PiYOTNhXRI/qexqF/RNpiYaMQb0 2M3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686291275; x=1688883275; 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=GW+fexN6ShDuPRhEn5uLZ+0kwHwGcDQvLrzO5O/QGr4=; b=QYCWyKmi8T4CbSh0LZ6C2pwG54IA1OMSeuQlWS+snJyyyn92Cq5Jkf8wnc87hGly0V luEe9YCz9Wc0wUAUyYwm2qTl5N2rlgEyHAbK69Gh629evIDBmA0p4wG10R8sOxflEith 4+9VSFpGS0YbBYL+Bo9oUW2pQF/1+XGX3zUBhf3Y+ui40S2tVvpKRnXJ2a8F/jiX9Yc3 telKPHEoEPLVqufJmjZvbku5Hbw2V5qFBdHUeMo/SgNlO5M1UaKIo+cCkIxkb1nUeviS b2YZu2XxqqknU6Pw9SBeD87Io2IfUVfje2lrPGVpqktnvWP/ldnAyqnpI3pPZ//WBnO8 b2SA== X-Gm-Message-State: AC+VfDy2AiRWRQ92psXaQs7wv3lC/RsOABML5jmcdriOUNYe2+NZZ68y zESFtWhnrQT3hsjQr3vqaAN25Z/pflQ= X-Google-Smtp-Source: ACHHUZ7x8roY2aHjKID2Q527bjoT0APt5Q0OWEwm/nnCxgg5eImfXLsZB+vDeXdEstkhtOrO6GoH7g== X-Received: by 2002:a17:907:2ce5:b0:978:af9d:4d4c with SMTP id hz5-20020a1709072ce500b00978af9d4d4cmr932268ejc.75.1686291275479; Thu, 08 Jun 2023 23:14:35 -0700 (PDT) Received: from [127.0.1.1] ([91.230.2.244]) by smtp.gmail.com with ESMTPSA id lw4-20020a170906bcc400b009787209732esm846859ejb.143.2023.06.08.23.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 23:14:35 -0700 (PDT) Date: Fri, 09 Jun 2023 08:14:32 +0200 MIME-Version: 1.0 Message-Id: <20230609-empty-devnode-v2-1-82a11e74aafd@skidata.com> X-B4-Tracking: v=1; b=H4sIAEjDgmQC/3WNQQqDMBBFryKz7pSYFINd9R7FRcxMaygmkoRQE e/e6L7L9z+Pt0Hi6DjBvdkgcnHJBV9BXhqwk/FvRkeVQQqpRCd65HnJKxIXH4hRdUSyu2lLLKA 6o0mMYzTeToc1m5Q5HscS+eW+Z+g5VJ5cyiGuZ7e0x/ovUVpskaVV2upRk+0f6ePIZHO1YYZh3 /cf5wikgsUAAAA= To: libcamera-devel@lists.libcamera.org X-Mailer: b4 0.12.2 Subject: [libcamera-devel] [PATCH v2] 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_enumerator.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 Reviewed-by: Kieran Bingham --- Hi! Seems like something went wrong with the format of the log in V1 when copying it. --- Changes in v2: - adapt commit message - Link to v1: https://lists.libcamera.org/pipermail/libcamera-devel/2023-June/038181.html --- 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"; } }