Author Topic: Sonos - TTS  (Read 8019 times)

0 Members and 1 Guest are viewing this topic.

Darcy

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Sonos - TTS
« on: March 20, 2016, 01:01:58 PM »
Hi,

I'm using the Sonos plugin and version 2.2.1.6 of Voxcommando.  My Sonos software is up to date. For the most part everything is working fine, I'm just getting use to the commands.  One issue that I can't resolve is with the Sonos.TTS.Speak command is that sometimes (can't determine when it occurs exactly) I need to send the command twice to have the payload broadcasted on my speakers via Sonos.  I've used the "What time is it?" command that came with the configuration as well as many I've built myself.

Any ideas as to why this is occurring?

Thanks.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sonos - TTS
« Reply #1 on: March 20, 2016, 02:54:21 PM »
I think sometimes the Sonos can be a bit slow to react to changes and has trouble keeping up.  The instructions I send to the Sonos are mostly asynchronous, which means that VC does not wait for a response from the Sonos to confirm that it received the command that was sent to it.  This is mostly because the base library that I started with did it this way.  It's also good in general that VC does not get locked waiting for the Sonos.  In the case of TTS VC is trying to wait a reasonable time extra in addition to the length of the TTS wav file that it generates.  It's possible that certain Sonos are slower either because they are connected by Wifi instead of an ethernet cable, or because they are slower processors.

Patterns to look for would include, type of player, how it's connected to the network, and what if anything it is playing before the TTS is sent.  Is it happening more often when the player is playing an internet radio stream for example?

I can send you a test plugin with an increased delay to see if it helps.  I'm not 100% sure this is the cause but it seems likely.  In my initial testing I was having the same issue and increased the delay until it stopped (if I remember correctly - it's been a while).

The other possibility is for me to change the TTS to be synchronous, but this would probably be a lot more work.

I don't actually use my Sonos for TTS regularly at home because of the way I have my other systems working with my surround system attached to my HTPC but I can try to use it more this week to see if the same thing happens here.

I don't know if it will show anything but if you feel like sending me a log file that might help.

For what it's worth I have also seen situations where the Sonos is misbehaving and unplugging it has cleared up a lot of miscellaneous issues for me in the past.

Darcy

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #2 on: March 27, 2016, 10:25:02 PM »
Hi again James,

I'm still testing with this issue.  Most of my system (vc and sonos) is connected via ethernet, two zones are connected via wifi.  The issue appears in all cases.  What I've found so far is after a period of inactivity, when I try to use the sonos TTS command, vc recognizes it properly but sonos doesn't broadcast the payload.  Second time with same command and all works OK.   Any subsequent sonos TTS commands work as long as there's not a long time span between commands. 

I'll try a bit more, and if I can't figure it out I will send you a log file.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sonos - TTS
« Reply #3 on: March 29, 2016, 10:48:22 AM »
Yes, I'm seeing the same thing.  It works 99.9% of the time if it was used recently but less often if the Sonos has been inactive for a while.  I'm not sure if it's because the Sonos itself is going into a sort of sleep mode, or if it is the connection to the network share that slows down.  Either way it can probably be fixed.

As a test can you try to insert a Sonos.Player.GetVolume action in front of your TTS action to see if it forces the Sonos to wake up first?  If we can verify that it works I may just put that into the TTS action.  It would probably be good anyway to add a volume parameter to the TTS action, in which case the plugin would get the current volume, set the TTS volume, play the TTS wav, and then restore the original volume.  Of course you can do this now with actions but why not make it easier, especially if reading the volume fixes the TTS problem.

Darcy

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #4 on: March 29, 2016, 10:47:54 PM »
Hi,

I tried what you suggested and the problem still exists.  I tried sending two Sonos TTS in the same command and the first time it played the message once and the second time twice.  As well it seems that if a player is not used for 30 minutes, that is when the problem exists.  I tried at 5, 10 and 15 minutes and there was no problem.  So after about 30 minutes of inactivity, maybe Sonos executes a sleep mode.

fuzzysb

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #5 on: March 31, 2016, 09:24:57 AM »
I have been getting the same experience with this when the sonos goes into its low power state, i have gotten around it by creating a wav file from a text string of "," this just creates a small TTS Wav file of no audio, this plays first then i push my actual TTS text string and this works.

this means i get a reliable method of notifications without ever having duplication

 :biglaugh

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sonos - TTS
« Reply #6 on: April 01, 2016, 02:54:31 PM »
I think I may have solved this but need a bit more testing and I'm looking at some other changes to the Sonos plugin.

I'll try to post something new to test soon.

Darcy

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #7 on: April 01, 2016, 09:36:55 PM »
Thanks.  I look forward to the solution, in the meantime I'll try fuzzysb "work around".

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sonos - TTS
« Reply #8 on: April 03, 2016, 12:41:30 PM »
2.2.1.7 has an updated Sonos plugin and is available now:

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2.2.1.7

fuzzysb

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #9 on: April 04, 2016, 06:41:24 AM »
many thanks i am testing now

Darcy

  • Jr. Member
  • **
  • Posts: 10
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #10 on: April 04, 2016, 08:10:14 PM »
Hi,

I downloaded the update and it now responds with the first command.  Thanks!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sonos - TTS
« Reply #11 on: April 05, 2016, 08:37:55 AM »
 ::eyebrows

fuzzysb

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #12 on: April 09, 2016, 09:16:00 AM »
this so nearly works really well except sometimes now vixcommando gets into a state where it wont play any TTS as it states

Error: Unable to play WAV File: \\myserver\TTS\tts.wav
Object reference not set to an instance of an object.
plugin: C:\VoxCommando\Plugins\Sonos\sonos.dll

restarting VoxCommando fixes it, but i dont know why it gets into that state? and as its running on a headless server all my voice notifications just stop

I am also getting a hard application error where voxcommando crashes but that's far less frequent. i'll catch the details of that next time bu the error above is happening nearly every day



jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sonos - TTS
« Reply #13 on: April 09, 2016, 09:57:33 AM »
Are you using the same TTS voice in both the TTS plugin and the Sonos plugin?

fuzzysb

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Sonos - TTS
« Reply #14 on: April 10, 2016, 11:37:07 AM »
no, the TTS plugin is using the standard MS Hazel voice, and i am using a cereproc voice for the Sonos TTS