Repository navigation
camera_streamer: add a UDP clock exchange responder to the sender - #1475
Open
gareth-morgan-nv wants to merge 2 commits into
Open
gareth-morgan-nv wants to merge 2 commits into
gareth-morgan-nv wants to merge 2 commits into
Conversation
…LOCK_MONOTONIC
ClockResponder is a stateless, unauthenticated UDP responder that lives as long as the sender process, whether or not a
receiver is connected. A datagram of exactly 13 bytes ('Q', u32 seq, i64 t1, little-endian) is answered to its source
with 29 bytes ('R', seq, t1 echoed, t2, t3) where t2 is read as soon as the receive returns and t3 immediately before
the send, both on CLOCK_MONOTONIC; anything else is ignored. The requester matches replies to its outstanding (seq, t1)
and resets on a media session change, so the responder keeps no session state. network.clock_port (0 = off, the default)
turns it on. Tests cover the payload encoding, a loopback round trip, bursts, malformed datagrams, concurrent clients,
prompt shutdown, bind errors and the config key.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Gareth Morgan <gmorgan@nvidia.com>
gareth-morgan-nv
requested review from
farbod-nv,
jiwenc-nv,
jsepulveda-nvidia and
tengw-nv
November 11, 2026 04:34
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 11, 2026
gareth-morgan-nv
had a problem deploying
to
dev
November 11, 2026 05:36 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets the sender answer a four-timestamp clock exchange over UDP on its
CLOCK_MONOTONIC, so a receiving host can measure the offset between its clock and the sender's. It is independent of the camera backend and of the AVS1 timing record, and off by default.What changed
ClockExchange: the 13-byte request (Q,u32 seq,i64 t1) and 29-byte reply (R,seq,t1echoed,t2,t3), little-endian;t2andt3are the sender'sCLOCK_MONOTONICin nanoseconds.ClockResponder: a stateless UDP responder started with the sender and kept for the life of the process, whether or not a receiver is connected.t2is read as soon as the receive returns andt3just before the reply is sent. Anything that is not exactly one request is ignored.network.clock_port(0 = off, the default) sets the port. The README documents the exchange and how a requester computes round-trip delay and offset from its ownt1andt4.Validation
clang-format-14andpre-commitclean on the changed files.clock_exchangeandclock_responder, plus theconfigkey, built and run by hand on a PC.Known limitations / follow-ups
session_idchanges or the connection is re-established; the responder keeps no session state.Test plan
🤖 Generated with Claude Code