From patchwork Sun Sep 6 13:44:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Birk Skyum X-Patchwork-Id: 28194 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 79FFCC3257 for ; Sun, 6 Sep 2026 14:04:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 947B268605; Sun, 6 Sep 2026 16:04:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=pm.me header.i=@pm.me header.b="McxdygVt"; dkim-atps=neutral Received: from mail-106120.protonmail.ch (mail-106120.protonmail.ch [79.135.106.120]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DF6E9685FE for ; Sun, 6 Sep 2026 15:44:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1788702261; x=1788961461; bh=I0RPm/b8RFlxaw8UjNO4R9t/aaP4bN7j6fWNM+7q/g0=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=McxdygVtYBGkm+raX2Y02uOXooXrmJxqov4EgeX2brRvEuJ49N7qtb6oNgj3hpcEW D4ie9j2EfD9pcDtuyNZRvZ+PIVgP9KmMxs2fT2XPXkqnFJ0ujnEuMQMOQcdsvrTzh1 15WJBXn9+OUJ1oKIkqmOjyCPIWiO7CKSLodPGpES4e+tcYAPLud5TIxYhuxX+RQXEp WWT9Q4eoDeR4zbfQjLDhxs772NaeUG/srIk34vWNSz3eHElb+YQuIp/63EZZeD4lQG eF8dbDuBf53Sh/eYgViNfeqC6o/VrE5lnll8VgkJZCi1DtIeNsoKNus1S8RgEAmkMf cCfwEFZHnYN4g== Date: Sun, 06 Sep 2026 13:44:18 +0000 To: "libcamera-devel@lists.libcamera.org" From: Birk Skyum Subject: [PATCH] libcamera: software_isp: Skip stop before worker start Message-ID: Feedback-ID: 21326998:user:proton X-Pm-Message-ID: 54f2413c7e069467a6581607e353fa50169f0a92 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 06 Sep 2026 16:04:21 +0200 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 startstreaming, 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 --- 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. The private AArch64 build passed 46 tests, with one expected failure, 30 skips and no unexpected failures. Runtime testing was on 0.7.2; the same unguarded stop path remains in current master. Reproducer and detailed results: 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);