Author Topic: VA Joystick handling  (Read 6167 times)

MalcomR

  • Newbie
  • *
  • Posts: 44
VA Joystick handling
« on: March 05, 2019, 04:56:27 PM »
I tried to assign a joystick in VA but got a "Unable to start joystick feature: Exception thrown by the target of an invocation"

I'm on Win 10 Pro updated and ran VA as my user (a member of admin) and as administrator but still get the error.  What is VA supposed to do when I click Assign?  Will it give me a list of my game controllers as I see them in USB game settings?  I have five hardware controllers and am also using vJoy with Joystick Gremlin to feed the controllers to the various vJoy virtual joysticks.   I was expecting to see a list of controllers that I could pick from.

Disabling vJoy and Gremlin did not help.

Thanks.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Joystick handling
« Reply #1 on: March 05, 2019, 05:09:04 PM »
What is VA supposed to do when I click Assign?  Will it give me a list of my game controllers as I see them in USB game settings?
It should, yes.

Is there a "VoiceAttackFault.txt" file in VoiceAttack's installation directory? Which VoiceAttack version are you running?


You could try running the VoiceAttack installer again, in case the included joystick handling library got corrupted somehow.

I'd also suggest this:
One thing I always suggest is running a system file scan (which is something that you should do from time to time anyway):  https://support.microsoft.com/en-us/help/929833/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system


If all that doesn't change things(be sure to reboot as well), you could try uninstalling the virtual devices(although vJoy in particular shouldn't cause conflicts, as VoiceAttack can even drive it), and/or unplugging all the physical devices, before trying the feature again(after once again rebooting).

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #2 on: March 05, 2019, 05:27:00 PM »
There is a VoiceAttackFault.txt but it's dated 8/14/2018 and is empty.  I'm on V1.7.3.4 (prerelease).

I'll try the installer again and see what happen s.  I've just installed this system and rebooted recently but I'll try a reboot if the reinstall doesn't work.

Reinstall did not work.  I'll run sfc but that has never found any issues even when the system is badly broken!

Good to know it can handle vJoy.

Edit:

sfc found no issues.

Reboot did not help.  Nothing in the log file.
« Last Edit: March 06, 2019, 03:25:31 PM by MalcomR »

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #3 on: March 07, 2019, 02:18:59 PM »
I'm not sure what is happening.  Still won't let me assign joystick. Nothing is ever written to the log file in my VA install folder and I have Enable Log Quiet Mode UNchecked while Display Warning Log items and Display "Write to Log Actions" enabled.

Now I'm having an issue where I define a startup profile which has a command it runs when loaded.  When VA starts it loads the profile, starts the command, then says "Stopped Command, 'My Command'.  When I switch to the profile manually it runs the command fine.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: VA Joystick handling
« Reply #4 on: March 07, 2019, 02:30:28 PM »
In regards to the joysticks not showing up or raising an exception, it's most likely that you have a driver issue going on, or there is some component on your system that is not working properly.   VoiceAttack is using simple directx inquiries to ask Windows for your devices (no magic going on there).  It is possible that VAJS.dll or even VA itself is corrupt.  You'll want to try reinstalling VA to see if that helps.

For the command issue, you'll want to export your profile with only the offending commands and upload the .vap here so that it can be looked at and/or have the problem reproduced.  There could just be something in the command that's not jiving when the profile is loading while VA is loading (this would be the first time to come across something like this, so, any info you can provide would be really helpful).

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #5 on: March 07, 2019, 02:41:42 PM »
I have just downloaded the latest beta so I'll reinstall - do I need to delete my existing installation?

I am attaching the startup profile with only the command that is supposed to be executed when it is loaded.

Well, well.  Looks like the startup profile ran as it should after installing the beta over the old version.

I still get the error trying to assign a joystick but I haven't rebooted yet.  Still no entries at all in my VoiceAttackFault.txt log.

