From patchwork Thu Apr 3 07:45:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 23111 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 8A0D6C3213 for ; Thu, 3 Apr 2025 07:46:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4394D689A1; Thu, 3 Apr 2025 09:46:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="cgnjceXq"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B2CFC6899F for ; Thu, 3 Apr 2025 09:46:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743666368; x=1775202368; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZC3JSAvMBG9urzbiYzEWqBvKPrjnwU+bwCzZ4ckGhJY=; b=cgnjceXqS3NdtTynan0hQ1BRo2DL5OJZERDSALuZyMcjGStJMGrw8zYc 0DbuAuTqWm01SruHWrt+V6l3ln/Jnq+D+O+sNl/PlNVyqFW0YuJoqWCzi nL6WvW7Mta8sFQA5DPAcb9Fitsu3RtgS0RZ8frmNw8l/T1bESZR+NX8j/ 4P6uibN5gPSlC3QKt/BJUTsUXAlAU/mRiyCFtt4vTdUmshVzW9KD+wM43 oy57JOlV4brQ+YM1dc7f8isDIqrKZkOIztUrc1u7bYl0Xz4oRi3wvQTQ0 85zJP/+bLm7VQ53OjCJ4rkBHVVlY3BgAaqrX4lFJ/Qym9QfXeHyXKM4iO A==; X-CSE-ConnectionGUID: UYn7JOVPTq6gXvBy9Vhiow== X-CSE-MsgGUID: zZkmPaIRQGOHpBWO4WzB4A== X-IronPort-AV: E=McAfee;i="6700,10204,11392"; a="48721684" X-IronPort-AV: E=Sophos;i="6.15,184,1739865600"; d="scan'208";a="48721684" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2025 00:46:06 -0700 X-CSE-ConnectionGUID: ghkcZ3KsR4eAWjqfqaQfyg== X-CSE-MsgGUID: QQyM7cwxQYCgpNlRLiPhEA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,184,1739865600"; d="scan'208";a="164159630" Received: from sgruszka-mobl.ger.corp.intel.com (HELO localhost) ([10.246.8.237]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2025 00:46:04 -0700 From: Stanislaw Gruszka To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Hans de Goede , Laurent Pinchart , Kieran Bingham , Sakari Ailus , Stefan Klug Subject: [PATCH v7 2/5] pipeline: simple: Connect/disconnect frameStart signal at start/stop time Date: Thu, 3 Apr 2025 09:45:48 +0200 Message-Id: <20250403074551.263496-3-stanislaw.gruszka@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250403074551.263496-1-stanislaw.gruszka@linux.intel.com> References: <20250403074551.263496-1-stanislaw.gruszka@linux.intel.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The frameStart signal from the frame start emitter is connected in the configure() function, and is never disconnected. This means that each time the camera is configured a new connection is made, causing the DelayedControls::applyControls() to be called multiple times. Fix it by connecting and disconnecting the signal when starting and stopping the camera. Reviewed-by: Stefan Klug # v6 Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Co-developed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Stanislaw Gruszka Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/simple/simple.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index fd0ccdca8ebe..06e805d89caa 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1371,8 +1371,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c) data->delayedCtrls_ = std::make_unique(data->sensor_->device(), params); - data->video_->frameStart.connect(data->delayedCtrls_.get(), - &DelayedControls::applyControls); StreamConfiguration inputCfg; inputCfg.pixelFormat = pipeConfig->captureFormat; @@ -1440,6 +1438,9 @@ int SimplePipelineHandler::start(Camera *camera, [[maybe_unused]] const ControlL video->bufferReady.connect(data, &SimpleCameraData::imageBufferReady); + data->video_->frameStart.connect(data->delayedCtrls_.get(), + &DelayedControls::applyControls); + ret = video->streamOn(); if (ret < 0) { stop(camera); @@ -1472,6 +1473,9 @@ void SimplePipelineHandler::stopDevice(Camera *camera) SimpleCameraData *data = cameraData(camera); V4L2VideoDevice *video = data->video_; + data->video_->frameStart.disconnect(data->delayedCtrls_.get(), + &DelayedControls::applyControls); + if (data->useConversion_) { if (data->converter_) data->converter_->stop();