Skip to content

PTP and Network Time Sync

Current head rigs keep their own cameras in step with wires, not networks. RoboCap’s six-camera hat, for example, exposes all six cameras “from a single PWM frame-synchronization signal generated by the main controller and fanned out through a 1-to-6 clock buffer” (Ali et al., 2026), and Meta’s Ego-1K rig surrounds a Quest 3 headset with “12 synchronized cameras” (Lee et al., 2026). That is hardware sync, and it stays on the wearer.

Network time solves the problem around the wearer: fixed room cameras in an ego-exo capture space, depth sensors, and several recording computers that each stamp their own sensors. This page goes deeper into the Precision Time Protocol (PTP) and its Linux tools, chrony as the fallback when PTP hardware is missing, and how Ethernet machine-vision cameras use PTP to expose together. The overview, with accuracy figures for every method, is on software and visual sync and sync methods compared. Terms such as offset, drift and jitter are defined on why synchronisation matters.

For the field guide’s terms in one place, grouped by topic, see the glossary.

Term Meaning
PTP (IEEE 1588) A protocol that synchronises clocks over Ethernet by exchanging timestamped messages. Cameras and Linux tools implement IEEE 1588-2008, “also known as PTP Version 2” (Basler).
Grandmaster clock The root time source of a PTP network, “often receiving highly accurate time information from sources like Global Positioning System (GPS) or atomic clocks” (e-con Systems).
Ordinary clock An end device with one PTP port, such as a camera or a recording PC.
Boundary clock A device with several PTP ports, such as a PTP switch, that takes time from upstream on one port and serves it on the others.
Transparent clock A PTP switch that forwards PTP messages and corrects them for the time they spent inside it. ptp4l implements end-to-end and peer-to-peer variants (ptp4l(8)).
PHC (PTP hardware clock) A clock on the network card itself. With hardware timestamping, PTP packets are stamped by this clock as they are sent and received (Red Hat).
Synchronise and syntonise PTP does both: it sets each local clock “as precisely as possible to the time of the master clock”, and adjusts its frequency so that “the duration of a second” matches (Basler).
E2E and P2P delay The two ways PTP measures path delay: end-to-end (“delay request-response”) between each device and the master, or peer-to-peer link by link (Basler).
One-step and two-step In one-step operation “one message is sent”, carrying its own departure timestamp; in two-step operation a second message carries the timestamp (Basler).
ARB timescale The arbitrary timescale a PTP network runs on when no device follows world time (TAI or UTC).
Scheduled action command A GigE Vision 2.0 command that tells cameras to act, for example to start an exposure, at a given future PTP time.

Without sync, each camera counts from power-on on its own crystal. Sony’s engineers describe the result for networked cameras: “these time stamps gradually go out of synchronization as time passes owing to discrepancies in the clocks’ frequencies” (Eikawa, 2017). PTP exchanges timestamped messages with the master clock and corrects both the offset and the rate of every other clock.

The PTP delay request-response exchange Two timelines running down the page, the master clock on the left and a camera's clock on the right. The master sends a Sync message at time t1 on its clock; the camera receives it at t2 on its own clock. In two-step mode a Follow_Up message then carries the exact value of t1. The camera sends a Delay_Req at t3; the master receives it at t4 and returns t4 in a Delay_Resp message. With all four timestamps the camera computes the mean path delay as ((t2 minus t1) plus (t4 minus t3)) divided by 2, and its offset from the master as ((t2 minus t1) minus (t4 minus t3)) divided by 2, then corrects its clock. The calculation assumes the delay is the same in both directions; any asymmetry, for example a switch that queues packets for varying times, turns into offset error. Master clock Camera clock t1 t2 t3 t4 Sync Follow_Up (carries t1) Delay_Req Delay_Resp (carries t4) time mean path delay [(t2 − t1) + (t4 − t3)] / 2 camera offset from master [(t2 − t1) − (t4 − t3)] / 2 Assumes the delay is equal both ways. Any asymmetry, such as a switch queuing packets for varying times, becomes offset error.
The IEEE 1588 delay request-response exchange. Four timestamps, two taken on each clock, give both the path delay and the camera's offset from the master, which the camera then corrects. The maths assumes the delay is the same in both directions, which is why non-PTP switches that queue packets unevenly show up as offset error.

The devices elect a master automatically. Basler: “The master clock is determined by several criteria. The criterion with the highest precedence is the device’s Priority 1 setting”, and “The network device with the lowest Priority 1 setting is the master clock” (the full rules are in IEEE 1588-2008, clause 7.6.2.2). On Basler ace 2 and dart M cameras, BslPtpPriority1 can be set “between 0 (highest priority) and 255 (lowest priority)” to force or prevent a camera becoming master; on other Basler models it “is preset to 128 and can’t be changed” (Basler). To make a Linux PC or a GPS grandmaster win, give it a lower Priority 1 than the cameras.

