Kernic

Just my toughts.

Winwingsim URSA MINOR, Elite: Dangerous and Linux

Elite: Dangerous on Linux has a tendency to recognize joysticks as Xbox controllers. The cause lies somewhere within Proton/Wine, but there's a solution. For my future self, and for you, here's a short guide.

๐Ÿ”Š Read out blogpost
๐Ÿ“ฅ Download MP3

The Problem

I installed Elite: Dangerous via Steam on my Arch Linux system. Since the game isn’t natively available for Linux, Steam delivers the Windows version and runs it using its compatibility layer, Proton. This works surprisingly well for many games, including Elite: Dangerous. However, it involves translating system calls from Linux to the corresponding Windows calls, and that doesn’t always go perfectly.

So, I connected my two Winwingsim URSA MINOR sticks to my PC via USB and checked their functionality with the small program jstest. Apart from some strange mapping, the joysticks worked flawlessly. All axes, sliders, and buttons were recognized. So, nothing should stand in the way of some spaceship fun, right?

Unfortunately, that wasn’t the case. When I went into the Elite: Dangerous settings to map the controls, I was immediately shown strange icons. Why is the Z-axis in Elite: Dangerous supposedly the left trigger? Why is the primary fire button A? The game seems to think I have two Xbox controllers connected, not two joysticks.

The Cause

The cause is likely a combination of Valve’s Proton and Elite: Dangerous. The joysticks are registered in the layer, but in a way that makes them look like controllers to the space simulation. That’s why the game switches to controller mode.

In a bit more detail, the joysticks are created as xinput devices in the registry. Xinput is a Microsoft API specifically for gaming controllers and is, among other things, the reason why controllers either use DirectInput or are limited to a maximum of ten recognized buttons. My joysticks, however, each have over 30 buttons, which makes not only the axis mapping but especially the use of the buttons problematic.

I did some research and was eventually pointed to a page with the solution by Beko Pharm from the Stellanebula Project.

The Solution

The solution is actually quite simple. You go into the registry and change the type from xinput to winehid. How exactly does that work?

  1. Open a terminal.
  2. export WINEPREFIX=/PATH/TO/STEAM/steamapps/compatdata/359320/pfx
    The path to Steam depends on your system. For me, it was /home/kernic/.steam/steam/steamapps/compatdata/359320/pfx
  3. wine regedit
  4. A new window will open, the Registry Editor. Navigate to HKEY_LOCAL_MACHINE/System/CurrentControlSet/Enum
  5. There are two relevant subfolders, winebus and winexinput. Start with the first one; you should find an entry for each joystick with its ID.
    1. If you don’t know the ID of your joysticks, open a new terminal and type XXX.
  6. Open the first joystick; a subfolder will become visible. Go into it.
  7. Change the following fields:
    1. Service from xinput to winehid.
    2. CompatibleIDs to WINEBUS\WINE_COMP_HID.
    3. Class to HIDClass.
  8. Repeat this for the second joystick, if you have one.
  9. Afterwards, go into the winexinput folder and check the same fields there. For me, they were adjusted automatically. If that’s not the case, adjust them.
  10. Close the Registry Editor, start Elite: Dangerous, and check in the settings if everything is correct.

That’s it. You can find more tips at the link above. However, for me, they caused more problems than they solved.