Author Topic: When plugin support is enabled the system does not stop listening  (Read 9659 times)

Woofington

  • Jr. Member
  • **
  • Posts: 54
I use EDDI as a plugin into my extensive profile.  Though I have been having lots of issues this is a new one.  I have a script where my computer is not listening unless I say a command phrase, in this case "Computer".  It then enables listening, and if it hears nonsense, says it doesn't understand and disables listening. 

http://i.imgur.com/8MxFQ91.png

http://i.imgur.com/MEI3mEY.png

As you can see here are the two commands that handle that.  When computer is evoked it calls the top command, which enables listening.  And if the follow-up command is unrecognized it calls the second one.

If I load my profile without plugin support enabled (unchecked in the option menu) this works as expected.  Here is a screenshot of the log:

http://i.imgur.com/hUXqbw8.png

As you can see it does exactly what I would expect it to do.  I say Computer, it resumes listening, hears me say nonsense that isn't a command, runs the unrecognized command and stops listening.

However when I re-enable plugin support and relaunch voice attack and do the EXACT SAME thing, I get this instead:

http://i.imgur.com/1eMZLBj.png

As you can see it never disables listening.  I have no idea why this behavior is only present when the plugin is disabled.

I think this is a bug but obviously I have no real way to figure out how. 

Also unless the single TTS instance option is checked, this script will actually hang the entirety of VoiceAttack.

Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #1 on: March 21, 2017, 03:14:25 AM »
Also bizarre, when using the plugin, if i have a command that just uses Eddi's function "say" to perform simple text-to-speech, it always, without fail will say that text-speech.  However if I wrap my speech in a conditional:

Begin Boolean Compare : [computer_spoken_to] Equals True
    Set Text [Script] to '[Still listening; still here; still waiting], [commander;];'
    Execute external plugin, 'EDDI 2.2.1'
Else
    Set Text [Script] to '[What can I do for you; yes; what do you need] [commander;]?;'
    Execute external plugin, 'EDDI 2.2.1'
End Condition

Such that it will always say one or the other, it will OFTEN fail to say anything.  There is definitely something funky going on, though it is branching speech, one of the two scripts should always be fired.  And it only fires unreliably like this if it is within a conditional like that.  Just naked in the command structure it will fire 100% of the time.

edit:  This was likely a fekk up on my part, and the second phrase in the else condition had a semicolon at the end meaning it was only said sometimes.  Removing that semicolon and the phrases are said consistently.
« Last Edit: March 21, 2017, 10:25:59 AM by Woofington »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: When plugin support is enabled the system does not stop listening
« Reply #2 on: March 21, 2017, 07:05:12 AM »
Is it possible that EDDI is using its own speech services?  If so, there's nothing VA can do about it and you will need to contact the author of the plugin.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: When plugin support is enabled the system does not stop listening
« Reply #3 on: March 21, 2017, 08:11:18 AM »
You're using boolean compares in the examples, could you try this:
Code: [Select]
Set Boolean [bool] to True
Begin Boolean Compare : [bool] Equals True
    Write '[Green] true' to log
Else If Boolean Compare : [bool] Equals False
    Write '[Red] false' to log
Else
    Write '[Gray] other' to log
End Condition
Set Boolean [bool] to False
Begin Boolean Compare : [bool] Equals True
    Write '[Green] true' to log
Else If Boolean Compare : [bool] Equals False
    Write '[Red] false' to log
Else
    Write '[Gray] other' to log
End Condition
Set Boolean [bool] to [Not Set]
Begin Boolean Compare : [bool] Equals True
    Write '[Green] true' to log
Else If Boolean Compare : [bool] Equals False
    Write '[Red] false' to log
Else
    Write '[Gray] other' to log
End Condition
It should print "true", "false", and "other" to the log(in reverse order if you have the log set up that way).

As a diagnostic tool, I'd also recommend adding a descriptive "Write a Value to the Event Log" action to each branch of the compares that aren't working, so you can see whether it's the branch not getting executed, or only a particular action within it.

Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #4 on: March 21, 2017, 10:21:33 AM »
Is it possible that EDDI is using its own speech services?  If so, there's nothing VA can do about it and you will need to contact the author of the plugin.

*sigh* when I brought this up to the author of the plugin he said "It must be a VA issue because we sit on our own thread and don't do much, and I have no insight into VA". 

