WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
323 stars 46 forks source link

Game controller order set by Windows affects vJoy device recognition #395

Open ramla opened 2 years ago

ramla commented 2 years ago

My profile loads incorrectly after the order of game controllers change for whatever reason Windows does it. The mappings for vJoy 1 loaded into vJoy 2. I would not have thunk device order would matter in Joystic Gremlin since the profile file saves the devices (vJoy as well) by GUID and while Joystick Gremlin still requires vJoy devices to differ by button counts. I could not get the profile working by reordering the profile file and a rewrite was no go as it is a big one. The same profile worked again when I managed to change back the device order.

ramla commented 2 years ago

Original device order system.log:

2022-02-08 20:11:03      DEBUG --------------------------------------------------------------------------------
2022-02-08 20:11:03      DEBUG 2022-02-08 20:11
2022-02-08 20:11:03      DEBUG Starting Joystick Gremlin R13.3
2022-02-08 20:11:03      DEBUG --------------------------------------------------------------------------------
2022-02-08 20:11:04       INFO Initializing joystick devices
2022-02-08 20:11:04      DEBUG 7 joysticks detected
2022-02-08 20:11:04      DEBUG Added: name=Logitech G HUB G920 Driving Force Racing Wheel USB guid={8AD6DE50-879F-11EC-8004-444553540000}
2022-02-08 20:11:04      DEBUG Added: name=Joystick - HOTAS Warthog guid={CAF69FC0-8795-11EC-8004-444553540000}
2022-02-08 20:11:04      DEBUG Added: name=TQSUSBA_R1 guid={CAF69FC0-8795-11EC-8005-444553540000}
2022-02-08 20:11:04      DEBUG Added: name=vJoy Device guid={249DA520-8799-11EC-8003-444553540000}
2022-02-08 20:11:04      DEBUG Added: name=vJoy Device guid={68E2C820-87A1-11EC-800B-444553540000}
2022-02-08 20:11:04      DEBUG Added: name=vJoy Device guid={68EC3E00-87A1-11EC-800D-444553540000}
2022-02-08 20:11:04      DEBUG Added: name=vJoy Device guid={750084B0-87A3-11EC-8002-444553540000}
2022-02-08 20:11:04      DEBUG vJoy guid={249DA520-8799-11EC-8003-444553540000}: (8, 66, 0)
2022-02-08 20:11:04      DEBUG vJoy guid={68E2C820-87A1-11EC-800B-444553540000}: (5, 0, 0)
2022-02-08 20:11:04      DEBUG vJoy guid={68EC3E00-87A1-11EC-800D-444553540000}: (8, 63, 0)
2022-02-08 20:11:04      DEBUG vJoy guid={750084B0-87A3-11EC-8002-444553540000}: (8, 62, 0)
2022-02-08 20:11:04      DEBUG vjoy id 1: (8, 66, 0) - MATCH
2022-02-08 20:11:04      ERROR Requested vJoy device is not available - vid: 1
2022-02-08 20:11:04      ERROR Requested vJoy device is not available - vid: 1
NoneType: None
2022-02-08 20:11:04      ERROR Failed accessing vJoy id=1, error is: 'Requested vJoy device is not available - vid: 1'
2022-02-08 20:11:04      DEBUG vJoy id 1 can't be acquired
2022-02-08 20:11:04      DEBUG vjoy id 2: (5, 0, 0) - MATCH
2022-02-08 20:11:04      ERROR Requested vJoy device is not available - vid: 2
2022-02-08 20:11:04      ERROR Requested vJoy device is not available - vid: 2
NoneType: None
2022-02-08 20:11:04      ERROR Failed accessing vJoy id=2, error is: 'Requested vJoy device is not available - vid: 2'
2022-02-08 20:11:04      DEBUG vJoy id 2 can't be acquired
2022-02-08 20:11:05      DEBUG vjoy id 3: (8, 63, 0) - MATCH
2022-02-08 20:11:05      DEBUG vjoy id 4: (8, 62, 0) - MATCH
2022-02-08 20:11:05       INFO Checking vJoy installation
2022-02-08 20:11:05       INFO Initializing plugins
2022-02-08 20:11:05      DEBUG Loaded: cycle-modes
2022-02-08 20:11:05      DEBUG Loaded: description
2022-02-08 20:11:05      DEBUG Loaded: macro
2022-02-08 20:11:05      DEBUG Loaded: map-to-keyboard
2022-02-08 20:11:05      DEBUG Loaded: map-to-mouse
2022-02-08 20:11:05      DEBUG Loaded: noop
2022-02-08 20:11:05      DEBUG Loaded: pause
2022-02-08 20:11:05      DEBUG Loaded: play-sound
2022-02-08 20:11:05      DEBUG Loaded: previous-mode
2022-02-08 20:11:05      DEBUG Loaded: remap
2022-02-08 20:11:05      DEBUG Loaded: response-curve
2022-02-08 20:11:05      DEBUG Loaded: resume
2022-02-08 20:11:05      DEBUG Loaded: split-axis
2022-02-08 20:11:05      DEBUG Loaded: switch-mode
2022-02-08 20:11:05      DEBUG Loaded: temporary-mode-switch
2022-02-08 20:11:05      DEBUG Loaded: text-to-speech
2022-02-08 20:11:05      DEBUG Loaded: toggle-pause
2022-02-08 20:11:05      DEBUG Loaded: basic
2022-02-08 20:11:05      DEBUG Loaded: chain
2022-02-08 20:11:05      DEBUG Loaded: double_tap
2022-02-08 20:11:05      DEBUG Loaded: hat_buttons
2022-02-08 20:11:05      DEBUG Loaded: smart_toggle
2022-02-08 20:11:05      DEBUG Loaded: tempo
2022-02-08 20:11:05       INFO Gremlin UI created
2022-02-08 20:11:05       INFO Gremlin UI launching
2022-02-08 23:31:39       INFO Gremlin UI terminated
2022-02-08 23:31:39       INFO Terminating Gremlin

