Patch Detail
Show a patch.
GET /api/1.1/patches/23604/?format=api
{ "id": 23604, "url": "https://patchwork.libcamera.org/api/1.1/patches/23604/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23604/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20250619100857.124809-4-naush@raspberrypi.com>", "date": "2025-06-19T10:05:55", "name": "[3/4] controls: Add camera synchronisation controls for Raspberry Pi", "commit_ref": "1d1ba78b457d636a19c784784cea876f7776f7b4", "pull_url": null, "state": "accepted", "archived": false, "hash": "e74c320c5d32231d7c864b1361e678e9d9e9cfb3", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/23604/mbox/", "series": [ { "id": 5232, "url": "https://patchwork.libcamera.org/api/1.1/series/5232/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5232", "date": "2025-06-19T10:05:52", "name": "Wallclock support", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5232/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23604/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23604/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 1214AC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Jun 2025 10:09:12 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5C18968DF0;\n\tThu, 19 Jun 2025 12:09:07 +0200 (CEST)", "from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com\n\t[IPv6:2a00:1450:4864:20::42a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D65E68DC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Jun 2025 12:09:03 +0200 (CEST)", "by mail-wr1-x42a.google.com with SMTP id\n\tffacd0b85a97d-3a52878d37aso106284f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Jun 2025 03:09:03 -0700 (PDT)", "from NAUSH-P-DELL.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4535ebcecb5sm23926555e9.37.2025.06.19.03.09.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Jun 2025 03:09:02 -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=\"rFII36hj\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1750327743; x=1750932543;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=VZqGcoOUmsa4WYZ1V8vAzxzJY09zdLnQpU1CTW+aVRU=;\n\tb=rFII36hjAYf+OKlst3sjnVkEx6ifCOz3iY6NSYItDSRySEM4l4uwWSswR3KESglsa5\n\tw32jYtLw+QPiFJy9XLLeos1eBDs8Yo7eBQmQpT5GHX1AiVYiIR7JeHieAUi7Lgnhvnrj\n\tO1Jn90zBWd0Ew7FUTMNGMFlYCikxGV9fSXpXQuSlci7b0XOl8CqTDtF1Yr2/27tFcabL\n\t2F2QnILAuLnuVlBYmjs/G5KBRkMxGA/4BL4tzlDLHkyhixnQEevAM7j0wfWU0c6Xz9jp\n\tYGKkTbMaKk3CWjEp2yOs3UYqk79lGEvbRcRH67z0UWZcXloAyhrBAKluUDnmyrLSF85U\n\tI+qQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1750327743; x=1750932543;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=VZqGcoOUmsa4WYZ1V8vAzxzJY09zdLnQpU1CTW+aVRU=;\n\tb=f6hj4HlQDhI7TJMGYy5WQeoToWiWZvgk3cMdAokU3gvpbL3Kyqwq+XkuvWMMhS6nwQ\n\t1edCg+Z9QvWxcIgLG3IEwLbRH1t3JLw63SS0wRCFwi4aDSyHS2t+Gw/MWH7dJ5Gv8yBL\n\tAcFmWQjvKT42L0L25rP6j2WrRuN/9zimXZppoyIBTYWf7GWhl+QTGiHFa2q4fMy/RLMA\n\tS2cC4J+NSMWBsuo2w2AHmNGtXx+JX88WQBcyyHtQ6DZrQcEzdB3/1IXZ9etjElVNkfc4\n\tE2Iups7T0KaUUmLa/ITXl961SEf3YH0DnWH3BYa2t7uEzltpfEQZh1iG4Vl3ue5T/9/+\n\t+rzg==", "X-Gm-Message-State": "AOJu0YxrOegZWDnW9s6uVxy0k7LL3Cte/V8q8oW3EmQv3T3JfcD6WC4i\n\ta3FTCH/rexmqp/F4GHZRg8GrT8nT8pDUE/sXBKkXF8qJPPMX2Gn1m+8xSQa/pw0zuub2iTTzR6F\n\tXI9GU", "X-Gm-Gg": "ASbGncsb2sksO26B93+G6xaJeLSRpLxk2iCR6XhNW21fA5NJFet1p8UBiniGOKPljEz\n\twcGf7CeXCQ7DEJ34/r2RZAXZ9YJ8hpF4NnDStqfimGFq5vZVeJnsRlz3lps/5uniZtmJcFITbHU\n\t3zrqxI9WiUJ8ufLkjeHCdmHg0pNo+OsFl52G74ueRRdSk+SHEk/dWTwODrxvL3bCY08eDN/JnjG\n\thaV/eVWt6C+kNxN/KzgPtIsuijN6vzMrf22Khh6nOYc9MFYFVuTZmDWhMtqDEWFaSaZUtcueSxC\n\tUwNUbB6EugjX4u1rjxKdkCkur8qM8vwOd6zwadh+tLNg86u5fH9eLTTJ5f4fqfmGDDtxWAWCV9L\n\tZtj5Ssg==", "X-Google-Smtp-Source": "AGHT+IHbi7QHunVNcRrGYVkHjsesT6nScoXaHyPitcmFHcI8uRd+G+lhGL2rISJ/nkTiBxZJCGvaKg==", "X-Received": "by 2002:a05:6000:2002:b0:3a3:61ab:86c2 with SMTP id\n\tffacd0b85a97d-3a6c98fbfc7mr836626f8f.7.1750327742709; \n\tThu, 19 Jun 2025 03:09:02 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "kieran.bingham@ideasonboard.com,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>", "Subject": "[PATCH 3/4] controls: Add camera synchronisation controls for\n\tRaspberry Pi", "Date": "Thu, 19 Jun 2025 11:05:55 +0100", "Message-ID": "<20250619100857.124809-4-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20250619100857.124809-1-naush@raspberrypi.com>", "References": "<20250619100857.124809-1-naush@raspberrypi.com>", "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": "From: David Plowman <david.plowman@raspberrypi.com>\n\nNew controls are added to control the camera \"sync\" algorithm, which\nallows different cameras to synchronise their frames. For the time\nbeing, the controls are Raspberry Pi specific, though this is expected\nto change in future.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/control_ids_rpi.yaml | 112 +++++++++++++++++++++++++++++\n 1 file changed, 112 insertions(+)", "diff": "diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml\nindex 8d1e8b47c821..a861511233b6 100644\n--- a/src/libcamera/control_ids_rpi.yaml\n+++ b/src/libcamera/control_ids_rpi.yaml\n@@ -71,4 +71,116 @@ controls:\n \n \\sa StatsOutputEnable\n \n+ - SyncMode:\n+ type: int32_t\n+ direction: in\n+ description: |\n+ Enable or disable camera synchronisation (\"sync\") mode.\n+\n+ When sync mode is enabled, a camera will synchronise frames temporally\n+ with other cameras, either attached to the same device or a different\n+ one. There should be one \"server\" device, which broadcasts timing\n+ information to one or more \"clients\". Communication is one-way, from\n+ server to clients only, and it is only clients that adjust their frame\n+ timings to match the server.\n+\n+ Sync mode requires all cameras to be running at (as far as possible) the\n+ same fixed framerate. Clients may continue to make adjustments to keep\n+ their cameras synchronised with the server for the duration of the\n+ session, though any updates after the initial ones should remain small.\n+\n+ \\sa SyncReady\n+ \\sa SyncTimer\n+ \\sa SyncFrames\n+\n+ enum:\n+ - name: SyncModeOff\n+ value: 0\n+ description: Disable sync mode.\n+ - name: SyncModeServer\n+ value: 1\n+ description: |\n+ Enable sync mode, act as server. The server broadcasts timing\n+ messages to any clients that are listening, so that the clients can\n+ synchronise their camera frames with the server's.\n+ - name: SyncModeClient\n+ value: 2\n+ description: |\n+ Enable sync mode, act as client. A client listens for any server\n+ messages, and arranges for its camera frames to synchronise as\n+ closely as possible with the server's. Many clients can listen out\n+ for the same server. Clients can also be started ahead of any\n+ servers, causing them merely to wait for the server to start.\n+\n+ - SyncReady:\n+ type: bool\n+ direction: out\n+ description: |\n+ When using the camera synchronisation algorithm, the server broadcasts\n+ timing information to the clients. This also includes the time (some\n+ number of frames in the future, called the \"ready time\") at which the\n+ server will signal its controlling application, using this control, to\n+ start using the image frames.\n+\n+ The client receives the \"ready time\" from the server, and will signal\n+ its application to start using the frames at this same moment.\n+\n+ While this control value is false, applications (on both client and\n+ server) should continue to wait, and not use the frames.\n+\n+ Once this value becomes true, it means that this is the first frame\n+ where the server and its clients have agreed that they will both be\n+ synchronised and that applications should begin consuming frames.\n+ Thereafter, this control will continue to signal the value true for\n+ the rest of the session.\n+\n+ \\sa SyncMode\n+ \\sa SyncTimer\n+ \\sa SyncFrames\n+\n+ - SyncTimer:\n+ type: int64_t\n+ direction: out\n+ description: |\n+ This reports the amount of time, in microseconds, until the \"ready\n+ time\", at which the server and client will signal their controlling\n+ applications that the frames are now synchronised and should be\n+ used. The value may be refined slightly over time, becoming more precise\n+ as the \"ready time\" approaches.\n+\n+ Servers always report this value, whereas clients will omit this control\n+ until they have received a message from the server that enables them to\n+ calculate it.\n+\n+ Normally the value will start positive (the \"ready time\" is in the\n+ future), and decrease towards zero, before becoming negative (the \"ready\n+ time\" has elapsed). So there should be just one frame where the timer\n+ value is, or is very close to, zero - the one for which the SyncReady\n+ control becomes true. At this moment, the value indicates how closely\n+ synchronised the client believes it is with the server.\n+\n+ But note that if frames are being dropped, then the \"near zero\" valued\n+ frame, or indeed any other, could be skipped. In these cases the timer\n+ value allows an application to deduce that this has happened.\n+\n+ \\sa SyncMode\n+ \\sa SyncReady\n+ \\sa SyncFrames\n+\n+ - SyncFrames:\n+ type: int32_t\n+ direction: in\n+ description: |\n+ The number of frames the server should wait, after enabling\n+ SyncModeServer, before signalling (via the SyncReady control) that\n+ frames should be used. This therefore determines the \"ready time\" for\n+ all synchronised cameras.\n+\n+ This control value should be set only for the device that is to act as\n+ the server, before or at the same moment at which SyncModeServer is\n+ enabled.\n+\n+ \\sa SyncMode\n+ \\sa SyncReady\n+ \\sa SyncTimer\n ...\n", "prefixes": [ "3/4" ] }