From patchwork Sat Sep 10 06:37:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 17358 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 EA128C3272 for ; Sat, 10 Sep 2022 06:38:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2D7D0620AF; Sat, 10 Sep 2022 08:38:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1662791886; bh=YAqYeSUXIYwQHkIiZEY2LGhqhETOD+npw7PFM5j71NY=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=slvJkM+ehCk6Lp6GJiGt7kZxNmZwupnFGMUOh18WU25nFmwtiOyfeyvXdlCELT8lQ qGhijkD8ugazkjNDUUKyId+Cjwx17wXC0aL/pDBW36Bzcj7VOcEzK7b3zep7oakUgA IOH0Vw+9J3dhgotrELrpf3q3DJmZOEJp13XkcFyME7eIXBHSk5sADUUOPPnvRzBqVU gwQueFDVhkeLD6R5d5UXCphPVQdsVKHfWv3T35B4HNj4S7RYJu+t+ySdsZMgZSGm2m 561KGQ8Jl0SXL1Xk6IN/V+emuEI/numZCRzdIcUArRZbm42l//ZW/f5F/IwGvf7BDr zZqqpNHHIxe3A== Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B646961F95 for ; Sat, 10 Sep 2022 08:38:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AvJFyJu0"; dkim-atps=neutral Received: by mail-pg1-x531.google.com with SMTP id g4so3537884pgc.0 for ; Fri, 09 Sep 2022 23:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=WA0sKdqnk8N+1uVdJ/JiQO4ahrRKOcojUaN6o82co1c=; b=AvJFyJu0ihaRdCOijq8Gi8RXxXOx3ds9SM02upXMruH+pMpl0Wirvg0sOuJ/1kbZeh IViO3vFPCX4WVYRjo7XydRV/EcahYG+1FsbPrrspn0nhBrtotxcl8S3KCgzMCSwMgJkF 2tmg7RFvvzAUt5ezkMR3914hfStjHed3gciNVGbdudMCP2bxKqgI/1Qtu8LGslbIm/1H JPmin9/IYwdgxA5e2uD53C/RoLgJUhHY2vZ93+OT7uktaTs0MLtCgeXm7M44B9rrmDk7 civXRUyXoCk9VkNAD95PsrB8XMaf2CR/3i7vVX7cX6YLuYChCxlO+jDtvj8UAr9t+6TL Ubxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=WA0sKdqnk8N+1uVdJ/JiQO4ahrRKOcojUaN6o82co1c=; b=N2k5Navdf4qo2eByeInsWZ5qYr8CZHmfV9pigyb5io+ogFk0Oncu8QFRLwQsnU8s3l mAsofcSqlBPqbd+DxTX+Y+i8+cuH/QIrSPAxhyGXKv0YL/PaZBiG6hwY3vkyoZyfmWxz csJL+Id+0EDaZhf+5CuMLBrCV5iAqB6h9Eyy7Hkw6DQ/wm90cTFrN35VLCWmbARj9OWQ amNomnuWFLn9mXWBvk/CPdWDv+RzDRMofjXtrIikWgFcWIB1Jjlc4daPo5aaPMYc+B/B GVM23W+JHZRc5EY7DadwSBfT2HQ0qGUXQMmRwM8B3cYWNO7q/AQqYTOob+AUMr/wPgYU hRbw== X-Gm-Message-State: ACgBeo3UZVfQgSjbpNd1SJe7UXhS/q/yEtxvUGpefKA8wLhmQsx7sd11 /Q0VflDN6dJNhHZXA5p1SmjYK/mma3d/xQ== X-Google-Smtp-Source: AA6agR5AXv7e7rA3Q/9EtWbjQ1JvXJ5WOGX8N5GQOGCj7vDNcdTLnVuJYdwdTeyeGtIGMnH0VFZEHQ== X-Received: by 2002:a05:6a00:1ad2:b0:53f:2455:17b9 with SMTP id f18-20020a056a001ad200b0053f245517b9mr13096151pfv.50.1662791880927; Fri, 09 Sep 2022 23:38:00 -0700 (PDT) Received: from veware.localdomain ([111.125.221.115]) by smtp.googlemail.com with ESMTPSA id r15-20020a63a54f000000b0043395af24f6sm1593628pgu.25.2022.09.09.23.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 23:37:59 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sat, 10 Sep 2022 12:07:42 +0530 Message-Id: <20220910063742.957169-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] test: gstreamer: Fix failure of gstreamer_multistream_test 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: Vedant Paranjape via libcamera-devel From: Vedant Paranjape Reply-To: Vedant Paranjape Cc: Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Multistream test failed with the following logs, to run on Raspberry Pi 4 due to a bug introduced in one of the recent patches refactoring the code that fails to set the camera-name property with a valid camera id string. [5:04:05.990569833] [16751] INFO IPAManager ipa_manager.cpp:141 libcamera is not installed. Adding '/home/libcamera/build/src/ipa' to the IPA search path [5:04:05.994751009] [16751] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3904-560ceb1e-dirty (2022-09-10T03:53:40+05:30) [5:04:06.058019483] [16752] INFO IPAProxy ipa_proxy.cpp:130 libcamera is not installed. Loading IPA configuration from '/home/libcamera/src/ipa/raspberrypi/data' [5:04:06.085169830] [16752] INFO RPI raspberrypi.cpp:1374 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media4 and ISP device /dev/media1 0:00:00.178829295 16751 0x1d31e00 DEBUG libcamerasrc gstlibcamerasrc.cpp:763:gst_libcamera_src_request_new_pad: new request pad created 0:00:00.179392613 16751 0x1d31e00 DEBUG libcamerasrc gstlibcamerasrc.cpp:327:gst_libcamera_src_open: Opening camera device ... [5:04:06.094149760] [16751] INFO IPAManager ipa_manager.cpp:141 libcamera is not installed. Adding '/home/libcamera/build/src/ipa' to the IPA search path [5:04:06.097366114] [16751] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3904-560ceb1e-dirty (2022-09-10T03:53:40+05:30) [5:04:06.152332645] [16755] INFO IPAProxy ipa_proxy.cpp:130 libcamera is not installed. Loading IPA configuration from '/home/libcamera/src/ipa/raspberrypi/data' [5:04:06.173016319] [16755] INFO RPI raspberrypi.cpp:1374 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media4 and ISP device /dev/media1 0:00:00.259832923 16751 0x1d31e00 WARN libcamerasrc gstlibcamerasrc.cpp:347:gst_libcamera_src_open: error: Could not find a camera named ''. 0:00:00.259883405 16751 0x1d31e00 WARN libcamerasrc gstlibcamerasrc.cpp:347:gst_libcamera_src_open: error: libcamera::CameraMananger::get() returned nullptr Unable to set the pipeline to the playing state. 0:00:00.262787739 16751 0x1d31e00 DEBUG libcamerasrc gstlibcamerasrc.cpp:786:gst_libcamera_src_release_pad: Pad being released This patch assigns the camera->id() to the variable cameraName_ that is later used to set element property "camera-name" needed to call the specific camera which supports multistreams. Move the code to set element property "camera-name" to base class GstreamerTest. Fixes: 5646849b59fe ("test: gstreamer: Check availability of cameras before running") Signed-off-by: Vedant Paranjape Reviewed-by: Umang Jain Tested-by: Rishikesh Donadkar Reviewed-by: Rishikesh Donadkar --- test/gstreamer/gstreamer_multi_stream_test.cpp | 3 --- test/gstreamer/gstreamer_test.cpp | 6 ++++-- test/gstreamer/gstreamer_test.h | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/gstreamer/gstreamer_multi_stream_test.cpp b/test/gstreamer/gstreamer_multi_stream_test.cpp index b8387c10c65e..cd669308d171 100644 --- a/test/gstreamer/gstreamer_multi_stream_test.cpp +++ b/test/gstreamer/gstreamer_multi_stream_test.cpp @@ -70,8 +70,6 @@ protected: int run() override { - g_object_set(libcameraSrc_, "camera-name", cameraName_.c_str(), NULL); - /* Build the pipeline */ gst_bin_add_many(GST_BIN(pipeline_), libcameraSrc_, stream0_, stream1_, NULL); @@ -106,7 +104,6 @@ protected: } private: - std::string cameraName_; GstElement *stream0_; GstElement *stream1_; }; diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp index 4947b7bb2977..fe8e8e157b5b 100644 --- a/test/gstreamer/gstreamer_test.cpp +++ b/test/gstreamer/gstreamer_test.cpp @@ -73,7 +73,7 @@ GstreamerTest::GstreamerTest(unsigned int numStreams) * Atleast one camera should be available with numStreams streams, * otherwise skip the test entirely. */ - if (!checkMinCameraStreams(numStreams)) { + if (!checkMinCameraStreamsAndSetCameraName(numStreams)) { status_ = TestSkip; return; } @@ -81,7 +81,7 @@ GstreamerTest::GstreamerTest(unsigned int numStreams) status_ = TestPass; } -bool GstreamerTest::checkMinCameraStreams(unsigned int numStreams) +bool GstreamerTest::checkMinCameraStreamsAndSetCameraName(unsigned int numStreams) { libcamera::CameraManager cm; bool cameraFound = false; @@ -93,6 +93,7 @@ bool GstreamerTest::checkMinCameraStreams(unsigned int numStreams) continue; cameraFound = true; + cameraName_ = camera->id(); break; } @@ -121,6 +122,7 @@ int GstreamerTest::createPipeline() return TestFail; } + g_object_set(libcameraSrc_, "camera-name", cameraName_.c_str(), NULL); g_object_ref_sink(libcameraSrc_); return TestPass; diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h index 6f277cc5d8b2..aa2261e2dd5c 100644 --- a/test/gstreamer/gstreamer_test.h +++ b/test/gstreamer/gstreamer_test.h @@ -24,10 +24,11 @@ protected: int processEvent(); void printError(GstMessage *msg); + std::string cameraName_; GstElement *pipeline_; GstElement *libcameraSrc_; int status_; private: - bool checkMinCameraStreams(unsigned int numStreams); + bool checkMinCameraStreamsAndSetCameraName(unsigned int numStreams); };