| Message ID | 20261130-camera-thread-v1-0-bca905afbeef@ideasonboard.com |
|---|---|
| Headers | show
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 [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id ADF8FC3304 for <parsemail@patchwork.libcamera.org>; Mon, 30 Nov 2026 08:30:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E20A26AA47; Mon, 30 Nov 2026 09:30:11 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WCc6EMbG"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D3B26A9D4 for <libcamera-devel@lists.libcamera.org>; Mon, 30 Nov 2026 09:30:09 +0100 (CET) Received: from [127.0.1.1] (chfd-03-b2-v4wan-176392-cust229.vm15.cable.virginm.net [82.19.20.230]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A2894DC; Mon, 30 Nov 2026 09:27:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1796027252; bh=RHajZvK8E/ZRuLI+oWit/rXLY9bGMiHL+pWWHkxhwRA=; h=From:Subject:Date:To:Cc:From; b=WCc6EMbGl84V/4F7PlWYL5J5ILGMRPFIYCifm8BSZZCW1HiWUSphYwR9PfhUO7HJX FvoaZ5ToTQu6Nm4m5NDH7D11+VIFxtUu0X1SaKwva5azTch+a62/u7eIyA6626ybkA 3/PILE0wWvRnFD9iqRSy0/fxu0gDLRhyO4nLEUaQ= From: Daniel Scally <dan.scally@ideasonboard.com> Subject: [PATCH 0/2] Move PipelineHandlers to their own thread Date: Mon, 30 Nov 2026 08:29:59 +0000 Message-Id: <20261130-camera-thread-v1-0-bca905afbeef@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAg0DWsC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzNDAwND3eTE3NSiRN2SjKLUxBTdNAtj0+Q0M5NEA4tUJaCegqLUtMwKsHn RsbW1ABazOHBfAAAA X-Change-ID: 20261001-camera-thread-f835cf64a08e To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally <dan.scally@ideasonboard.com> X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1742; i=dan.scally@ideasonboard.com; h=from:subject:message-id; bh=RHajZvK8E/ZRuLI+oWit/rXLY9bGMiHL+pWWHkxhwRA=; b=owEBbQKS/ZANAwAKAchJV3psRXUyAcsmYgBrDTQQj8y2iRWUUUG+hETWGAtU9HVNcj3jFRkpm Qclr78+1GWJAjMEAAEKAB0WIQQqyuwyDnZdb+mxmm/ISVd6bEV1MgUCaw00EAAKCRDISVd6bEV1 MieYD/9tRWhmfDI0ogM6OtmhmRa55D0e1LiAKaJNl8qgN3dRGSitjuXPT8J3qGBNKI6QSuGErjW sulbSequsV1S4JGIy4wIRY4vee4yDa0wGiOsccMc2UCeicGE+QhgyHncbJ5ZT4b1YzoolrHvuu0 3oWJMmrkr9s+1BEi4c9LNvcDk4bCdjmJQ1cXgL9D9wwQzjWfr962+LSwekOOIr5mF9EUSSUQwlm TUIWgAx89Uww3xXy9F9k597mOy9R1qoLdZt7/zF2n8MhnWejCiXf+dUXnCeyAq2M33GUt64hTPq T8H4mIxreRrgi5Atu1eg3JL1yICCCFTCf7EPbwd6MSpPJYbSlwrHDKZxTQs8OLa2h/xmWdpYS6+ C5ANZhwta0Kw/oJCGqB51NcPPi5KgKMuN1RD9TKymTZrNnXqSpips9JyYb11H3BCrM8xVvbH9N9 ldYcN8xw8BBPwWYyFfShJLZ/TMCr+4iKQ9a0Bdq8g5TMREt5Gn6LzH5BtA4nLuTU49PzDr6MWg8 2vYhwWN/g3ewEOfMfB8f57U6M6KwvX4a7nNcMdZt/IB66yIXMv7hKL40zmSBw9e4Y2Gt536jzxF EPZ04wQ8Hu4BAUGJWUGGPnPoMhDlTGpKsmqeVfqYMHaIxhnGqVAWTvsn1e++5V1Zys/dMSt8d+N YQvVLhbniFkJOqw== X-Developer-Key: i=dan.scally@ideasonboard.com; a=openpgp; fpr=EEC699ACA1B7CB5D31330C0BBD501C2A3546CCF6 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>, <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>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe> Errors-To: libcamera-devel-bounces@lists.libcamera.org |
| Series |
|
| Related |
show
|
Hello all In recent work with a multi-camera system we noticed that starting a camera on a system that already had one camera streaming caused interruptions to that already-running stream. One reason for this is that the ioctl()s that are a part of the stream-on path for the newly-starting camera were quite long running, and they are run in the same thread as the PipelineHandlers bufferReady / queueBuffer loops - the CameraManager thread. To ameliorate this issue this set moves PipelineHandlers into their own thread. Most calls to functions exposed by the class are called by the Camera class through invokeMethod(), though as both the Camera and PipelineHandler lived in the same thread before this change I'm not sure that was necessary - either way, it hasn't changed. The CameraManager calls PipelineHandler::match(), which now happens with invokeMethod() too. The topic will likely need revisiting when we have multi-context capable PipelineHandlers, as the same issue will naturally arise then too, but for now this method should be sufficient. Thanks Dan Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> --- Daniel Scally (2): libcamera: camera_manager: Allow other threads to create cameras libcamera: pipeline_manager: Move PipelineHandlers to unique thread include/libcamera/internal/pipeline_handler.h | 2 ++ src/libcamera/camera_manager.cpp | 11 ++--------- src/libcamera/pipeline_handler.cpp | 8 ++++++++ 3 files changed, 12 insertions(+), 9 deletions(-) --- base-commit: 7ae183f58d7c2ee8643f002560d3a616e2a77726 change-id: 20261001-camera-thread-f835cf64a08e Best regards,