Patch Detail
Show a patch.
GET /api/1.1/patches/22684/?format=api
{ "id": 22684, "url": "https://patchwork.libcamera.org/api/1.1/patches/22684/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22684/", "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": "<20250122145349.7220-4-david.plowman@raspberrypi.com>", "date": "2025-01-22T14:53:45", "name": "[v4,3/7] controls: Add camera synchronisation controls for Raspberry Pi", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a521f3c118561869090607e1eb5eb8f6a998c088", "submitter": { "id": 42, "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api", "name": "David Plowman", "email": "david.plowman@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22684/mbox/", "series": [ { "id": 4964, "url": "https://patchwork.libcamera.org/api/1.1/series/4964/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4964", "date": "2025-01-22T14:53:47", "name": "Camera synchronisation", "version": 4, "mbox": "https://patchwork.libcamera.org/series/4964/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22684/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22684/checks/", "tags": {}, "headers": { "Return-Path": "<kieran.bingham@ideasonboard.com>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": [ "parsemail@patchwork.libcamera.org", "kbingham@ideasonboard.com" ], "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A24DDBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Jan 2025 11:52:25 +0000 (UTC)", "from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net\n\t[86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C93B886\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Jan 2025 12:51:17 +0100 (CET)", "from perceval.ideasonboard.com\n\tby perceval.ideasonboard.com with LMTP id 6GGVKk8GkWffRjQA4E0KoQ\n\t(envelope-from <libcamera-devel-bounces@lists.libcamera.org>)\n\tfor <kbingham@ideasonboard.com>; Wed, 22 Jan 2025 15:53:03 +0100", "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\tby perceval.ideasonboard.com (Postfix) with ESMTPS\n\tid 843721081;\tWed, 22 Jan 2025 15:53:03 +0100 (CET)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6573D68549;\n\tWed, 22 Jan 2025 15:54:03 +0100 (CET)", "from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com\n\t[IPv6:2a00:1450:4864:20::32e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DDEB96855B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jan 2025 15:53:55 +0100 (CET)", "by mail-wm1-x32e.google.com with SMTP id\n\t5b1f17b1804b1-436345cc17bso50869475e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jan 2025 06:53:55 -0800 (PST)", "from raspberrypi.pitowers.org\n\t([2a00:1098:3142:1f:ffc9:aff6:7f7f:893b])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-438b66dc08bsm11551395e9.37.2025.01.22.06.53.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 22 Jan 2025 06:53:54 -0800 (PST)" ], "Authentication-Results": [ "perceval.ideasonboard.com;\n\tdkim=permerror header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.a=rsa-sha1 header.s=google header.b=eFK2Mi5v; \n\tdkim-atps=neutral", "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"eFK2Mi5v\";\tdkim-atps=neutral" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1737557635; x=1738162435;\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=O7R7laaCtTqG8D2rZUcpq6OOb09xjPw1X7M9gCXqZtw=;\n\tb=eFK2Mi5vXwnBjvUTtg1eCszTu6K9NyabtvPKYJM2iUXZJGN+DrhJDU1diVw6SyJ/Lg\n\tzumlk67UX/ax72N/0YrUsulaa63mUqDLp+Jg/tZqRsswi6JgDrp5UeSozatBgXWpcpny\n\tLAFUcX4xWWgHOHo2npfT/sSi14Vq2mapB35zBiRaeD0XULDBM6vnJx9QZNIfcZTVni5R\n\thhSXX5gawe4wn49ckYpF/UaXmEVLWlEeCleS4ROzsJ4PtwOBxbUZnypXDfibD+lKdJLk\n\tq6pvwefxQKswnCCdtBbeey7i2jEHPXe/3lb9ExbOze8/vUicC5AAWwLTKZcnZui77OfL\n\tB95g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1737557635; x=1738162435;\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=O7R7laaCtTqG8D2rZUcpq6OOb09xjPw1X7M9gCXqZtw=;\n\tb=rk3efMevmONCneAzZAb8kQ+6oH1xRRrgBFq1XX6v3Zz/DExNbpaFgLJpYRO8DtlQEc\n\tMVa561/CQFnQceivqfurPuKnNIO0N0Sl8VxzK6Gi/7UigI6pbPHDaGz+ATFjTC/lwIGV\n\tpiDz5InEKe7lN97xgKgWYnACo3sLchlwnpHQbFCTkeBjteWyQ6IqZoYRk6Q3z9/Vpx+w\n\tk9pAi+fP97XAf4sMtvejoebu60Li9Mc48RI4u3yiF89tj3zmIYHUSeDGr5vFmYKCB2O7\n\t2DRoIKCL3bjS2AbaqOe/ElfUyBKSxyf4Bty/UmloRwTtAKrfJVc7de68+q765fjk0Cm1\n\td+Nw==", "X-Gm-Message-State": "AOJu0YwJ6ZuRklPoO+zJ3umHynYYikdkdSrmK6zRqMVDXRs/AIgxEdjy\n\tMZMOyyUN9OaRCZy8F4L26fEEIEKLCu6AcCH6A0ScVxtQB1UQb0EK+UBVGCyNIt7iaLa8wY1pBtu\n\tA", "X-Gm-Gg": "ASbGncuaYfGpLVJmFQAt4VtGdO5VgHZICIz0O68znayjMx9/q7ui+mIAe07/QqVU+Uo\n\tfJ8nSuDs9c9nwX6ThV/G/mSW0fIHFOCmbihqO4V/grGM67t6sur337ce8GKRUAuqFm0GOza7JuU\n\t5cyXOrej8dgwfG58NdbABcK/5jOmWaMBDYKVEuFUzN6gj7N7xGYJwql2Se0MZp7VDvwAg2G9s7b\n\t5xjfxRebSJDoi24zkEmRrAkl1XE3YQWun1RgLjPoeVZ+HVqGPUzAGOuv6eRaSXO4EQAx8kQmjhy\n\tH8898qKkNyQ7jP4dFj5PWcqk3Q==", "X-Google-Smtp-Source": "=?utf-8?q?AGHT+IGpi0cXeCh2+UhsBDCXrY57k/541gnFyeV4o?=\n\t=?utf-8?q?4FVEN6ZPl7qu/PUKk8BIsjRUuqLyL8B+4ZpCw=3D=3D?=", "X-Received": "by 2002:a05:600c:3593:b0:431:55c1:f440 with SMTP id\n\t5b1f17b1804b1-4389144eea8mr240611075e9.30.1737557634830; \n\tWed, 22 Jan 2025 06:53:54 -0800 (PST)", "From": "David Plowman <david.plowman@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "David Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>", "Subject": "[PATCH v4 3/7] controls: Add camera synchronisation controls for\n\tRaspberry Pi", "Date": "Wed, 22 Jan 2025 14:53:45 +0000", "Message-Id": "<20250122145349.7220-4-david.plowman@raspberrypi.com>", "X-Mailer": "git-send-email 2.39.5", "In-Reply-To": "<20250122145349.7220-1-david.plowman@raspberrypi.com>", "References": "<20250122145349.7220-1-david.plowman@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>", "X-TUID": "r1puB9Q1dEfW", "Resent-From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "Resent-To": "parsemail@patchwork.libcamera.org" }, "content": "New 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>\n---\n src/libcamera/control_ids_rpi.yaml | 113 +++++++++++++++++++++++++++++\n 1 file changed, 113 insertions(+)", "diff": "diff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml\nindex 7524c5d2..5c2721c0 100644\n--- a/src/libcamera/control_ids_rpi.yaml\n+++ b/src/libcamera/control_ids_rpi.yaml\n@@ -58,4 +58,117 @@ controls:\n official libcamera API support for per-stream controls in the future.\n \n \\sa ScalerCrop\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": [ "v4", "3/7" ] }