J
Jeff Geerling·TechHow did Apple make this work??
TL;DR
Apple syncs HomePod mini stereo pairs using gPTP (IEEE 802.1AS), a precision timing protocol that continuously aligns the two speakers' clocks over Wi-Fi to nanosecond accuracy.
Key Points
- 1.The core problem is phase-syncing two wireless speakers with no physical connection. Wired speakers are easy to sync via known cable length, but wireless speakers placed anywhere must stay perfectly in phase or produce comb filtering artifacts.
- 2.HomePod mini setup requires an iPhone or iPad — a Mac alone cannot do it. Apple uses NFC-like proximity detection and ties the device to an Apple ID account, frustrating users who just want a simple Bluetooth-style speaker.
- 3.Packet capture via Apple's Wireless Diagnostics tool revealed the synchronization mechanism. The tool saved a PCAP file to /var/tmp, which Jeff opened in Wireshark to inspect all Wi-Fi traffic on channel 100 of his 5 GHz network.
- 4.Apple uses gPTP (generalized Precision Time Protocol), specifically IEEE 802.1AS, for clock synchronization. The two HomePods exchange four messages — Sync, Follow_Up, Delay_Req, and Delay_Response — in a leader/follower pattern to calculate network latency and align their clocks.
- 5.The timing accuracy can reach tens of nanoseconds on a low-congestion network, or microseconds on a busy one. This sync runs continuously every few seconds, so speakers stay aligned even if network conditions shift — no manual reset needed after moving them.
- 6.Apple wraps gPTP inside AVB (Audio Video Bridging), a suite of industry standards for media synchronization. This is why playback has a ~2-second buffer delay but video and audio remain perfectly lip-synced — the Mac maps video frames to audio timestamps across both speakers.
- 7.Apple is using open industry standards, not a proprietary protocol, which enables third-party support. The open-source project airplay2-rs lets a Raspberry Pi stream to HomePod stereo pairs using software-defined PTP, contrasting with Sonos's original 2004–2005 custom protocol (predating gPTP's ~2009 introduction).
Life's too short for long videos.
Summarize any YouTube video in seconds.
Quit Yapping — Try it Free →