A few of my users are reporting trouble getting input from Virpil flight sticks. The crazy thing is that the device is recognised and the interactive rebind is working as intended, being detected and serialised into the bindings json preferences as <HID::VIRPIL Controls/20210102 L-VPC Stick WarBRD>.
In-game, the device sends no input. At first I thought the device wasn’t being paired with the user (I have a steering wheel which exhibits the same behaviour) so I added an in-game console for logging and this potentially dangerous forceful pairing code:
Console.Instance.LogMessage("** USER INPUT ENABLED **");
foreach (var inputDevice in InputSystem.devices) {
Console.Instance.LogMessage(inputDevice.name + " detected");
InputUser.PerformPairingWithDevice(inputDevice, playerInput.user);
}
Console.Instance.LogMessage("---");
foreach (var playerInputDevice in playerInput.devices) {
Console.Instance.LogMessage(playerInputDevice.displayName + " paired");
}
Which, for me, does make the steering wheel work. But for my users, nothing is different while the system is reporting that the devices are correctly paired with the user:
Other devices like an xbox controller work fine for these users. Additionally, if the bindings file simply states <joystick>/stick/[axis] then the typical axes do work but only for the most common ones like stick x and y.
As I don’t have access to this device myself, is there anything I can add to aid in debugging this? Can I bypass the path system and reference a direct device id or something? I’ve been fighting this one for the entire weekend and I’m absolutely at a loss.
** USER INPUT ENABLED **
Keyboard with path </Keyboard> detected
Mouse with path </Mouse> detected
ATMEL/VIRPIL/200325 LEFT VPC Stick MT-50 with path </ATMEL/VIRPIL/200325 LEFT VPC Stick MT-50> detected
ATMEL/VIRPIL/200325 RIGHT VPC Stick MT-50 with path </ATMEL/VIRPIL/200325 RIGHT VPC Stick MT-50> detected
ATMEL/VIRPIL/200325 RIGHT VPC Stick MT-50 not paired to user! Pairing ...
---
ATMEL/VIRPIL/200325 LEFT VPC Stick MT-50 paired
Keyboard paired
Mouse paired
ATMEL/VIRPIL/200325 RIGHT VPC Stick MT-50 paired
The device is binding, the device is detected, the device is paired and there is still no input from either stick. I am absolutely tearing my hair out over this, so many of my users have this freaking flight stick
User attempted to use just the left stick (the one that didn’t need forceably binding), no difference. I’m convinced there’s something about the path causing this issue. The numbers? The extra slashes? the dash? I have no idea.
Oof… I could totally see a situation where the reported HID name contains a ‘/’ in the device causing an issue with path parsing… I wonder if you could manually escape the ‘/’ character to get around that…
My business develops custom XR peripherals and prototypes, uses HOTAS on the regular, etc. I haven’t encountered a device with that kind of HID friendly path.
Also feel free and ping me with a DM here or on Unity Discord (AngryArugula) - happy to help debug this ugliness because I’m sure it’ll come up in my own tasks at some point!
Ahahah it’s amazing how rough around the edges things are in HID world
Unfortunately, I don’t have access to any Virpil sticks myself to do some under-the-hood debugging, only what’s reported by users. I’m not generating custom descriptors for them.
One user’s stick was detected as <HID::VIRPIL Controls/20210102 R-VPC Stick WarBRD>/button31 while another was detected as /ATMEL/VIRPIL/200325 RIGHT VPC Stick MT-50/stick/y (not sure why one was HID::[name]) and both have slashes in the descriptor.
That said, I dug into the input system code and found this
// Try to walk the name as far as we can.
var indexInComponent = startIndexInComponent;
while (indexInPath < pathLength)
{
// Check if we've reached a terminator in the path.
var nextCharInPath = path[indexInPath];
if (nextCharInPath == '\\' && indexInPath + 1 < pathLength)
{
// Escaped character. Bypass treatment of special characters below.
++indexInPath;
nextCharInPath = path[indexInPath];
}
else
{
if (nextCharInPath == '/')
break;
It allows for an escape character so I send a modified binding preferences file to one of the affected users with the path’s renamed to /ATMEL\\/VIRPIL\\/200325 RIGHT VPC Stick MT-50/stick/y and that still didn’t cut the mustard so that may be a dead end too. Or there’s multiple problems at once, who knows?
/ATMEL/VIRPIL/200325 RIGHT VPC Stick MT-50/stick/y
This on the other hand might be a virtual input device getting picked up based on VIRPIL’s VPC software configuration…
In lieu of actually having one of the devices on-hand and configured the same way… its possible to just capture every last InputEvent that references the afflicted controllers and write it out to a binary stream, then regenerate it and play it back on your side.
VPC software from VIRPIL is free to download and setup; but I noticed that the VPC Installer had a checkbox for USB Device Filter which registered some misc virtual USB crap when I clicked it.
Other than that the docs are pretty sparse. It would make sense for them to have a input-aggregating thing though as they make a huge pile of peripherals with so many different firmwares heh.
I don’t think its a bug though, I think VIRPIL are the only people on earth using a common path delimiting character as part of their Hardware unique HID identifier. Congrats on sorting them out!
If you think this can be a more generic problem, you should still submit a bug, Unity at least can consider a defense against such a thing. The worst scenario is that they close the bug without doing anything.
I absolutely ran into this problem too- generic Teensy joysticks are named “Keyboard/Mouse/Joystick”- and It took me waaaay longer to notice this than you so kudos! I’m +1 to it feeling buggy- in my case I had to modify the USB descriptor to use letters there, and that was a major PITA-
Depending on what an API is reading, a lot of USB information can actually be changed inside the Windows registry after the device’s driver has been installed. Often you can actually tag additional information like “Friendly Name” that wasn’t there at all and that’ll get picked up preferentially over the USB HID descriptor.
It unfortunately wasn’t application side- I did try as @Fenrisul suggested and modified registry values, but it’s a total PITA and wasn’t consistent enough. I was writing the values for a custom TEENSY micro, and I just modified the HID information for it when i was flashing it.
In general, I’m not terribly knowledgeable about what it was i was doing- It was mostly rabbit holes of information- but generally threads like these: https://forum.pjrc.com/threads/23523-Change-device-name allowed me to eventually modify the correct files to allow me to add my own device info.
Wow, everyone who replied to this post is my hero. I actually did post an issue on this a good 9 months or so ago and no one replied. I do own two Virbil joysticks as well as the Virgil rudder controls and I tried everything I could to get inputs to register but no go. Clearly smarter people have been able to figure out the problem, jukibom, thanks for letting the Virbil people know. If I remember right their rudder periferal input doesn’t even show in unity but I doubt you have any need for that.