After a reboot it still does not run the Initialize command - Stopped Command, Initialize is what shows.  It runs fine when I manually switch to the profile.

Still can't assign a joystick.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Joystick handling
« Reply #6 on: March 07, 2019, 06:02:25 PM »
I have just downloaded the latest beta so I'll reinstall - do I need to delete my existing installation?
That should not be necessary, the installer should overwrite the old version(provided there are no file permission issues).

Do make sure you back up your profile database if you haven't already:
Quote from: https://forum.voiceattack.com/smf/index.php?topic=2538.0
NOTE: You may want to back up your data folders first, as this version has changes to the data structure that may prevent you from rolling back directly (this is really the recommendation for each beta, but I want it to be very clear when there are structure updates).
Data files are usually located here:  C:\Users\YOUR USER NAME\AppData\Roaming\VoiceAttack
You can also get to this folder from the Options > System/Advanced screen (link is at the bottom).
Just copy everything to another folder.


I am attaching the startup profile with only the command that is supposed to be executed when it is loaded.

Was there nothing else in this startup command?
Code: [Select]
Write [Purple] 'Initializing' to log
Write [Purple] 'Initializing Completed' to log

It's very odd that you're seeing "Stopped Command" in the log; Is it preceded by "Stop running commands"?

It doesn't have the "Allow other commands to execute while this one is running" option checked, which should be an issue, but even if it was the log message would read "Command canceled: Another command is not allowing others to execute (canceled: Initialize)."


Are you running any plugins?

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #7 on: March 07, 2019, 07:49:10 PM »
Yes that is all that is in the command.  I had more but decided to cut back until I got it at least entering and exiting.

I have no installed plugins.

Here is what is in the log.  I've tried with and without admin privileges.

9:47:43 PM - Profile automatically changed to Firefox (post reply - mozilla firefox)
9:46:29 PM - Profile automatically changed to Programs (default)
9:46:29 PM - Stopped command, 'Initialize'
9:46:29 PM - Profile startup : 'Initialize'
9:46:29 PM - VoiceAttack privileges not elevated.  Pro Tip - If you are having trouble with key presses being recognized, try running as an administrator.
9:46:29 PM - Plugin support enabled.


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Joystick handling
« Reply #8 on: March 07, 2019, 08:09:42 PM »
Aha.

When the currently active profile is switched away from, all running commands are stopped.

As you're using automatic profile switching, that happens if you start VoiceAttack while the profile you last used is not the one assigned to the current application(I.E. the startup command for the profile active when VoiceAttack starts will run, but the profile will then immediately be switched, stopping that startup command).

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #9 on: March 08, 2019, 07:11:22 AM »
I see so how do I over come that.  I want the startup profile to run and then run the command to set up variables I need available globally for other profiles.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Joystick handling
« Reply #10 on: March 08, 2019, 07:37:14 AM »
I assume you have the profile you want to run at startup selected in the "Load Profile on Startup" option?

If you set the command that initializes your variables to run on profile unload("Execute a command each time this profile is unloaded"), that command should be executed before any other profile is loaded(I.E. when the auto switcher changes away from that profile).

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #11 on: March 08, 2019, 09:23:20 AM »
That fixed it.   I certainly wouldn't have thought of that behavior being the culprit!!!

Thanks.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #12 on: March 09, 2019, 06:19:17 PM »
Still no luck on assigning a joystick.  I've done the sfc, rebooted (several times), installed the latest beta.   vJoy Monitor shows the sticks working just fine.  They show up in the USB Game controller settings and work.

The VA log file is still 8/14/2018 date and 0 bytes.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #13 on: March 14, 2019, 02:46:15 PM »
I downloaded the latest beta today and it will still not recognize any joysticks and throws the exception.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: VA Joystick handling
« Reply #14 on: March 14, 2019, 04:17:56 PM »
The log won't have anything on that - it's a handled exception.  Normally, the message would indicate the exception, but, there's something else going on.  I put an, 'unofficial' build out there just now which is just the latest beta plus some additional exception checking to see if there's any other information that can be gathered.  If you want to try this, download the .exe from here:  http://voiceattack.com/unofficial

