I’ve looked at the packets a bunch this morning, and have a theory as to why the Say call delays for soo long prior to speaking.
Looking over the raw TCP data, you can see that once the request to retrieve the URL (x-rincon-mp3radio://:80/Say.nnn.mp3) has been made upon the Sonos, it instantly turns that around into a call to the Vera unit to get the content… and the content is returned.
The delays here, for the initial connections, are ~5-10ms (tops) as far as I can see, and it only takes a few ms to download the content.
This is where it gets interesting.
The content from Vera’s lighttpd has the correct content-length header, and it’s using Keep-Alives so the connection stays “open” at the end of the download for ~5s before it’s terminated.
I suspect that the Sonos unit, driven by the “[tt]x-rincon-mp3radio[/tt]” directive, is waiting for more stuff to come down and fill it’s buffers… and only starts playing it once we hit the FIN on the connection.
Timing wise, this [roughly] lines up.
If true, then the only way to “fix” the delay would be to find an alternative to the “mp3-radio” style of download, or [potentially] to provide Sonos with the supporting metadata to let it know what the length is (previously experimented with no luck).
The last option, for those wanting fast TTS, is to move them to a NAS, since these always play fast, and manually use the save & restore hooks.
BTW: In my rough timings, we add ~1000ms to “save” the state prior to playing. Most of this is lost in the various synchronous UPnP calls made to get the most-recent state. We could probably reduce this by providing an option of “tolerance” that’s used to work out if we need to re-fetch all the values, or just store “the last known set” that we have (as long as it’s within a tolerance)
[quote=“lolodomo, post:735, topic:169644”]7 seconds is the minimum time for the Sonos to start the playback of the file. I have not checked but I suppose it is done in background.
The files to download from Google are not very big and so the download time is very short. When I select a radio, it does not take so much time to start. I don’t really understand.[/quote]