{"id":26809,"url":"https://patchwork.libcamera.org/api/patches/26809/?format=json","web_url":"https://patchwork.libcamera.org/patch/26809/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260527102517.7123-1-nick.hollinghurst@raspberrypi.com>","date":"2026-05-27T10:25:16","name":"pipeline: rpi: Fix crash when configuring timeout","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"4e012ed9e6a55cd05c4747033c8e7dce7d1e334e","submitter":{"id":130,"url":"https://patchwork.libcamera.org/api/people/130/?format=json","name":"Nick Hollinghurst","email":"nick.hollinghurst@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/26809/mbox/","series":[{"id":5966,"url":"https://patchwork.libcamera.org/api/series/5966/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5966","date":"2026-05-27T10:25:16","name":"pipeline: rpi: Fix crash when configuring timeout","version":1,"mbox":"https://patchwork.libcamera.org/series/5966/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/26809/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/26809/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7C831C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 May 2026 10:26:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AF3CF63026;\n\tWed, 27 May 2026 12:25:59 +0200 (CEST)","from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 194E562E9D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 May 2026 12:25:58 +0200 (CEST)","by mail-wm1-x331.google.com with SMTP id\n\t5b1f17b1804b1-49041fb8c23so41304345e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 May 2026 03:25:58 -0700 (PDT)","from nickh-dell-ubuntu.pitowers.org\n\t([2a00:1098:3142:1f:3c8f:14b0:2315:8f42])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4907e69dc39sm15441385e9.4.2026.05.27.03.25.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 May 2026 03:25:56 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"PjgOGU9B\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1779877557; x=1780482357;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=TtjANwcGbkD6UPbBea1UAFXUj8OT+8IBZuEpFwbIKfs=;\n\tb=PjgOGU9BN63V0JOGfIuYwj37C3Yc+rwBNrOYpW6R75wKoWFQJDXG9pkRMKbHd+dtTh\n\tqap1kYBG7c129Qa3iiGVYncdjN96VA2lwVbDwJuVK8YrwjvduSLxcIuXZs1wy5QNyEM1\n\tl7RL/uERvCRra0jiGITsMdkOQ4wk+5wh8dWwojzK28evegldNPOPDK8Q0ImQjtddmBdm\n\t7hs2uWd4CQK6cLutsbHjVO+xr8l3WjpdXUrIjAbsV53kYI9ThRjV1p5Iuqj9qQt3VMSx\n\te9Vh6uycD/fYh06U+nOUxvTxnrnIbkO5bMuZg4o8su1W0zvjp4LBOMrUadCIyCqK3Sg1\n\tztUw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1779877557; x=1780482357;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=TtjANwcGbkD6UPbBea1UAFXUj8OT+8IBZuEpFwbIKfs=;\n\tb=BkvBiGWjOErMcZvATb2b4Ex7hP+IMeaj1KlpoqThRpSy5fNroAxkPiN6ID5FmGDNOJ\n\t0kUjfumq+h/kF7f4ESfp5RR+LqIAT/P6TmPeqjFxdmxXMP3tPFRyLfpfd55xQQrHvO2A\n\tokmER0hBkbnhSBG9zfnig7Tc0as7gWG4nF0Sdyv+hPYIthpGj/AJIG0U7w48dCwBdzgP\n\trpIwtD+x/VrSE7fSE6s+Xqwdn3NlnPgxoktc3jMfn6nbkMEK8wkwpqn93k3QR9Pkh8bS\n\t2qUBWDkN9dMRbRBGgE8xstnvccREHrYWYbekyy3zwq/ZH0S+DyNTFeRPjINjfAe//s5b\n\tZmDA==","X-Gm-Message-State":"AOJu0YyeZRD5YsQLOS3L0odIWbBxzIEGF92ibr3hWMNBoUhCdySOqM3d\n\tlQWehafWM6hNrutBC6gzZI9s776CrbEFY5Lv5neEz9Ec2uSJIdoYfUdPzstzNHKty/HrT6Tt2G7\n\ttZl9S","X-Gm-Gg":"Acq92OEYSyLTQE87IrAUP/Sm/uA2Hl78WYDQh/MK/h+o/H3hTQhQ3+bfokoL7o7hI0O\n\tHSKbF/kOYVFvHcqBt2izAzsaNE1/IrO/5/e3ukWcjIvMO8HyhdFa41XOoKJllc6b7qM8/kD62Jw\n\t0GppiEDzBT9k2fYlyL30fNi19omMtdTP451Jh8nsYrLntulUAS/0Hb4OOaf66/GJ8UPjkeFTtAA\n\tm9YDUMPXvVEUsqaPUsEh/v4T3Q3h2ERY6vEBLS6syuOWfcPuPKuffwZYmFqmCBN8bCmiHempIDT\n\txil6r3+vx6P0GyDhVoFDmaibQFHcFZlIb/8xXbuNn/90oiYRpLn0B4+s6rGRPHTn6dNPAMCq1Kx\n\tDqhs0fJcEC9CmpP+wxLsdKAyKhKL/Db26DTdv8A87SB1rwKwuLl8LvRupVx2j/czmSp3y0Hk3yM\n\t3aY41O6BNkCKrzy6YfaqciXiv6s0wi5ZwPOHbiN0NlxybUzYfrGz0sihrRA06oFuD6jUWAvPRNr\n\tLjX1HE=","X-Received":"by 2002:a05:600c:4510:b0:48f:e230:80a2 with SMTP id\n\t5b1f17b1804b1-49042ae97f8mr340666265e9.32.1779877557516; \n\tWed, 27 May 2026 03:25:57 -0700 (PDT)","From":"Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>","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","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"When loading a config containing a nonzero \"camera_timeout_value_ms\"\n(as is required for externally-triggered cameras) it would crash as\nthe pipeline handler tried to access both the IPA and frontEndDevice\nbefore either had been created. Re-order to avoid the crash.\n\nFixes: cc74afcdbd3e (\"Make the controller min frame duration configurable\")\n\nSigned-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\n---\n .../pipeline/rpi/common/pipeline_base.cpp        | 16 ++++++++++------\n 1 file changed, 10 insertions(+), 6 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex ace38997..263a4838 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -878,6 +878,16 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n \tdata->ipa_->setLensControls.connect(data, &CameraData::setLensControls);\n \tdata->ipa_->metadataReady.connect(data, &CameraData::metadataReady);\n \n+\t/*\n+\t * Disable the IPA signal to control timeout, when there is a\n+\t * user-requested value. We do this here now that the IPA and\n+\t * front end device are both initialized.\n+\t */\n+\tif (data->config_.cameraTimeoutValue) {\n+\t\tdata->ipa_->setCameraTimeout.disconnect();\n+\t\tdata->frontendDevice()->setDequeueTimeout(data->config_.cameraTimeoutValue * 1ms);\n+\t}\n+\n \treturn 0;\n }\n \n@@ -1145,12 +1155,6 @@ int CameraData::loadPipelineConfiguration()\n \tconfig_.cameraTimeoutValue =\n \t\tphConfig[\"camera_timeout_value_ms\"].get<unsigned int>(config_.cameraTimeoutValue);\n \n-\tif (config_.cameraTimeoutValue) {\n-\t\t/* Disable the IPA signal to control timeout and set the user requested value. */\n-\t\tipa_->setCameraTimeout.disconnect();\n-\t\tfrontendDevice()->setDequeueTimeout(config_.cameraTimeoutValue * 1ms);\n-\t}\n-\n \tconfig_.controllerMinFrameDurationUs =\n \t\tphConfig[\"controller_min_frame_duration_us\"].get<double>(config_.controllerMinFrameDurationUs);\n \n","prefixes":[]}