Proton icon indicating copy to clipboard operation
Proton copied to clipboard

Joystick axes stuck at max - winebus uses signed HID range, breaks games using HidP_GetUsageValue (Arma Reforger 1874880)

Open EchoTD opened this issue 8 months ago • 2 comments

Compatibility Report

  • Name of the game with compatibility issues: Arma Reforger
  • Steam AppID of the game: 1874880

System Information

  • GPU: AMD RX 6800 (Navi 21)

  • Video driver version: mesa 1:26.0.1-1

  • Kernel version: 6.19.6-arch1-1

  • Link to full system information report as Gist: https://gist.github.com/EchoTD/f4be146c2e70a6ab4bd7c9d1b43ddda0

  • Proton version: GE-Proton10-12

I confirm:

  • [x] that I haven't found an existing compatibility report for this game.
  • [x] that I have checked whether there are updates for my system available.

Symptoms

Joystick analog axes (Logitech Extreme 3D Pro) are stuck at maximum value. Buttons work correctly. Affects any game that reads joystick axes via Raw Input API + HidP_GetUsageValue (Arma Reforger's Enfusion engine does this).

Root cause: dlls/winebus.sys/bus_sdl.c declares joystick axes with a signed HID logical range (-32768 to 32767) because that's SDL's native range. However, HidP_GetUsageValue returns a ULONG (unsigned) per Windows API spec. On real Windows hardware, joystick HID descriptors use unsigned logical ranges (e.g. 0-1023). When a game calls HidP_GetUsageValue on Wine's virtual HID device, small negative values near center (e.g. -97) are returned as large unsigned values (e.g. 0xFFFFFF9F for 32-bit or 0xFF9F for 16-bit), appearing as max deflection.

Games using DirectInput are unaffected because dinput/joystick_hid.c handles signed→unsigned conversion internally via scale_axis_value(). Only games bypassing DirectInput and parsing HID reports directly (via RegisterRawInputDevices + GetRawInputData + HidP_GetUsageValue) are affected.

Two-line fix:

dlls/winebus.sys/bus_sdl.c (line 371) — change axis logical range to unsigned:

// FROM:
hid_device_add_axes(iface, 1, ..., FALSE, -32768, 32767)
// TO:
hid_device_add_axes(iface, 1, ..., FALSE, 0, 65535)

dlls/winebus.sys/hid.c in hid_device_set_abs_axis() — offset SDL signed values to unsigned:

// FROM:
return hid_device_set_axis(state, index, value);
// TO:
return hid_device_set_axis(state, index, value + 32768);

Reproduction

  1. Connect a non-Xbox joystick (e.g. Logitech Extreme 3D Pro)
  2. Launch Arma Reforger with any Proton version
  3. Configure joystick via custom .conf file (joystick0:axis0 etc.)
  4. Enter a helicopter — all analog axes are stuck at maximum deflection
  5. Buttons work normally

steam-1874880.log.gz

EchoTD avatar Mar 14 '26 23:03 EchoTD

Hello @EchoTD, we're using one issue report per unofficially supported game title, so I've gone ahead and transferred this issue report to https://github.com/ValveSoftware/Proton/issues/5847#issuecomment-4061791859.

kisak-valve avatar Mar 15 '26 00:03 kisak-valve

I ran into this issue with aircraft in VRChat (PC mode) using Logitech Extreme 3D Pro.

The game sees the center at half backward and right. When I move the joystick forward or left of center such that the values are negative, it snaps to the far backward or right.

I've been troubleshooting with ChatGPT for hours and it inaccurately pointed me to #5847. As @EchoTD mentioned, this is not specific to Arma Reforger and I don't think it should be marked as a duplicate of that catch-all issue.

Edit: I found a solution! Just need to enable hidraw which overrides SDL, if I correctly understand what's happening under the hood. Thanks to @KnifeOfDunwall in #8672 for the missing piece ChatGPT never mentioned, which I slightly modified here.

As root, create udev rules (e.g. /etc/udev/rules.d/99-joystick.rules) with this for Logitech Extreme 3D Pro:

SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c215", MODE="0666"

For other devices, find the IDs with lsusb.

Reload the rules:

sudo udevadm control --reload-rules
sudo udevadm trigger

In the game's launch options, again with the vendor/product ID for this specific joystick:

PROTON_ENABLE_HIDRAW=0x046D/0xC215 %command%

That should work. At least it does for VRChat. However, in this case the game doesn't support assigning buttons or axes and it uses the throttle as rudder when I want the Z axis to be rudder. My workaround is to use QJoyPad to translate joystick inputs to keyboard keys and mouse inputs. I have to center the throttle to prevent it from conflicting. Not ideal, but good enough.

pilot51 avatar Nov 08 '26 05:11 pilot51