A PTP network agrees with itself, not necessarily with the world. Basler: “If no device in the network is synchronized to a coordinated world time (e.g., TAI or UTC), the network will operate in the arbitrary timescale mode (ARB). In this mode, the epoch is arbitrary, as it is not bound to an absolute time.” SVS-Vistek makes the same point: “If a fixed relation to the real world time is to be established, a separate device based on Network Time Protocol (NTP) or Global Positioning System (GPS) must take over the function of the master” (SVS-Vistek). If you need to line PTP-stamped room video up with devices on other clocks, either feed the grandmaster from GPS or NTP, or add a visual sync event that every device sees.

Two details matter when writing capture software for GigE Vision cameras (Basler):

  • Timestamp width. “IEEE 1588 defines 80-bit timestamps for storing and transporting time information. Because GigE Vision uses 64-bit timestamps, the PTP timestamps are mapped to the 64-bit timestamps of GigE Vision.”
  • Tick rate. “On ace Classic/U/L cameras, enabling PTP clock synchronization changes the camera’s internal tick frequency from 125 MHz (= 8 ns tick duration) to 1 GHz (= 1 ns tick duration)”; “On other cameras, the tick frequency is always 1 GHz.” Code that converts ticks to seconds must know which applies.

PTP’s accuracy depends on where packets are timestamped. Red Hat: “Hardware PTP support provides better accuracy since the NIC can time stamp the PTP packets at the exact moment they are sent and received while software PTP support requires additional processing of the PTP packets by the operating system.” With hardware support, “PTP is capable of sub-microsecond accuracy, which is far better than is normally obtainable with NTP” (Red Hat). Red Hat gives no figure for software timestamping.

Switches matter as much as network cards. Ordinary switches queue packets for varying times. Red Hat warns that non-PTP hardware “will often cause an increase in jitter or introduce an asymmetry in the delay resulting in synchronization inaccuracies”, and recommends “that all networking components between PTP clocks are PTP hardware enabled”. Basler’s advice is the same: “For maximum precision, choose high-quality network hardware, use PTP-enabled network switches, and add an external PTP clock device with a GPS receiver to your network.”

The protocol settings must agree across the network. Basler documents three for its cameras:

Setting Options What Basler says
Delay mechanism E2E (default) or P2P “In most cases, use end-to-end delay measurement. Only use peer-to-peer if your entire network is set up for peer-to-peer delay measurement.” With P2P, the network mode “can’t be set to Hybrid” and the camera “always operates in two-step mode”. Older models are fixed at E2E.
One-step or two-step One-step or two-step On ace 2 and dart M, “two-step operation is disabled by default”; on other models “two-step operation is always enabled”.
Network mode Multicast (default), Hybrid, Unicast Multicast “is the default mode and sufficient for most use cases”. Hybrid mixes multicast and unicast; “This saves network load”. Unicast needs every device to “support unicast negotiation”.

On Linux, PTP runs with linuxptp, “a PTPv2 implementation according to the IEEE standard 1588 for Linux” (Red Hat). A Linux PC can be an ordinary clock that follows the network, or the grandmaster that the cameras follow.

Program What it does (from the linuxptp manual index)
ptp4l Runs PTP on network ports: “PTP Boundary/Ordinary/Transparent Clock”.
phc2sys “Synchronize two or more clocks”, typically the system clock and the network card’s PHC.
ts2phc “Synchronizes one or more PTP Hardware Clocks using external time stamps”, such as a GPS pulse-per-second edge.
pmc “PTP management client”, for querying a running ptp4l.
phc_ctl Directly controls a PHC.
hwstamp_ctl Sets “time stamping policy at the driver level”.
timemaster Runs “NTP with PTP as reference clocks”.

Query the interface with ethtool -T eth3 (replace eth3 with your interface). Red Hat lists the flags to look for. Hardware timestamping needs SOF_TIMESTAMPING_RAW_HARDWARE, SOF_TIMESTAMPING_TX_HARDWARE and SOF_TIMESTAMPING_RX_HARDWARE; software timestamping needs SOF_TIMESTAMPING_SOFTWARE, SOF_TIMESTAMPING_TX_SOFTWARE and SOF_TIMESTAMPING_RX_SOFTWARE. The output also gives the card’s PTP Hardware Clock index; index 0 is the device /dev/ptp0.

Terminal window
# Hardware timestamping (the default), end-to-end delay (the default), log to stdout
ptp4l -i eth3 -m
# A card without hardware timestamping
ptp4l -i eth3 -m -S
# Peer-to-peer delay, only if every switch on the path supports it
ptp4l -i eth3 -m -P

