From patchwork Mon Sep 7 10:40:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Birk Skyum X-Patchwork-Id: 28196 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 87009C3257 for ; Mon, 7 Sep 2026 10:40:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 890F368611; Mon, 7 Sep 2026 12:40:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=pm.me header.i=@pm.me header.b="Y8gqYUJy"; dkim-atps=neutral Received: from mail-244116.protonmail.ch (mail-244116.protonmail.ch [109.224.244.116]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 12EC0685E3 for ; Mon, 7 Sep 2026 12:40:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1788777632; x=1789036832; bh=mg+39krVBdzgfx26eP3XtFCxfwiU3dFfqK2mEwiPHUc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Y8gqYUJyrzObCQWfdrPbNofFTx0zNQ+P009f1IfdSWdBFepq6s0DdhbaRerw9p4ew N+7nxzAr57OmuoGUjpI5TYNBfAVXhxIREwuzjE8AISf6/KGeWSFBf9cQ8OWlVZA7KW d4/lI1Gwi+zKWFSsuaKKrUyEueczfcPZbkBF/TH0lD7Pm/xLj7BFM1HxZhfMfjohkQ 1YFzplHGHlVIIJt5D1iIqwUU4c0Pkf1TWrN/VKHj6LJ3Wfi5n9N0xXfIRacihuDUYZ FV30DV5xsagIZQogd6Lrclb9IT5sLghkcdNcVwdxtp24CNOtkGCSHi5iPHQ3cRmZph fePcynSAE4Lcg== Date: Mon, 07 Sep 2026 10:40:28 +0000 To: libcamera-devel@lists.libcamera.org From: Birk Skyum Cc: kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com Subject: [PATCH RESEND] libcamera: software_isp: Skip stop when the worker has not started Message-ID: <20260907104012.20897-1-birk.skyum@pm.me> In-Reply-To: References: Feedback-ID: 21326998:user:proton X-Pm-Message-ID: 10b2b88637011fb9ede90c212d31c8e2c2cc8a8f 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 simple pipeline calls stop() if the capture device fails to start streaming, before SoftwareIsp::start() has run. The blocking invocation of Debayer::stop() then waits indefinitely for a worker thread that is not running. Return early when the worker has not started so that Camera::start() can report the original capture error. Bug: https://gitlab.freedesktop.org/camera/libcamera/-/issues/349 Signed-off-by: Birk Skyum Reviewed-by: Kieran Bingham --- Resending inline with git send-email, as requested. The first inline submission had damaged whitespace, and the subsequent resend used an attachment. This resend preserves the code and adds Kieran's review tag. Tested on a Lenovo Yoga Slim 7x with libcamera 0.7.2. Injecting an ETIMEDOUT failure into VIDIOC_STREAMON causes the unpatched cam process to hang until an eight-second timeout. With this patch, cam promptly returns the capture-start error. This does not fix the underlying sensor-start failure. Original submission: https://patchwork.libcamera.org/patch/28194/ Review: https://lists.libcamera.org/pipermail/libcamera-devel/2026-September/061900.html Reproducer: https://gist.github.com/birkskyum/5ec156ca5654d7ac2251a275718c94b3 src/libcamera/software_isp/software_isp.cpp | 3 +++ 1 file changed, 3 insertions(+) base-commit: 191e202178f02430b5942397c70d215cdd2056fa diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index c73a16c..c801034 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -395,6 +395,9 @@ int SoftwareIsp::start() */ void SoftwareIsp::stop() { + if (!ispWorkerThread_.isRunning()) + return; + debayer_->invokeMethod(&Debayer::stop, ConnectionTypeBlocking);