Since everything was running on the same LAN, I expected the stream to feel almost local. It didn't.
About twice per second, the stream would freeze briefly and then catch up. The pattern was very consistent.
Bandwidth wasn't the issue, and CPU usage was low, so "the network is slow" wasn't the cause.
To investigate, I started pinging my router from the relay Mac with a very short interval:
`ping -i 0.01 <router-ip>`
The latency pattern was interesting. Most packets were fast, but every so often there was a spike of around 90 ms. The interval between those spikes matched the stutter in the stream almost exactly.
That was it.
It turned out to be AWDL (`awdl0`), the macOS interface used for AirDrop, AirPlay, and Handoff. When AWDL is active, macOS periodically switches Wi-Fi channels for a short time. During those channel hops, packets on the normal Wi-Fi connection can be delayed. In my case, the delay was roughly 90 ms.
After disabling AWDL (`sudo ifconfig awdl0 down`) or stopping the features that activate it, the stutter disappeared.
AWDL doesn't hop channels all the time. It usually becomes active when triggered by AirDrop discovery, AirPlay, or Bluetooth-based proximity features. If those stay idle, AWDL stays quiet.
I use Ethernet for the relay machine now. That completely removes the issue because the stream traffic never touches Wi-Fi.
Repo: github.com/jo-duchan/tapflow