And that audio URI is then an ice cast with seconds of latency. This is different for the protocol that the speakers use to pipe audio to each other which is near real time.
Re:Open AirPlay 2 Receiver
by packetlost on Monday August 08, 2022 @04:37PM
(#32390690)
It might not be as realtime as you think, especially if it's buffered. You just need to sync timestamps and buffer for at least the slack in your system. I wouldn't be surprised if it was using NTP/PTP under the hood to sync up system clock time and then just playing back a buffer that's shared across all speakers (or just the channel for that speaker with a timestamp). The actual audio transfer probably gets buffered and only the relative timestamp and simple instructions like "play from this timestamp in the buffer" is actually being used to sync up between speakers. It's probably a limitation of the hardware or the lower-level wireless protocol (bluetooth or wifi) that causes that delay. I'm just speculating though, all of my realtime experience is in hard-realtime scientific control systems.
If you have a Sonos amp with an input plug, you can play that in near real time. There isn’t much buffering there. It’s low enough latency you can watch video and the lips looks like they match. There’s actually a setting where you can tell it the priority of the audio, which I assume just controls the buffer size.
Re:Open AirPlay 2 Receiver
by squeaky-clean on Monday August 08, 2022 @04:55PM
(#32390902)
It's probably a mixture of things. Just tried some of mine with the sonos app and there's always a slight 1-2s delay on play and seeking. But actions like pausing or adjusting the volume are instant. I can pump the volume slider in tempo with the music and there has to be only a few ms of latency.
Re:Open AirPlay 2 Receiver
by trynewideas on Monday August 08, 2022 @05:21PM
(#32391186)
I'd hope so. One of those things (initiating music playback or seeking outside of the playback buffer) involves realtime sequential data transmission, and the other (modifying local settings or playback state remotely without leaving the buffer) is just a byte or two in a packet, if that.
https://github.com/SoCo/SoCo
https://github.com/jishi/node-sonos-http-api
This allows you to e.g. set the Sonos speakers to play any audio URI.