From the ptp4l manual: -i specifies a port, -m prints messages to standard output, -H and -S select hardware and software timestamping, and -E selects end-to-end delay, “This is the default mechanism”. -s enables client-only mode, which stops the PC from ever becoming master. Red Hat: “Do not run more than one service to set the system clock’s time at the same time”, so stop chronyd, ntpd or systemd-timesyncd from steering the same clock.

Step 3: bridge the network card’s clock and the system clock

Section titled “Step 3: bridge the network card’s clock and the system clock”

With hardware timestamping, ptp4l steers the clock on the network card, not the computer’s system clock (CLOCK_REALTIME), which is what most recording software uses to stamp frames. Red Hat: “The phc2sys program is needed only with hardware time stamping, for synchronizing the system clock to the PTP hardware clock on the network interface card”. The direction depends on the PC’s role (phc2sys manual):

Terminal window
# PC follows the PTP network: copy the card's clock into the system clock,
# waiting until ptp4l is synchronised
phc2sys -s eth3 -w -m
# PC is the grandmaster for the cameras: copy the system clock into the card
phc2sys -c eth3 -s CLOCK_REALTIME -w -m
# Or let phc2sys follow ptp4l's port state and choose the direction itself
phc2sys -a -r

-s names the source clock and -c the clock to steer (the default is CLOCK_REALTIME); -w means “Wait until ptp4l is in a synchronized state”; -a reads the clocks from the running ptp4l and follows changes in port state, and needs -r to steer the system clock at all.

With -u (summary updates) set, phc2sys prints summary lines such as Red Hat’s example rms 194 max 457 freq -37084 ± 174 delay 2753 ± 12. The default prints each sample instead; the phc2sys(8) man page: “If zero, the individual samples are printed instead of the statistics.” and “The default is 0 (disabled).” Add, for example, -u 60 to get one summary line per 60 clock updates. In a summary line the first two values are the RMS and maximum offset in nanoseconds over the summary interval, freq is the frequency correction in parts per billion, and delay is the time taken to read the card’s clock. Watch rms and max during a session; a rising maximum or a change of port state in the ptp4l log (for example out of SLAVE) marks a take whose timestamps need checking.

When PTP hardware is missing: NTP with chrony

Section titled “When PTP hardware is missing: NTP with chrony”

Many small computers and laptops have no hardware PTP support, and many switches are not PTP-aware. chrony, an NTP implementation, is then the practical choice for keeping recording computers together, and it can do better than NTP’s reputation on a local network. The chrony FAQ says that with “local hardware timestamping, good network switches, and even shorter polling intervals, a sub-microsecond accuracy and stability of a few tens of nanoseconds might be possible.” Without them, accuracy depends on network jitter: in chrony’s own simulated comparison, a client’s clock error was 35 ± 8 µs with 10 µs of network jitter and 1603 ± 447 µs with 10 ms of jitter.

A capture space usually has no internet time it can rely on, so one machine serves time to the rest. The directives below are from the chrony.conf manual:

# On the time server (one recording PC)
local stratum 8 # serve time even with no upstream source
allow 192.168.10.0/24 # let the capture subnet query this server
hwtimestamp * # use NIC hardware timestamps where supported
# On every other recording PC
server 192.168.10.1 iburst xleave
hwtimestamp *

iburst makes the first update faster, xleave “enables the interleaved mode of NTP”, which with hardware timestamps “can significantly improve the accuracy and stability of the measurements”, and hwtimestamp “enables hardware timestamping of NTP packets sent to and received from the specified network interface”. Check the result with chronyc tracking and chronyc sources (chronyc manual).

Clock sync of either kind aligns the computers’ clocks. It does not align when a USB camera actually exposed: if frames are stamped on arrival, the USB and operating-system delays described on why synchronisation matters remain.

Enabling and verifying PTP on GigE Vision cameras

Section titled “Enabling and verifying PTP on GigE Vision cameras”

Basler’s documentation is the most detailed public procedure, and other GenICam cameras follow similar steps under their own parameter names (Basler):

  1. Enable PTP. “When powering on the camera, PTP is always disabled. If you want to use PTP, you must enable it.” Set GevIEEE1588 to true (or PtpEnable on ace 2 and dart M). If an external device is master, “Basler recommends an ANNOUNCE interval of 2 seconds and a SYNC interval of 0.5 seconds.”
  2. Wait. “Depending on your network setup, this may take a few seconds or minutes.”
  3. Latch a snapshot. Execute GevIEEE1588DataSetLatch (or PtpDataSetLatch), so that “all parameter values in the latched data set refer to exactly the same point in time”. Read GevIEEE1588StatusLatched rather than GevIEEE1588Status, which “is not tied to the GevIEEE1588DataSetLatch command”.
  4. Wait until the state is no longer Initializing.
  5. Check lock. On ace 2 and dart M, “If the parameter value is Locked, the respective device should be sufficiently synchronized.” On other cameras, read GevIEEE1588OffsetFromMaster from every slave “until the highest offset from master is below a certain threshold (according to your requirements, e.g., 1 millisecond)”. Because the servo keeps adjusting, “the offset is not decreasing monotonically. Basler recommends that you check the maximum GevIEEE1588OffsetFromMaster parameter value within a given time window”. Set the threshold from your own error budget.
