mpstark / articulate

Articulate is a voice input program for Arma 3.
MIT License
68 stars 24 forks source link

Installing to non-default location breaks output functionality #36

Closed mpstark closed 10 years ago

mpstark commented 10 years ago

Alpha Kilo reported this problem:

Unfortunately Articulate only worked on the desktop. When I started Arma3, Articulate crashed after a few seconds. Someone else reported the same in the forum thread. Is this a user error or a bug? How can I help you sort out the problem? I use Win7 64 Ultimate German version. English language pack is installed and activated. (Otherwise I wouldn't be able to use Articulate on the desk top.) ArmA3 is stable build, vanilla. Articulate is the installer version.

Problem solved, I think. I normally don't install anyting to my C-drive which I like to reserve for Windows. All the software I need to install goes to E:\Programs. I installed Articulate to E:\Programs\Articulate. Unfortunately this caused my problem. I uninstalled Articulate, ran Glary's Utilities to clean the registry and installed Articulate in the defaut path. This solved the problem and I could use it as intended. I verified this result by deleting and installing again to E:. The problem came back. Articulate crashed when I said the first command. Reinstalling again in the default path solved the problem again. I tried this with 2 different community-generated missions and the official squad-leader showcase. Though Articulate works for me now, I don't understand why the installation drive makes such a difference.

notheotherben commented 10 years ago

This is very interesting, as far as I'm aware there is no code in Articulate which takes into account the drive on which it's installed. Could be a permissions issue perhaps, however it would help to get hold of the crash logs (if any). Also quite intrigued as to why it crashed only after he said the first command, as that implies that it would have something to do with the MS SAPI implementation, writing the grammar to file or emulating keystrokes. My guess would be that it has something to do with writing the grammar to file (if we're still doing that).

mpstark commented 10 years ago

It's an odd bug for sure. I've already asked for the crash log. I had only quoted what I felt was relevant to the bug but I'll just write the entirety out.

Mpstark

I have just tried Articulate and I was surprised how fluently I could issue my commands. In fact, I made the usual puses other voice control applications require and Articulate understood the number but not the rest of my command because of the delay. I really had to force myself to speak quicker until i got used to it. I tried every single command in your list and Articulate understood them perfectly well. I am sure, Articulate will take playing with AI subordinates to a whole new level.

Unfortunately Articulate only worked on the desktop. When I started Arma3, Articulate crashed after a few seconds. Someone else reported the same in the forum thread. Is this a user error or a bug? How can I help you sort out the problem? I use Win7 64 Ultimate German version. English language pack is installed and activated. (Otherwise I wouldn't be able to use Articulate on the desk top.) ArmA3 is stable build, vanilla. Articulate is the installer version.

By the way, when you work on the international version of Articulate, I might be able to help out with a translation of the interface or the manual, if you like.

I responded with:

We've implemented a silence timeout UI element that should work to alleviate the problem of it canceling input before you are done speaking. For me, the default value makes sense, but it certainly is something that a lot of people have asked for.

As for your other problem, I have not heard of another user that was able to launch and use Articulate but then have it crash after launching Arma 3 -- the only other crash report that we've gotten has been because the user didn't have .net 4.5 installed, and his crashed to desktop immediately. I suspect that it has something to do with your system locale though I am unsure what beyond that -- I've set my system locale up as several different values and not had this problem. Could you check C:\Users\your_username\AppData\Roaming\Articulate\ Crashes for a crash report and then forward it to me?

Next message from him:

Mpstark

Problem solved, I think. I normally don't install anyting to my C-drive which I like to reserve for Windows. All the software I need to install goes to E:\Programs. I installed Articulate to E:\Programs\Articulate. Unfortunately this caused my problem. I uninstalled Articulate, ran Glary's Utilities to clean the registry and installed Articulate in the defaut path. This solved the problem and I could use it as intended. I verified this result by deleting and installing again to E:. The problem came back. Articulate crashed when I said the first command. Reinstalling again in the default path solved the problem again. I tried this with 2 different community-generated missions and the official squad-leader showcase. Though Articulate works for me now, I don't understand why the installation drive makes such a difference.

Unfortunately I couldn't find the crash report you requested. Are you sure that the path you indicated is for Win7? Please be so kind to double-check because I'd like to provide proper info if and when I have to report another issue.

I didn't see the silence timeout UI element you mentioned. Have you implemented it to an upcoming version or am I missing something in version 0.2? I would test the feature though I don't need it anymore. After getting used to Articulate I enjoy speaking naturally with my AI squad.

On the forum someone suggested to allow several push-to-ignore keys instead of just one. I was going to suggest the same thing for your final release version. ACRE-Users need two keys (a radio key and a direct key which is also the TS-push-to-talk button). "Power-users" of VON may need as many keys as there are channels though I guess most players will be happy with one VON-ptt key.

Some words about the voice commands I provided in my spread-sheet: You might have noticed that I mis-spelled some words. For example "suhm" instead of "zoom". This was done because you have to write English words as if they were German so that the German version of the speech pack can work properly. And I found that VAC doesn't allow our famous umlauts ä, ö, ü. They had to be replaced by ae, oe, and ue. For someone who is used to typing in German this in very uncomfortable. Do you think you can make Articulate understand the umlauts? (Say yes and you'll get a lot of similar requests from international users who have special characters on their keyboards if you localize Articulate.)

My reply:

The silence timeout will be in a future version, sorry for the confusion.

The crash report should be in "%AppData%\Articulate\Crashes" which for most people is "C:\Users\your_username\AppData\Roaming\Articulate \Crashes". This folder may not exist if no crash report was generated. You can go there by using the run command (win-r) and then pasting %AppData%\Articulate\ and looking for the crash directory.

So it's just when he launched Arma 3/Articulate tried to output to Arma 3 that it crashed. We'll see if a crash report was generated when he responds. He's helping me out with the German translation of Articulate and has already provided a spreadsheet that contains his VAC profile.

mpstark commented 10 years ago

I got the crash report from Alpha Kilo. Looks like it isn't related to install location at all. Crash report is in German, I've used my limited German augmented with Google Translate to get an english translation.

Exception message: Target of an invocation has caused an exception.

Inner Exception message: Access Denied

Articulate Application Crash
OS: Microsoft Windows NT 6.1.7601 Service Pack 1
64-Bit: No
.NET Version: 4.0.30319.18052
Command Line: "C:\Program Files (x86)\Articulate\Articulate.exe" 

Exception Message
Ein Aufrufziel hat einen Ausnahmefehler verursacht.

Exception Target Site
System.RuntimeMethodHandle - InvokeMethod

Stack Trace
   bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   bei System.Delegate.DynamicInvokeImpl(Object[] args)
   bei System.Speech.Internal.AsyncSerializedWorker.WorkerProc(Object ignored)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
   bei System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bei System.Windows.Threading.DispatcherOperation.Invoke()
   bei System.Windows.Threading.Dispatcher.ProcessQueue()
   bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   bei System.Windows.Threading.Dispatcher.Run()
   bei System.Windows.Application.RunDispatcher(Object ignore)
   bei System.Windows.Application.RunInternal(Window window)
   bei System.Windows.Application.Run(Window window)
   bei Articulate.App.Main()

INNER EXCEPTION:
Exception Message
Zugriff verweigert

Exception Target Site
System.Diagnostics.ProcessManager - OpenProcess

Stack Trace
   bei System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
   bei System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, Boolean firstModuleOnly)
   bei System.Diagnostics.NtProcessManager.GetFirstModuleInfo(Int32 processId)
   bei System.Diagnostics.Process.get_MainModule()
   bei Articulate.ForegroundProcess.get_FullPath()
   bei Articulate.VoiceRecognizer.sre_SpeechRecognized(Object sender, SpeechRecognizedEventArgs recognizedPhrase)
   bei System.Speech.Recognition.SpeechRecognitionEngine.SpeechRecognizedProxy(Object sender, SpeechRecognizedEventArgs e)
mpstark commented 10 years ago

I've asked Alpha Kilo if he is running anything as admin.

mpstark commented 10 years ago

This is a side effect of running alongside an elevated Arma with a non-elevated Articulate. Alpha-Kilo got back to me with the fact that steam was launched as elevated and was thus launching Arma elevated -- he now has 0.2.0 working on his machine.

This fix will fix the crash but not the lack of input into Arma since elevated applications will not accept key input from non-elevated applications. I've opened another issue for that problem.