Repository navigation
Description
Measuring required_lead_time and min_buffer accurately is still really challenging despite adding the server_transmitted field to stream/start and stream/clear. That gives a few data points, but the type of interruptions in low latency will almost never get captured by that info.
I was measuring my wifi environment (single family home, so not a dense apartment complex and relatively quiet RF wise) for some unrelated to Sendspin projects. I do have a doorbell camera that uses wifi, and on that channel is it will take over the air time 300ms+ at a time roughly every 5 minutes. We don't start and clear streams frequently enough to capture that, let alone capture it enough to assume it isn't an outlier. So on that wifi channel, all my measurements based on the stream/start ~100 ms or so, but in practice, every 5 minutes I will get a drop out. On another wifi channel (using my other AP), I have a neighbor's whose AP does a slow broadcast which interferes 100 to 200 ms every minute. This is the quieter channel and that signal is weak, but it will still cause disruptions. Again unless I get lucky and capture a stream/start or stream/clear at that window, I won't have any insight into it.
Two possible options that I can see:
- Use buffer underflows as my own single the buffer needs to increase. Easiest, but also the most misleading because not every underflow is due to network conditions (i.e., an OTA update check happens and slows us down for a long duration; that isn't typical and shouldnt' delay the latency for every client).
- Timestamp every binary audio chunk with the server's sent timestamp. I can then gather the statistics with a lot of data points and model it much better.
We should also consider allowing or even mandating using Opus for low latency streaming because clients can use Opus's native packet loss concealment to smooth out a small disruption. That's a big ask though...\
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
maximmaxim345 commentedon Aug 19, 2026
Music Assistant/aiosendspin can detect if a client implements other hard breaking changes and know if it is implementing the newer binary message format with timestamps.
kahrendt commentedon Aug 19, 2026
Add the sent timestamp to the binary message, option 2