Just replace the .exe in your VA installation folder with that .exe.  Go through the steps that you were going through to get the message box and see if there is any more information in the box.  If there's more info, would you mind posting it here?  Hoping that may shed more light on what's going on.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #15 on: March 14, 2019, 05:49:28 PM »
Here is what I got.  It is complaining about no SharDX.DirectInput or one of it's dependancies and the module was expected to be in the manifest.

Thank you for the quick response.

Is it possible to do more than two joysticks?



Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: VA Joystick handling
« Reply #16 on: March 14, 2019, 06:13:56 PM »
In your VoiceAttack installation folder, do you have files named SharpDX.dll and SharpDX.DirectInput.dll in there?

If you don't, you'll need to install VoiceAttack again and make sure those files are present.

If you *do* have those files, there is something up with your setup, as the dll is trying to access some component(s) on your system and it is not working properly.  Unfortunately, I don't have a solution for you as I'm not getting any reports like this from other users where I could establish a pattern :(

Thank you for the extra info, btw!

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #17 on: March 15, 2019, 02:30:44 AM »
Both files are there. 

I hate these one of a kind issues!  Hard to figure out what is going on.

I may uninstall VA, delete the folder, and reinstall just to see if that fixes it. 

Is there anywhere or anything else I need to look at.  I do have vJoy and Joystick Gremlin installed.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Joystick handling
« Reply #18 on: March 15, 2019, 06:35:53 AM »
Before you delete the entire folder, could you try deleting just SharpDX.dll and SharpDX.DirectInput.dll?

If you're running the beta, I don't think you need them; Back in December 2018, Gary stated on Discord that the joystick components are now merged with the .exe(which caused issues with Vaicom at that time, as it was still looking for the external files).

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: VA Joystick handling
« Reply #19 on: March 15, 2019, 07:46:27 AM »
Ah!  Right - sorry... they were merged into VAJS.dll.

Make sure that the VAJS.dll file is present.  I think if it's not present, you'll get a warning when VA loads.

On that note, yes - try just deleting those two files as Pfeil said.  If that *does* work, there's still something up with your setup, but it would be easy to overcome.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #20 on: March 15, 2019, 10:13:48 AM »
Deleting the Sharpdx files worked.  I can now pick joysticks.

Thank you very much!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: VA Joystick handling
« Reply #21 on: March 15, 2019, 10:50:21 AM »
What's interesting here is that the presence of the SharpDX files in that directory is causing a malfunction - but only on your setup   ???

I've tried this on two different machines, both with and without the files included in the directory and everything functions as normal.  Not sure why .net is preferring one dll over another in your environment. 

The solution going forward is to just make sure that the installer deletes those files if they exist.


Glad it's sorted now.  Thanks to Pfeil for remembering that little tidbit.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #22 on: March 15, 2019, 02:03:23 PM »
It is very strange that it's this machine.  I do have UCR installed also (not using it though) and it has some Sharp_DX files in it's directory but I wouldn't think those would affect VA.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: VA Joystick handling
« Reply #23 on: March 15, 2019, 02:31:14 PM »
I had to do a sanity check and reinstall the release version to check this out.  I started to think the merged assemblies were introduced in a beta, but it's been in full release since later last year.  This issue would have come up in a matter of minutes after release is why I was going on about it being your box.  I chose to not delete the files if they existed since anything extra in an installer is just that more of a chance that things will bork up- since the files are relatively tiny, I just figured they'd be ok living in there.  I don't anticipate this being an ongoing issue, but I'll make sure that they files are deleted so this (hopefully) won't come up again for somebody else.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: VA Joystick handling
« Reply #24 on: March 15, 2019, 02:41:55 PM »
I have a knack for breaking software <G>.  I guess that's why I've done so well beta testing for various pieces of software!