WineHQ
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Maintained by Aric Stewart

If you find incorrect information here please contact me.

HID (Human Interface Devices) in WINE

HID support has been added to Wine. It is now used as a backend for every game controller device and all the relevant APIs to access them from the Windows side. It is implemented over the host's libSDL or evdev, although pass-through of host HID devices is also possible when they are accessible through hidraw.

Relevant Debug Channels

  • +hid: Traces all HID stack events
  • +rawinput: Traces for the RawInput frontend
  • +dinput: Traces for the DInput frontend
  • +xinput: Traces for the XInput frontend
  • +input: Traces for the Windows.Gaming.input frontend

Pass-through of specific HID devices

Some devices, such as the Sony DualShock and Sony DualSense are using a proprietary protocol that is the only way to access features such as LED control or advanced haptics. This protocol is supported by several Windows applications, and the only way to make it accessible to them is to setup the HID stack in pass-through mode directly to the host HID device, through hidraw.

On Linux, by default, no hidraw devices are not accessible to normal users. You will need to either add rw permission to the /dev/hidraw<X> device that you want to have accessible in Wine, or better, add a new udev rule to automatically allow access on matching devices when they are added.

Several distributions already provide packages that contain the necessary udev rules for these devices. Most of them are related to Steam, and on Debian the package is named steam-devices. Installing this package (you don't even need to install Steam) should be enough to have the udev rules installed and no manual setup will then be necessary. For manual configuration, the relevant udev rules to copy can be found in that package sources [1].

Tools to use with device testing

  • hid_test.exe: Wine tests written around direct HID access, in the wine tree dlls/hid/tests.
  • hclient.exe: This is distributed by Microsoft in the DDK (and various free download sites if you are so inclined). This tool will enumerate devices and allow for all various levels of control and exploration.
  • hid.exe: (https://www.codeweavers.com/xfer/aric/HID/ access-key: sLcm7EZ7) A quick sample application for testing HID joysticks and gamepads with source.
  • HID descriptor parser: (http://eleccelerator.com/usbdescreqparser/) a web page to parse descriptor byte strings. Useful for debugging devices.

Devices that have been tested

Device Platform(s) Status
Logitech Rumblepad 2 Linux / OS/X Working
Xbox360 Controller OS/X Working (with 3rd party drivers installed)
Steam Controller ---- Not Working
MY-POWER / CSL (low budget ps3 controller) Linux Working
Playstation 4 Controller (DS4) OS/X Working

Previous Talks given by Aric Stewart at WineConfs


This page was last edited on 25 February 2024, at 11:00.