While I realize that AirPlay has inherent lag/latency, I'm wondering if there's a way for a (currently hypothetical) iPhone app to detect what that latency is. If so, how precise can that latency value be? I'm more curious in whether an app can "know" its own AirPlay latency, rather than simply minimize it.
Using an AirPlay-enabled device for your audio content can result in a 2-second delay.
Usually the main cause of lag is a weak Wi-Fi signal, so you may be able to solve the problem if you can plug your Apple TV straight into your router using an Ethernet cable. If that's not an option, attempt to remove other devices that could be causing interference.
Restart your AirPlay device or Apple TV; you may need to disconnect power to do this. Restart your iOS device; press and hold the Side button with either Volume button, then slide to power off. Make sure there is only one device trying to stream at any time. Some third-party apps interfere with AirPlay.
The latency does not come from network jitter, but rather is decided by the source device (your iPhone).
Long story short:
Audio latency needs to be very accurate so that multiple outputs can play in sync.
Some explanations about AirPlay's implementation:
rtpTime
, the time at which the playback starts, which is also your latency. The typical value is 88200 = 2s x 44100 Hz.SYNC
packet to adjust the audio latency and make sure that all devices are still in sync.It's possible to change the latency if you use a custom implementation, but Apple usually rejects them.
Check this writeup for more information. You can also read the unofficial protocol documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With