Device order changed system.log:

2022-02-09 21:35:40      DEBUG 2022-02-09 21:35
2022-02-09 21:35:40      DEBUG Starting Joystick Gremlin R13.3
2022-02-09 21:35:40      DEBUG --------------------------------------------------------------------------------
2022-02-09 21:35:41       INFO Initializing joystick devices
2022-02-09 21:35:41      DEBUG 7 joysticks detected
2022-02-09 21:35:41      DEBUG Added: name=vJoy Device guid={249DA520-8799-11EC-8003-444553540000}
2022-02-09 21:35:41      DEBUG Added: name=Logitech G HUB G920 Driving Force Racing Wheel USB guid={8AD6DE50-879F-11EC-8004-444553540000}
2022-02-09 21:35:41      DEBUG Added: name=Joystick - HOTAS Warthog guid={CAF69FC0-8795-11EC-8004-444553540000}
2022-02-09 21:35:41      DEBUG Added: name=TQSUSBA_R1 guid={CAF69FC0-8795-11EC-8005-444553540000}
2022-02-09 21:35:41      DEBUG Added: name=vJoy Device guid={68E2C820-87A1-11EC-800B-444553540000}
2022-02-09 21:35:41      DEBUG Added: name=vJoy Device guid={68EC3E00-87A1-11EC-800D-444553540000}
2022-02-09 21:35:41      DEBUG Added: name=vJoy Device guid={750084B0-87A3-11EC-8002-444553540000}
2022-02-09 21:35:41      DEBUG vJoy guid={249DA520-8799-11EC-8003-444553540000}: (8, 62, 0)
2022-02-09 21:35:41      DEBUG vJoy guid={68E2C820-87A1-11EC-800B-444553540000}: (8, 66, 0)
2022-02-09 21:35:41      DEBUG vJoy guid={68EC3E00-87A1-11EC-800D-444553540000}: (5, 0, 0)
2022-02-09 21:35:41      DEBUG vJoy guid={750084B0-87A3-11EC-8002-444553540000}: (8, 63, 0)
2022-02-09 21:35:41      DEBUG vjoy id 1: (8, 66, 0) - MATCH
2022-02-09 21:35:41      ERROR Requested vJoy device is not available - vid: 1
2022-02-09 21:35:41      ERROR Requested vJoy device is not available - vid: 1
NoneType: None
2022-02-09 21:35:41      ERROR Failed accessing vJoy id=1, error is: 'Requested vJoy device is not available - vid: 1'
2022-02-09 21:35:41      DEBUG vJoy id 1 can't be acquired
2022-02-09 21:35:41      DEBUG vjoy id 2: (5, 0, 0) - MATCH
2022-02-09 21:35:41      ERROR Requested vJoy device is not available - vid: 2
2022-02-09 21:35:41      ERROR Requested vJoy device is not available - vid: 2
NoneType: None
2022-02-09 21:35:41      ERROR Failed accessing vJoy id=2, error is: 'Requested vJoy device is not available - vid: 2'
2022-02-09 21:35:41      DEBUG vJoy id 2 can't be acquired
2022-02-09 21:35:42      DEBUG vjoy id 3: (8, 63, 0) - MATCH
2022-02-09 21:35:42      DEBUG vjoy id 4: (8, 62, 0) - MATCH
2022-02-09 21:35:42       INFO Checking vJoy installation
2022-02-09 21:35:42       INFO Initializing plugins
2022-02-09 21:35:42      DEBUG Loaded: cycle-modes
2022-02-09 21:35:42      DEBUG Loaded: description
2022-02-09 21:35:42      DEBUG Loaded: macro
2022-02-09 21:35:42      DEBUG Loaded: map-to-keyboard
2022-02-09 21:35:42      DEBUG Loaded: map-to-mouse
2022-02-09 21:35:42      DEBUG Loaded: noop
2022-02-09 21:35:42      DEBUG Loaded: pause
2022-02-09 21:35:42      DEBUG Loaded: play-sound
2022-02-09 21:35:42      DEBUG Loaded: previous-mode
2022-02-09 21:35:42      DEBUG Loaded: remap
2022-02-09 21:35:42      DEBUG Loaded: response-curve
2022-02-09 21:35:42      DEBUG Loaded: resume
2022-02-09 21:35:42      DEBUG Loaded: split-axis
2022-02-09 21:35:42      DEBUG Loaded: switch-mode
2022-02-09 21:35:42      DEBUG Loaded: temporary-mode-switch
2022-02-09 21:35:42      DEBUG Loaded: text-to-speech
2022-02-09 21:35:42      DEBUG Loaded: toggle-pause
2022-02-09 21:35:42      DEBUG Loaded: basic
2022-02-09 21:35:42      DEBUG Loaded: chain
2022-02-09 21:35:42      DEBUG Loaded: double_tap
2022-02-09 21:35:42      DEBUG Loaded: hat_buttons
2022-02-09 21:35:42      DEBUG Loaded: smart_toggle
2022-02-09 21:35:42      DEBUG Loaded: tempo
2022-02-09 21:35:42       INFO Gremlin UI created
2022-02-09 21:35:42       INFO Gremlin UI launching
2022-02-09 21:39:59       INFO Gremlin UI terminated
2022-02-09 21:39:59       INFO Terminating Gremlin
WhiteMagic commented 2 years ago

If this reordering affects the internal IDs vJoy uses to identify its devices there is nothing that can be done about this. Gremlin does not use or care about windows assigned device IDs or GUIDs for vJoy devices, as these have their own internal numbering which is used.

ramla commented 2 years ago

I see, this indeed seems to be the case. I think what can be learned here is from the fact that the mappings for the 66-button vjoy loaded happily without warning into a vjoy device that did not have the exact same axis-button-pov config. This might or might not have happened if the correct device was not already in use for the input.