I feel as though I'm trapped in a loop.

To answer the question, yes you can execute an external command called "say" in VA through EDDI that will initiate its own TTS service (its really nice, it adds some filters to make it sound like a proper ship AI).

But even if the voice doesn't work, I still don't understand why VA fails to finish its script and cease listening.

Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #5 on: March 21, 2017, 10:23:18 AM »
You're using boolean compares in the examples, could you try this:
Code: [Select]
Set Boolean [bool] to True
Begin Boolean Compare : [bool] Equals True
    Write '[Green] true' to log
Else If Boolean Compare : [bool] Equals False
    Write '[Red] false' to log
Else
    Write '[Gray] other' to log
End Condition
Set Boolean [bool] to False
Begin Boolean Compare : [bool] Equals True
    Write '[Green] true' to log
Else If Boolean Compare : [bool] Equals False
    Write '[Red] false' to log
Else
    Write '[Gray] other' to log
End Condition
Set Boolean [bool] to [Not Set]
Begin Boolean Compare : [bool] Equals True
    Write '[Green] true' to log
Else If Boolean Compare : [bool] Equals False
    Write '[Red] false' to log
Else
    Write '[Gray] other' to log
End Condition
It should print "true", "false", and "other" to the log(in reverse order if you have the log set up that way).

As a diagnostic tool, I'd also recommend adding a descriptive "Write a Value to the Event Log" action to each branch of the compares that aren't working, so you can see whether it's the branch not getting executed, or only a particular action within it.

This part of it I think I actually solved, I added a semicolon to the end of the one of the branches which made the entire speech part optional so sometimes it would say nothing.  I removed it and cannot get the system to fail to respond anymore even within the conditional.  However the other issue is still present, and when the plugin is enabled, voice attack will never stop listening.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: When plugin support is enabled the system does not stop listening
« Reply #6 on: March 21, 2017, 10:30:38 AM »
when the plugin is enabled, voice attack will never stop listening.
Even when you manually click the button on the main screen? What happens when you run a command that only contains a "Make VoiceAttack Stop Listening" action?

Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #7 on: March 21, 2017, 12:37:24 PM »
when the plugin is enabled, voice attack will never stop listening.
Even when you manually click the button on the main screen? What happens when you run a command that only contains a "Make VoiceAttack Stop Listening" action?

Manually clicking stop listen does absolutely stop the listening.  Its only when stop listen is used in a command that also uses the plugins "say" function (seperate from VA's text-to-speech) does it seem to fail to stop listening. 

edit:  Actually this seems to only happen if there is a VA text-to-speech command and an EDDI say command in the same  file.  I believe if you remove one or the other, it works?  Need to do more testing.
I'm at work currently so I cannot get to my VA profile, but I have a test profile I will post here when I get home that illustrates the issue.
« Last Edit: March 21, 2017, 12:43:30 PM by Woofington »

Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #8 on: March 21, 2017, 05:20:18 PM »
OK I did some extensive testing, and the result has me completely confused.  So here is the jist.  I have created a test profile attached to this post.  If you install EDDI: https://github.com/cmdrmcdonald/EliteDangerousDataProvider/releases/tag/2.2.1 this is very easy to replicate and test.  Eddi is a very simple install, in fact it auto finds the voice attack app directory in the installer.

OK so here are the brass tacks:

In the profile I provided, if you run the command "This will work" the command will execute these actions:

Code: [Select]
Say, 'Voice attack text-to-speech [with a' or ' conditional]'
Set Text [Script] to 'Eddi text to speech'
Execute external plugin, 'EDDI 2.2.1'
Stop VoiceAttack listening
Write '[Blue] I got here!' to log

That works fine.  You get a bit of a jumble as the voice attack TTS and the eddi TTS talk over each other but its for testing purposes so who cares.  They each say their piece and then listening stops. 

However if you then run this command "This will not work", it runs these actions

Code: [Select]
Say, '[I'm sorry' or ' apologies' or ' my apologies' or ' sorry] [commander' or '] but [I did not understand' or ' I didn't understand' or ' I did not recognize' or ' I do not know' or ' I don't know] that [spoken' or '] [phrase' or ' command' or ' order' or ' directive' or ' request]'
Set Text [Script] to 'Testing the stop commander'
Execute external plugin, 'EDDI 2.2.1'
Stop VoiceAttack listening

