EDCD / EDDI

Companion application for Elite Dangerous
Other
444 stars 81 forks source link

Using TTS in another VA script whilst EDDI is running causes instability, speech failure #125

Closed CMDR-Angel closed 6 years ago

CMDR-Angel commented 7 years ago

Steps to reproduce

Running a TTS command within VA whilst EDDI is running causes TTS speech to not be read out, it also often causes VoiceAttack itself to crash. At first I tried running our Game music pack with EDDI, everything is fine until the music pack needs to read out some TTS. I removed our own plugin to see if there was some sort of incompatibility going on, but it made no difference. Simply using 'say' within VA whilst EDDI causes nothing to be read out, often followed by a total lockup of VA. Going a step further, I created a new command script in VA with nothing more than a 'say' command, even hitting preview to hear the text read back to me caused the same problem. This issue is affecting about half of our user base, so it doesn't happen for everyone

Expected

The TTS should simply read out in VA whether EDDI is running or not

Observed

TTS readout remains silent when it is expected to be read, continuing further commands in VA after a TTS readout failure causes VA to become unresponsive.

Investigation

Tried EDDI version 2.3.0 and 2.3.1. No difference. Tried removing our music pack plugin, no difference. The issue is not related to our plugin. I have a feeling this issue may not be solely an EDDI one, it could perhaps be a deep down bug in VoiceAttack itself. However (and I still need to test this) simply running 2 regular profiles (no plugins) both with TTS references, I suspect that will work fine. I will test this later today. But I have a feeling with the TTS processing effects or perhaps the hold EDDI has on TTS is maybe causing the problem. Either way, it's a show stopper whether used with our music pack or not, anything using custom 'say' commands with EDDI seems affected.

Tkael commented 7 years ago

Link to the discussion of this bug on VoiceAttack's forum: http://voiceattack.com/SMF/index.php?topic=1468.0

CMDR-Angel commented 7 years ago

Got it thx.

Tkael commented 7 years ago

Provisional report from Agravar on Discord:

@T'kael (EDDI) hi, I would like to report that (provisionally) I have EDDI & GMVoicepacks working together in VA. I disabled Realtek HD Soundmanager and no longer have VA crashes. At work so can't test thoroughly. Edit: Agravar has amended his report and no longer believes this to be the source.

Tkael commented 6 years ago

I've been gathering crash dumps from EDDI and VoiceAttack. They all point to the same problem: Exception code 0xC0000005: The thread tried to read from or write to a virtual address for which it does not have the appropriate access. Essentially, it seems that a thread in EDDI is occasionally trying to access protected / read only memory and causing a crash when it fails to do so. In my case, the offending .dll is from Ivona Amy.

Tkael commented 6 years ago

What voices are others using when they experience these crashes?

CMDR-Angel commented 6 years ago

Hi, I can't comment on the other crashes, I think people are using various Microsoft SAPI voices. I can confirm that when I received the crashes on Win 10 test machine I tried a few: Windows default voice setting (defaults to Anna), specifying Anna (just to check), Microsoft David & Zira. All resulted in the same crashes. Sounds like you are beginning to hone in on the problem.

Meridianstream commented 6 years ago

I have been using Ivona voices Emma and Ami. Speech Engine set as Microsoft Speech Recogniser 8.0 for Windows (English UK). I have also used Windows default voices e.g Hazel. T'kael if you need me to try anything let me know? .... there is also an option to set speech engine in VA to system default but to my limited knowledge the default is Microsoft Speech Recogniser 8.0 anyway!

Tkael commented 6 years ago

What I really need is a way to reliably trigger this crash from EDDI. When the crash occurs in VoiceAttack, all I can see is that VoiceAttack failed with that exception code... I can't trace the exception any further into EDDI's code.

Meridianstream commented 6 years ago

Hi Tkael, just to let you know how it pans out for me.... just for clarity. If I run EDDI plugin + VA then no problems. If I run GMP + VA then no problems. If I run EDDI plugin + GMP + VA then as soon as GMP tries to access TTS then there are problems.... it goes as follows..... I say 'current volume' (GMP command) there is no TTS response..... I can continue to issue EDDI commands e.g. 'tell me about this system' and I get correct response ... I can issue EDDI commands ad infinitum at this point ..... until I issue another GMP command and VA will then become unresponsive. It is as though EDDI plugin is denying access to TTS service in VA environment. It is always like this whatever I try with VA settings or PC settings. EDDI in standalone mode works fine. Sorry for long post ... just wanted to state my issue in full. I don't have a clue how you are going to trace exception in EDDI's code. Sorry. My installation paths for all are default. Thankyou for your efforts on this.

Tkael commented 6 years ago

It's always two gmp commands and then it crashes? Weird.

CMDR-Angel commented 6 years ago

For me it was the same. The first TTS clash begins the instability (speech doesn't play), the second one kills it. Something is not quite right after the first TTS clash. I've tried a completely fresh profile with nothing more than a TTS command, it's the same. Even if I click into EDIT a command in VA, click Preview it'll not speak, click it again. Crash. It is worth noting that after changing sample rate in Win 10 from 48khz to 44.1 and turning off "allow applications exclusive control over this device" it seems to be fine. Could be a coincidence, but given that you say EDDI samples the TTS output in order to apply filter, perhaps that's something to look at.

Tkael commented 6 years ago

Ok. Here's what I propose. I'd like to replicate what you are describing as exactly as possible, using EDDI builds with and without filtering. Mind sending me a license to use for testing?

I've gotten EDDI to crash before, but this seems to be the best way to make sure it's crashing for the same reasons.

CMDR-Angel commented 6 years ago

Sure, was going to offer you one anyway, hadn't got to it, busy week. I'll sort you one out by tomorrow.

Tkael commented 6 years ago

Cool. I've registered an account on your site. Username: T'kael

Tkael commented 6 years ago

For my own reference, this is the line I think I'll start testing from: https://github.com/EDCD/EDDI/blob/7e7524d7f0102b82ca558d41493477c44fc2874d/SpeechService/SpeechService.cs#L162-L163

Meridianstream commented 6 years ago

Tkael, this has been solved we think. Angel at Game Music Packs/Discord discovered solution. I now have EDDI and GMP playing very nicely together in VA.

Tkael commented 6 years ago

Sounds like the fix is to change VoiceAttack from using the system default voice and instead explicitly select the desired voice? Is that right?

Meridianstream commented 6 years ago

For me, I had to update to the new creators edition of Windows 10 first then make sure VA was using correct voice for plugins. Thankyou for your work on this Tkael.

Tkael commented 6 years ago

The more I test this, the more convinced I am that this is an issue with the way that VoiceAttack handles specific voices. EDDI does not appear to be culpable. I'm closing this issue on Github but the conversation continues on the VoiceAttack forum post linked above.