node-sonos-http-api icon indicating copy to clipboard operation
node-sonos-http-api copied to clipboard

Avoiding latency when playing presets across zones?

Open ibogost opened this issue 3 years ago • 2 comments
trafficstars

After some testing, it seems that the more zones I add to a preset, the more latency I encounter before the action gets performed. A single zone (even actuated as a preset) is almost instantaneous. This is mostly an issue when using clippreset for non-music purposes, such as for doorbell sounds.

I'm just trying to understand what if any software/hardware limitation is at work here. Is there any?

If so, are there workarounds possible natively inside node-sonos-http-api, such as having a container action asynchronously call other actions? Obviously, I can make my own shell script to do this, but I'd love to be able to handle everything within the API call itself.

ibogost avatar Aug 01 '22 00:08 ibogost

IIRC, I saw problems with calling multiple players in parallel (mostly, the joining part, I assume), so I settled for doing everything sequential. This was a long time ago though, so not sure of the current state.

But there is also a lot of preparation for the coordinator (the player that becomes in charge of the playback) which needs to happen sequentially, since the calls depend on each other.

jishi avatar Aug 02 '22 19:08 jishi

Interesting. I assumed it was joining them, and that was the cause of the delay.

Here's what I notice: If I curl a request to a preset with even two rooms (zones), there's a noticeable delay, probably half a second or more. If I background (curl &) requests to two (or really, any number of) different preset plays, both play instantly. Again, I can write a shell script to do this, but it sure would be nice if the API itself would handle it.

ibogost avatar Aug 02 '22 22:08 ibogost