From patchwork Wed May 27 10:25:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Hollinghurst X-Patchwork-Id: 26809 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 7C831C328C for ; Wed, 27 May 2026 10:26:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AF3CF63026; Wed, 27 May 2026 12:25:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="PjgOGU9B"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 194E562E9D for ; Wed, 27 May 2026 12:25:58 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-49041fb8c23so41304345e9.0 for ; Wed, 27 May 2026 03:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1779877557; x=1780482357; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TtjANwcGbkD6UPbBea1UAFXUj8OT+8IBZuEpFwbIKfs=; b=PjgOGU9BN63V0JOGfIuYwj37C3Yc+rwBNrOYpW6R75wKoWFQJDXG9pkRMKbHd+dtTh qap1kYBG7c129Qa3iiGVYncdjN96VA2lwVbDwJuVK8YrwjvduSLxcIuXZs1wy5QNyEM1 l7RL/uERvCRra0jiGITsMdkOQ4wk+5wh8dWwojzK28evegldNPOPDK8Q0ImQjtddmBdm 7hs2uWd4CQK6cLutsbHjVO+xr8l3WjpdXUrIjAbsV53kYI9ThRjV1p5Iuqj9qQt3VMSx e9Vh6uycD/fYh06U+nOUxvTxnrnIbkO5bMuZg4o8su1W0zvjp4LBOMrUadCIyCqK3Sg1 ztUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779877557; x=1780482357; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TtjANwcGbkD6UPbBea1UAFXUj8OT+8IBZuEpFwbIKfs=; b=BkvBiGWjOErMcZvATb2b4Ex7hP+IMeaj1KlpoqThRpSy5fNroAxkPiN6ID5FmGDNOJ 0kUjfumq+h/kF7f4ESfp5RR+LqIAT/P6TmPeqjFxdmxXMP3tPFRyLfpfd55xQQrHvO2A okmER0hBkbnhSBG9zfnig7Tc0as7gWG4nF0Sdyv+hPYIthpGj/AJIG0U7w48dCwBdzgP rpIwtD+x/VrSE7fSE6s+Xqwdn3NlnPgxoktc3jMfn6nbkMEK8wkwpqn93k3QR9Pkh8bS 2qUBWDkN9dMRbRBGgE8xstnvccREHrYWYbekyy3zwq/ZH0S+DyNTFeRPjINjfAe//s5b ZmDA== X-Gm-Message-State: AOJu0YyeZRD5YsQLOS3L0odIWbBxzIEGF92ibr3hWMNBoUhCdySOqM3d lQWehafWM6hNrutBC6gzZI9s776CrbEFY5Lv5neEz9Ec2uSJIdoYfUdPzstzNHKty/HrT6Tt2G7 tZl9S X-Gm-Gg: Acq92OEYSyLTQE87IrAUP/Sm/uA2Hl78WYDQh/MK/h+o/H3hTQhQ3+bfokoL7o7hI0O HSKbF/kOYVFvHcqBt2izAzsaNE1/IrO/5/e3ukWcjIvMO8HyhdFa41XOoKJllc6b7qM8/kD62Jw 0GppiEDzBT9k2fYlyL30fNi19omMtdTP451Jh8nsYrLntulUAS/0Hb4OOaf66/GJ8UPjkeFTtAA m9YDUMPXvVEUsqaPUsEh/v4T3Q3h2ERY6vEBLS6syuOWfcPuPKuffwZYmFqmCBN8bCmiHempIDT xil6r3+vx6P0GyDhVoFDmaibQFHcFZlIb/8xXbuNn/90oiYRpLn0B4+s6rGRPHTn6dNPAMCq1Kx Dqhs0fJcEC9CmpP+wxLsdKAyKhKL/Db26DTdv8A87SB1rwKwuLl8LvRupVx2j/czmSp3y0Hk3yM 3aY41O6BNkCKrzy6YfaqciXiv6s0wi5ZwPOHbiN0NlxybUzYfrGz0sihrRA06oFuD6jUWAvPRNr LjX1HE= X-Received: by 2002:a05:600c:4510:b0:48f:e230:80a2 with SMTP id 5b1f17b1804b1-49042ae97f8mr340666265e9.32.1779877557516; Wed, 27 May 2026 03:25:57 -0700 (PDT) Received: from nickh-dell-ubuntu.pitowers.org ([2a00:1098:3142:1f:3c8f:14b0:2315:8f42]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4907e69dc39sm15441385e9.4.2026.05.27.03.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 03:25:56 -0700 (PDT) From: Nick Hollinghurst To: libcamera-devel@lists.libcamera.org Cc: Nick Hollinghurst Subject: [PATCH] pipeline: rpi: Fix crash when configuring timeout Date: Wed, 27 May 2026 11:25:16 +0100 Message-ID: <20260527102517.7123-1-nick.hollinghurst@raspberrypi.com> X-Mailer: git-send-email 2.51.0 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" When loading a config containing a nonzero "camera_timeout_value_ms" (as is required for externally-triggered cameras) it would crash as the pipeline handler tried to access both the IPA and frontEndDevice before either had been created. Re-order to avoid the crash. Fixes: cc74afcdbd3e ("Make the controller min frame duration configurable") Signed-off-by: Nick Hollinghurst Reviewed-by: Naushir Patuck Reviewed-by: David Plowman --- .../pipeline/rpi/common/pipeline_base.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index ace38997..263a4838 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -878,6 +878,16 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr &camera data->ipa_->setLensControls.connect(data, &CameraData::setLensControls); data->ipa_->metadataReady.connect(data, &CameraData::metadataReady); + /* + * Disable the IPA signal to control timeout, when there is a + * user-requested value. We do this here now that the IPA and + * front end device are both initialized. + */ + if (data->config_.cameraTimeoutValue) { + data->ipa_->setCameraTimeout.disconnect(); + data->frontendDevice()->setDequeueTimeout(data->config_.cameraTimeoutValue * 1ms); + } + return 0; } @@ -1145,12 +1155,6 @@ int CameraData::loadPipelineConfiguration() config_.cameraTimeoutValue = phConfig["camera_timeout_value_ms"].get(config_.cameraTimeoutValue); - if (config_.cameraTimeoutValue) { - /* Disable the IPA signal to control timeout and set the user requested value. */ - ipa_->setCameraTimeout.disconnect(); - frontendDevice()->setDequeueTimeout(config_.cameraTimeoutValue * 1ms); - } - config_.controllerMinFrameDurationUs = phConfig["controller_min_frame_duration_us"].get(config_.controllerMinFrameDurationUs);