HeliosVirtualCockpit / Helios

Helios Distribution
https://github.com/HeliosVirtualCockpit/Helios/wiki
GNU General Public License v3.0
202 stars 33 forks source link

Control Center unable to determine GUID of DirectX Input Device #231

Closed derammo closed 3 days ago

derammo commented 4 years ago

The profile editor saves the GUID of the DI controller in the profile, however this assumes that the GUID will be the same on the machine where the control center is running, and this will not necessarily be the case. It is probably invalid for the GUID to be stored in the profile in the first place, however there needs to be the ability for the CC to find the new GUID via the name if the GUID in the profile is not valid.

Comments:

comment by @BlueFinBima on 2020-06-28 16:49:34 +0000 UTC

23ef9d74cc1db6aa6c0797c2a04c6fb59f93b4b0

migrated from https://github.com/BlueFinBima/Helios/issues/231

derammo commented 4 years ago

the Directx controller enumeration code is timing out (locking up Helios) for 45 seconds on one user's machine. it does not appear safe to use this API in this way if there are questionable controllers (maybe virtual ones?) present.

This is a problem because the user isn't trying to use the interface, it just comes that way in a profile they use and it locks up their Helios even though they don't have any matching devices and don't want to be using this interface. The workaround was to simply remove the joystick interface from the profile, but that's not something a user would know to do.

We need to add extensive logging and run a dev build on the user's machine to see if we can figure out why it is hanging. Otherwise, we can make this functionality optional and being off by default so it does not make Helios lock up.

derammo commented 4 years ago

Just looking at the file history, I wonder if this is why Gadroc commented out all that code?

derammo commented 4 years ago

one weirdness is that the user says they did not have this problem with 3104 but did with 3213 and 3214. That doesn't make much sense since the code was the same. But that could just be inaccurate reporting. I am waiting for a dxdiag dump from them so we can see what devices directX thinks they have.

BlueFinBima commented 4 years ago

Interesting. I did test with no controller attached and did run with debugger on for the scenario which resulted in a match and without, and never saw a hang / wait. Maybe this was why the previous implementation was commented out. The correct solution is to not store the guid in the profile at all, but obviously this would result in similar code being run for everyone. I think there is probably more to this tale than we currently know.

On Tue, 25 Aug 2020, 14:24 derammo, notifications@github.com wrote:

Just looking at the file history, I wonder if this is why Gadroc commented out all that code?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/HeliosVirtualCockpit/Helios/issues/231#issuecomment-680022841, or unsubscribe https://github.com/notifications/unsubscribe-auth/AENLAGC4OUI3BRB4JPQHRDLSCO3R3ANCNFSM4OQ5PK3A .

derammo commented 4 years ago

my best case scenarios:

or

CZ has stopped using this functionality in new profiles I think, so it's not a huge loss that some people won't get their joystick bound to special functions by Helios. Helios looking like it is broken is way worse.

ertiyu commented 4 years ago

Hello, For my part I use an X56 to interact with Helios, I never had a soucci. By activating an axis I change the autopilot mode. thanks to a Lua script. If my comment has nothing to do with your problem, excuse me, but googles translation will have misled me.

derammo commented 4 years ago

here's the list of devices. It does have a vJoy driver like I suspected

-------------------
DirectInput Devices
-------------------
      Device Name: Mouse
         Attached: 1
    Controller ID: n/a
Vendor/Product ID: n/a
        FF Driver: n/a

      Device Name: Keyboard
         Attached: 1
    Controller ID: n/a
Vendor/Product ID: n/a
        FF Driver: n/a

      Device Name: Razer Naga 2014
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x1532, 0x0040
        FF Driver: n/a

      Device Name: Razer Naga 2014
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x1532, 0x0040
        FF Driver: n/a

      Device Name: Programmable Hotkeys
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x06A3, 0x5081
        FF Driver: n/a

      Device Name: Razer Naga 2014
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x1532, 0x0040
        FF Driver: n/a

      Device Name: vJoy Device
         Attached: 1
    Controller ID: 0x1
Vendor/Product ID: 0x1234, 0xBEAD
        FF Driver: C:\Windows\System32\pid.dll
   FF Driver Date: 3/19/2019 00:45:38
FF Driver Version: 10.00.18362.0001
   FF Driver Size: 45568 bytes

      Device Name: Razer Naga 2014
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x1532, 0x0040
        FF Driver: n/a

      Device Name: USB Audio Device
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x0D8C, 0x0012
        FF Driver: n/a

      Device Name: X52 Professional H.O.T.A.S.
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x06A3, 0x0762
        FF Driver: n/a

      Device Name: Mad Catz V.5 Keyboard
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x0738, 0x2026
        FF Driver: n/a

      Device Name: Mad Catz V.5 Keyboard
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x0738, 0x2026
        FF Driver: n/a

      Device Name: Mad Catz V.5 Keyboard
         Attached: 1
    Controller ID: 0x0
Vendor/Product ID: 0x0738, 0x2026
        FF Driver: n/a

Poll w/ Interrupt: No
BlueFinBima commented 3 days ago

Wheelchock and I changed the DirectX code to resolve several exceptions. I think this code has been much more stable of late. While this does not address the issue above, I'm not feeling a great pressure to cope with the interchange of profiles containing game controllers. I think this can go into the fridge. If anyone disagrees, and wants to implement derammo's design, then this issue can be re-opened.