Please note, the actions are the same, only the text value of the speech differ.  Note that when THIS action is called neither TTS respond, and VA never stops listening.  Furthermore trying to call "This will work" fails after this command has been invoked.  Even more to the point any command that now has a voice attack text-to-speech action will fail to run any action that occurs after the text-to-speech action. 

One more thing, this all assumes you have Single TTS Instance checked under system/advanced.  If you do not, follow these steps to get Voice Attack to crash entirely (It actually just freezes forever, no crash prompt, but you cannot do anything and it won't accept any more commands).  Assuming you've restart the program, and you have unchecked "Single TTS instance" if you run the "This will not work" command, and then click the "Stop Commands" button Voice Attack will freeze completely, you'll have to kill the process.  Please note this does not happen when you use the "This will work" command. 

I hope this is as thorough as any of you will need to help track down why this is behaving the way it is.


cmdrmcdonald

  • Guest
Re: When plugin support is enabled the system does not stop listening
« Reply #9 on: March 22, 2017, 03:10:44 AM »
I've taken a look at this.  In the original post EDDI is never invoked, so it seems unlikely that EDDI has anything to do directly with this not running (directly at least; it's possible that the presence of plugins in general, or EDDI in particular, is interfering with the main VoiceAttack code in some way but I don't see any suggestion of what that might be).

I took the profile that you attached above and ran it locally, tracing the calls to EDDI.  EDDI's VA_Invoke1 is never called, which really does point to this being an issue inside VoiceAttack rather than EDDI.  Given that as far as I can see the command that doesn't work never starts the relevant EDDI function there's not a lot I can do in terms of debugging the issue.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: When plugin support is enabled the system does not stop listening
« Reply #10 on: March 22, 2017, 12:25:40 PM »
EDDI's VA_Invoke1 is never called, which really does point to this being an issue inside VoiceAttack rather than EDDI. 
I don't have EDDI, so I tested both without a valid plugin, and with my own plugin; Neither stopped anything from working, and VA_Invoke1 did get called when my plugin was executed, so it doesn't happen with every plugin.

J. Calvert (Joshua)

  • Newbie
  • *
  • Posts: 30
Re: When plugin support is enabled the system does not stop listening
« Reply #11 on: March 22, 2017, 02:13:21 PM »
I'm no expert but couldn't resist trying it out. I have Eddi 2.2.1 plugin installed and both commands work for me.
The only thing I noticed was that sometimes the "This will not work" didn't do anything the first time but the second or third time it did. I think that's me saying it with a Dutch accent though because after I changed the command to "This is not working;not working" it works everytime I say "not working".
So to recap when I say "This will work" I hear both lines (TTS and Eddi) and listening is turned off.
After I turn listening back on and say "not working" I again hear both lines and listening is turned off again.


Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #12 on: March 22, 2017, 03:06:48 PM »
Well this raises further questions. 

Curious, through EDDI what TTS voice are you using?

J. Calvert (Joshua)

  • Newbie
  • *
  • Posts: 30
Re: When plugin support is enabled the system does not stop listening
« Reply #13 on: March 22, 2017, 04:05:14 PM »
I'm using Ivona's Emma for EDDI and Ivona's Amy for non-EDDI TTS.

Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #14 on: March 22, 2017, 04:09:59 PM »
I'm using Ivona's Emma for EDDI and Ivona's Amy for non-EDDI TTS.

Weird I'm using the exact same things...

Woofington

  • Jr. Member
  • **
  • Posts: 54
Re: When plugin support is enabled the system does not stop listening
« Reply #15 on: March 22, 2017, 09:12:02 PM »
I just restarted everything and retested and I am still experiencing the same exact behavior as mentioned above.  WHen you ran the tests did you run them completely unaltered?

It still fails to execute commands after the tts action and crashes if the single instance option is not used.

Gary is there anyway I can get more information, some kind of crash/execution log or something?

J. Calvert (Joshua)

  • Newbie
  • *
  • Posts: 30
Re: When plugin support is enabled the system does not stop listening
« Reply #16 on: March 23, 2017, 01:17:44 AM »
The only alteration I made was adding "not working" to the "This is not working command".
I didn't change the option "Single TTS instance" so it's still unchecked.