From patchwork Thu Apr 7 08:37:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15647 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 D6449C0F1B for ; Thu, 7 Apr 2022 08:37:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 721AD6563E; Thu, 7 Apr 2022 10:37:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649320649; bh=fi/9yKryU+uYgr2qXqKJWw9UtagfjacSp2NxJOxQgpA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ixD63K+ES3lOLFbb2/zn6Oj73WwBhOg+cSk1WToyMq5fp09L4bGnDHdMzDhzpLF+k SbBsX+plQfsmxBOkQjX+czTh0Epa1gVtTdPY1FNVqPf2S8YdVV86pcRxCatKn5xOkb oZxy6VKh9xKj/VNjhIuFjOmgEtCGMEUlqOqUZIy3/JeAx2Y4zcdgg3TB3RWVRvJ2Iy FfCJb/C7lytdGPr1QB6QkiK0m+oEMvDVqRpvPnGh0y8wgV8tsw0cPbnXrjxi+AwV5D CLi4+kl9XR9zGYkpR4ELvHivaWaNKvMfqirNwe/uvO2b/0BObQy/oXR7NXHWO4tlWf AsdlJh3wPUk8Q== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A7E06563E for ; Thu, 7 Apr 2022 10:37:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YiMoM+G2"; dkim-atps=neutral Received: from localhost.localdomain (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1BAA2883 for ; Thu, 7 Apr 2022 10:37:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1649320646; bh=fi/9yKryU+uYgr2qXqKJWw9UtagfjacSp2NxJOxQgpA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YiMoM+G2B+FK5f62YbxiidfkTNADN5RboFXtXwXo5D8JRcA2rCIm1YZnbWQwsXbXk a3lAE+d04/BWL87eudg8J8Pw9OXtOt8/fusEA4JMFRX/9ctpBxU/geuRuDZsEsOlYv bzephUlpzmt3IGV2WptFfJmVQr0c6ygE/oBTZTlE= To: libcamera-devel@lists.libcamera.org Date: Thu, 7 Apr 2022 11:37:17 +0300 Message-Id: <20220407083719.21631-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220407083719.21631-1-laurent.pinchart@ideasonboard.com> References: <20220407083719.21631-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] test: v4l2_videodevice: dequeue_watchdog: Log message on failures 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Failing a test without an error message makes it difficult to debug issues. Add a message when buffer allocation fails. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder --- test/v4l2_videodevice/dequeue_watchdog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/v4l2_videodevice/dequeue_watchdog.cpp b/test/v4l2_videodevice/dequeue_watchdog.cpp index 0cb4de6f81a0..2282e3958c03 100644 --- a/test/v4l2_videodevice/dequeue_watchdog.cpp +++ b/test/v4l2_videodevice/dequeue_watchdog.cpp @@ -33,8 +33,10 @@ protected: Timer timeout; int ret = capture_->allocateBuffers(bufferCount, &buffers_); - if (ret < 0) + if (ret < 0) { + std::cout << "Failed to allocate buffers" << std::endl; return TestFail; + } capture_->dequeueTimeout.connect(this, &DequeueWatchdogTest::barkCounter); capture_->setDequeueTimeout(5ms); From patchwork Thu Apr 7 08:37:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15648 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 62E9EC3260 for ; Thu, 7 Apr 2022 08:37:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E5B7665645; Thu, 7 Apr 2022 10:37:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649320649; bh=ffILHcbRXXpA/Ufu8UVGlvdxDF8uUqT+FvqKKdKFFYo=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qmOR68TjwHTn9ofe7CAC2gIeKFCu7mxqbq4gcjAKt6wIRnNyYeTTRIrtH5onVyPVM VF9V+VKNGi19uGZ1OXYGl71buWeS4+5QzBuit2IpiAMy0zVPJxMjauS85+MwR3mWPM c8JlsRDvt0JP4+wWT+p2o2Gbl6nCEvIjIuUWLudRpU6xYnDVcnONbJgyT+HxloiF8T WvuIWww14fN+e903ZwzahfJ61hfVVOqoVgrj2Er6VTwugKCCnEtL4H0ONpBvTDbL1g BxDI2AJ/CnK56KHkSozmsJ8G9xAQAZ5SSY/V+05mtWATz/VQhPsJRt8nH0jEmN8rhE 9FE+gMUHz2vFQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A1E8F61FBB for ; Thu, 7 Apr 2022 10:37:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UAU4hQQR"; dkim-atps=neutral Received: from localhost.localdomain (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 562D2499 for ; Thu, 7 Apr 2022 10:37:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1649320646; bh=ffILHcbRXXpA/Ufu8UVGlvdxDF8uUqT+FvqKKdKFFYo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UAU4hQQRmLvG8tt0R14swPHjswJHBoPgwWBgO9+8Ihiv4qNItSMdz7SPUAz2mFjXG 9eMfM6vKAn4qOF6nFEx1Wr0xqXIRMT4y67ThgtmEnrVP2JyvyU5BnNAQin50nnahBQ RL5XOS5PQCUN2EI2wWIITkNao+NYJHkhDuECb2NI= To: libcamera-devel@lists.libcamera.org Date: Thu, 7 Apr 2022 11:37:18 +0300 Message-Id: <20220407083719.21631-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220407083719.21631-1-laurent.pinchart@ideasonboard.com> References: <20220407083719.21631-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] test: v4l2_videodevice: dequeue_watchdog: Check return value of streamOn 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If the streamOn() call fails, there is no way the test will then succeed. Catch it and return a failure. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder --- test/v4l2_videodevice/dequeue_watchdog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/v4l2_videodevice/dequeue_watchdog.cpp b/test/v4l2_videodevice/dequeue_watchdog.cpp index 2282e3958c03..320d14c8e442 100644 --- a/test/v4l2_videodevice/dequeue_watchdog.cpp +++ b/test/v4l2_videodevice/dequeue_watchdog.cpp @@ -50,7 +50,11 @@ protected: } } - capture_->streamOn(); + ret = capture_->streamOn(); + if (ret < 0) { + std::cout << "Failed to start streaming" << std::endl; + return TestFail; + } timeout.start(5s); while (timeout.isRunning()) { From patchwork Thu Apr 7 08:37:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15649 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 C1092C326C for ; Thu, 7 Apr 2022 08:37:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 416C76564B; Thu, 7 Apr 2022 10:37:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649320650; bh=Kc5rQ3wTdXxfGCnnrkYiSU3g48v9MxokGXTPyQcpySw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hv9sbTTdlBFJHe35jhwKoX1h/srI4ul5kpihNhw1W4+wMPFupfS7oQKFz2PX0s8H5 TZkZ3Yslb4rUW5gyhZ43kYBQ8VTrVAlzXCqIkcjdbShPWbpgH7YrEGXyQtQPG5ka4o 5o5ht/KL7C5dS28oSjsPcllVe+kHEutwv9oEycTIEhBjOx2NhS6ItdYylwHSXHHXLq xqzSvqtOi4Ny6NIH+B8uIDzxsWsJqKWbQQ0cz31Cm3LEQfWJNClxDXOv35UCksLEF0 pV2qyTqCtPoVyedmW+JKK7Atmtq67ZZVou5yRLHUxOhrfdg5CAdIZ30bNA1qmimKaD 14TJJCFSqXQFA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C35B965642 for ; Thu, 7 Apr 2022 10:37:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fDT8J51p"; dkim-atps=neutral Received: from localhost.localdomain (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 89F0C880 for ; Thu, 7 Apr 2022 10:37:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1649320646; bh=Kc5rQ3wTdXxfGCnnrkYiSU3g48v9MxokGXTPyQcpySw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fDT8J51pC2gG/14kN/KTvS8RO1GLr3T8TFvbjnb+RHUdX3asfwOf/1lZ+GrVTDKnK 3HQrVr6+uI2Mo1MwniF/0rN6rPAJpzYv/nDwZtIV5RJR++hvn2Fpy1Zw71dbkiN8Os 7IHkjjwR2M511wz65tTULtiHbCQfk9Kudaa4AwMo= To: libcamera-devel@lists.libcamera.org Date: Thu, 7 Apr 2022 11:37:19 +0300 Message-Id: <20220407083719.21631-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220407083719.21631-1-laurent.pinchart@ideasonboard.com> References: <20220407083719.21631-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] test: v4l2_videodevice: Fix format configuration in the vimc pipeline 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The V4L2VideoDeviceTest class configures the capture pipeline with parameters that are partly hardcoded, and partly come from the current configuration of the device. In particular, with the vimc pipeline, the sensor subdevice is configured with the size retrieved from the capture video node, and the video node is then reconfigured to 640x480. Relying on the current (and thus possibly random) device configuration can lead to broken pipes when starting streaming. This currently causes failures of the dequeue_watchdog test when run after the formats test. Fix it by explicitly setting the same size for both the vimc subdevs and the video capture device. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder --- test/v4l2_videodevice/v4l2_videodevice_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp index f23aaf8f514b..125aafd65041 100644 --- a/test/v4l2_videodevice/v4l2_videodevice_test.cpp +++ b/test/v4l2_videodevice/v4l2_videodevice_test.cpp @@ -60,6 +60,9 @@ int V4L2VideoDeviceTest::init() if (capture_->getFormat(&format)) return TestFail; + format.size.width = 640; + format.size.height = 480; + if (driver_ == "vimc") { sensor_ = new CameraSensor(media_->getEntityByName("Sensor A")); if (sensor_->init()) @@ -82,8 +85,6 @@ int V4L2VideoDeviceTest::init() return TestFail; } - format.size.width = 640; - format.size.height = 480; if (capture_->setFormat(&format)) return TestFail;