-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support VKB Gladiator NXT EVO and Virpil Constellation #197
Conversation
Hello @kakra, I'm not particularly familiar with this corner of Proton's wine build. Please add a note why this needs to be added downstream instead of in the upstream wine project. If it can go upstream, then that should be done first, and then use this merge request to track backporting the upstream commit. |
If the hidraw support is also upstream, I'd send this upstream. Until then, I'd like to figure things out working here first maybe with support from the community. I need to figure out if upstream has these hidraw patches. If they do, I'll rebase to latest wine for proper tracking here. Or maybe someone from Valve knows, @ivyl maybe? |
Sounds reasonable, if you say the device works better with hidraw. And yes, I believe there's some driver registry cache mechanism. I'm not completely sure how to override it. Upstream doesn't yet have the same winebus.sys dual-backend mode as Proton, so this probably won't apply, although it would be nice to have it at some point. |
It only works with hidraw, otherwise mappings within wine are completely messed up and xinput devices seem to generate contradicting inputs with more than half of the axes and buttons dead. |
@rbernon Yes it seems like it is exactly that: a cache. A way to override or invalidate it would be mostly useful as it improves end-user experience a lot and reduces support burden when new devices are supported or added through Also, this needs added entries for the Steam udev rules. Should I file a PR? If I remember correctly, there's a Valve repo for that. |
394382c
to
ce9b9f2
Compare
937081e
to
d4112ed
Compare
This adds generic hidraw support for Thrustmaster because at least T16000m throttle and joystick also need hidraw access. Also it add Virpil and VKB as mentioned here: - ValveSoftware/wine#197 - ValveSoftware/Proton#6839
@kisak-valve @rbernon This doesn't apply to wine upstream because it is missing I've modified the decision logic to also being able to look at the amount of buttons and axes. This way, we can do a more generic approach to identifying modern and highly customizable HOTAS because they often come with a fixed and high amount of HID buttons (used for macro programming at the hardware level). I didn't test it in action (because the Proton build scripts currently do not work for me) but the code seems to compile. To be used with: ValveSoftware/steam-devices#51 |
For some reason, after a reboot, the joysticks become recognized as xinput devices again. It looks like SDL feeds them back into wine although they were deferred to a different backend and I set SDL to ignore those devices:
But then:
although it clearly said Full log: steam-359320.log |
Isn't this simply the driver cache in action? It's something in setupapi I believe, but I don't really know how we can invalidate it. Maybe it could check whether the DeviceIds / HardwareIds / CompatibleIds have changed since last time, and invalidate itself if it is the case (we report |
ce9b9f2
to
bc8f640
Compare
d4112ed
to
b8930b8
Compare
Would this properly invalidate the cache? diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index ae676f80565..77c4a392368 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -189,7 +189,10 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device)
WCHAR *dst;
if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR))))
- swprintf(dst, len, L"%i&%s&%x&%i", ext->desc.version, ext->desc.serialnumber, ext->desc.uid, ext->index);
+ {
+ swprintf(dst, len, L"%u&%s&%x&%u&%u", ext->desc.version, ext->desc.serialnumber,
+ ext->desc.uid, ext->index, ext->desc.is_gamepad);
+ }
return dst;
} |
@rbernon I see that also the internal Steam gamepad configuration sees these joysticks as Xbox gamepads. So what we observe may be resulting from Steam Input. Currently, I disabled the Steam overlay for that game (Elite Dangerous, because the overlay somehow sometimes triggered itself without pressing shift+tab). This probably also means, Steam Input is not working for the game, and I haven't seen the issue from my previous comment again:
From that perspective, I'd say your above suggestion should work because it includes |
This reverts commit 87fbf33. We saw hangs in Phasmophobia with the commit, and then discovered this commit is not strictly necessary for ntlea, so we revert it.
bc8f640
to
95ebcfa
Compare
This is useful to detect some devices which do not have a well-known PID set. Link: ValveSoftware/Proton#6839 (comment)
These devices ship with 128 buttons by default. For game compatibility, the VKB Windows app can be used to change the HID descriptor to show only 32 buttons and have up to 4 virtual devices instead. These devices can also show up as a mouse or keyboard and send proper HID events for that configuration - not tested with this commit. The Linux input layer gets really confused by these devices as the HID descriptor spans multiple ranges of different device type event codes. Hopefully, winebus.sys hidraw mode can work around this. Also needs udev rules to enable hidraw access. Known limits: - Elite Dangerous: 32 buttons - Star Citizen: 50 buttons - some other games: 64 buttons Signed-off-by: Kai Krakow <[email protected]>
b8930b8
to
d324c52
Compare
95ebcfa
to
cb163ce
Compare
I've merged this internally, will be in a future Proton Experimental release. |
winebus.sys: Append is_gamepad to the device instance id. Link: #197
…led() winebus.sys: Also pass axis and button count to is_hidraw_enabled() This is useful to detect some devices which do not have a well-known PID set. Link: ValveSoftware/Proton#6839 (comment) Link: #197
winebus.sys: Enable hidraw for VKB Gladiator NXT EVO. These devices ship with 128 buttons by default. For game compatibility, the VKB Windows app can be used to change the HID descriptor to show only 32 buttons and have up to 4 virtual devices instead. These devices can also show up as a mouse or keyboard and send proper HID events for that configuration - not tested with this commit. The Linux input layer gets really confused by these devices as the HID descriptor spans multiple ranges of different device type event codes. Hopefully, winebus.sys hidraw mode can work around this. Also needs udev rules to enable hidraw access. Known limits: - Elite Dangerous: 32 buttons - Star Citizen: 50 buttons - some other games: 64 buttons Signed-off-by: Kai Krakow <[email protected]> Link: #197
winebus.sys: Enable hidraw for Virpil Constellation ALPHA-R. Fixes: ValveSoftware/Proton#6839 Link: #197
winebus.sys: Append is_gamepad to the device instance id. Link: #197
…led() winebus.sys: Also pass axis and button count to is_hidraw_enabled() This is useful to detect some devices which do not have a well-known PID set. Link: ValveSoftware/Proton#6839 (comment) Link: #197
winebus.sys: Enable hidraw for VKB Gladiator NXT EVO. These devices ship with 128 buttons by default. For game compatibility, the VKB Windows app can be used to change the HID descriptor to show only 32 buttons and have up to 4 virtual devices instead. These devices can also show up as a mouse or keyboard and send proper HID events for that configuration - not tested with this commit. The Linux input layer gets really confused by these devices as the HID descriptor spans multiple ranges of different device type event codes. Hopefully, winebus.sys hidraw mode can work around this. Also needs udev rules to enable hidraw access. Known limits: - Elite Dangerous: 32 buttons - Star Citizen: 50 buttons - some other games: 64 buttons Signed-off-by: Kai Krakow <[email protected]> Link: #197
winebus.sys: Enable hidraw for Virpil Constellation ALPHA-R. Fixes: ValveSoftware/Proton#6839 Link: #197
This is useful to detect some devices which do not have a well-known PID set. Link: ValveSoftware/Proton#6839 (comment) Link: ValveSoftware#197
These devices ship with 128 buttons by default. For game compatibility, the VKB Windows app can be used to change the HID descriptor to show only 32 buttons and have up to 4 virtual devices instead. These devices can also show up as a mouse or keyboard and send proper HID events for that configuration - not tested with this commit. The Linux input layer gets really confused by these devices as the HID descriptor spans multiple ranges of different device type event codes. Hopefully, winebus.sys hidraw mode can work around this. Also needs udev rules to enable hidraw access. Known limits: - Elite Dangerous: 32 buttons - Star Citizen: 50 buttons - some other games: 64 buttons Signed-off-by: Kai Krakow <[email protected]> Link: ValveSoftware#197
This is useful to detect some devices which do not have a well-known PID set. Link: ValveSoftware/Proton#6839 (comment) Link: ValveSoftware/wine#197
These devices ship with 128 buttons by default. For game compatibility, the VKB Windows app can be used to change the HID descriptor to show only 32 buttons and have up to 4 virtual devices instead. These devices can also show up as a mouse or keyboard and send proper HID events for that configuration - not tested with this commit. The Linux input layer gets really confused by these devices as the HID descriptor spans multiple ranges of different device type event codes. Hopefully, winebus.sys hidraw mode can work around this. Also needs udev rules to enable hidraw access. Known limits: - Elite Dangerous: 32 buttons - Star Citizen: 50 buttons - some other games: 64 buttons Signed-off-by: Kai Krakow <[email protected]> Link: ValveSoftware/wine#197
These devices ship with 128 buttons by default. For game compatibility, the VKB Windows app can be used to change the HID descriptor to show only 32 buttons and have up to 4 virtual devices instead. These devices can also show up as a mouse or keyboard and send proper HID events for that configuration - not tested with this commit.
The Linux input layer gets really confused by these devices as the HID descriptor spans multiple ranges of different device type event codes. Hopefully, winebus.sys hidraw mode can work around this. Also needs udev rules to enable hidraw access.
Device info maybe relevant for implementation:
Known limits:
Todo:
Without this patch, it's currently the same as running with
PROTON_ENABLE_HIDRAW=0x23D1/0x0200,0x23D1/0x0201
.Notes
There's a hint about games seeing a gamepad with other HOTAS, too:
0084:trace:hid:udev_add_device hidraw "/dev/hidraw6": deferring {vid 231d, pid 0200, version 2122, input 0, uid 00000000, is_gamepad 0} to a different backend
The Windows software supports creating a registry patch which adds these entries:
But this looks like just creating empty nodes. Edit: It seems that this actually deletes contents from the nodes.
Wine adds registry entries linking the device to winebus driver but also to xinput:
System\\CurrentControlSet\\Enum\\WINEBUS\\VID_231D&PID_0201
(vid/pid exists lower and upper case in the registry)system.reg
properly links the joystick to the HID driver next time the game starts