Parameter What it reports or controls
GevIEEE1588 / PtpEnable Turns PTP on; off at every power-up.
BslPtpPriority1 Priority 1 on ace 2 and dart M, 0 to 255; lowest wins.
GevIEEE1588DataSetLatch / PtpDataSetLatch Takes a consistent snapshot of the PTP state.
GevIEEE1588StatusLatched Port state: Initializing, Faulty, Disabled, Listening, Pre_Master, Master, Passive, Uncalibrated or Slave.
PtpServoStatus Locked when synchronised, otherwise Unknown (ace 2 and dart M).
GevIEEE1588OffsetFromMaster “estimated temporal offset between the master clock and the clock of the current PTP device in ticks (1 tick = 1 nanosecond)”.
GevIEEE1588ParentClockId / PtpGrandmasterClockID ID of the current master or grandmaster. Every camera should report the same one.

From a shared clock to simultaneous exposure

Section titled “From a shared clock to simultaneous exposure”

A common PTP clock gives synchronised timestamps, not synchronised exposures (see two meanings of in sync). Two free-running 30 fps cameras whose clocks agree perfectly can still expose at unrelated phases, so their nearest frames can be up to half a frame period apart: 33.3 / 2 = 16.7 ms.

GigE Vision added a fix. Earlier action commands were sent to all cameras at once, but “there were still some inconclusive elements, such as delays in network propagation and delays in firmware processing”. GigE Vision 2.0 combined them with IEEE 1588 so that each camera is told a time at which to act, rather than acting when the packet arrives (Eikawa, 2017). Basler lists the features PTP enables on its cameras as “Periodic Signal”, “Scheduled Action Commands” and “Synchronous Free Run”.

The published figures are vendor statements:

  • Sony. For free-running cameras whose exposure start is aligned to the grandmaster: “Although this is affected by the network environment, it is ideally possible for exposure synchronous control to be performed within 1μs”, with the figure caption “it is possible to drive exposure synchronization to within ±1μs” (Eikawa, 2017).
  • SVS-Vistek. “The maximum deviation that can be achieved is 10 µs, which enables very precise synchronization of all devices involved” (SVS-Vistek).

With Power over Ethernet, Sony notes, “only one cable is required for exposure synchronization, image output and the power supply.”

  • No instant trigger. SVS-Vistek: “It is necessary to know the future time of triggering (ad-hoc event-based triggering is not possible)”, and “A common immediate trigger (“NOW I want to trigger all cameras”) is not supported by PTP.” Event-driven capture still needs a wire.
  • Devices that do not speak PTP. In 2017 Sony described linking cameras’ general-purpose outputs to PTP time as a plan (“Sony is planning to link the new camera series to GPO”), not a shipped feature, so check what your camera’s outputs can do. In the other direction, a GPS receiver’s or microcontroller’s pulse-per-second signal can discipline a Linux grandmaster’s network card with ts2phc; the hardware sync page covers PPS.

These prompts ask for code you can check yourself; read the output before trusting it.

Wait for GigE cameras to lock before recording

Section titled “Wait for GigE cameras to lock before recording”
Write a Python script using pypylon that opens every Basler GigE camera found,
enables PTP (PtpEnable on ace 2 / dart M, GevIEEE1588 on other models), then
blocks until all cameras are synchronised, following Basler's documented check:
execute the DataSetLatch command, read GevIEEE1588StatusLatched and wait until
it is no longer Initializing; on cameras with PtpServoStatus wait for Locked;
otherwise sample GevIEEE1588OffsetFromMaster (1 tick = 1 ns) once per second and
pass only when the maximum absolute offset over a rolling window stays below a
threshold. Take the threshold, the window length and the overall timeout as
required command-line arguments with no defaults. Check that all cameras report
the same GevIEEE1588ParentClockId, print a status table while waiting, and exit
with an error on timeout.
Write a Python script that parses logs from `ptp4l -m` and `phc2sys -m` recorded
during a capture session, plus a CSV of take start and end times. Extract the
offset (ns), frequency (ppb) and delay over time, and every port state change.
For each take, report the RMS and maximum absolute offset and any state change,
and flag takes whose maximum offset exceeds a threshold given on the command
line. Save one plot per take.