Sony publishes an official Linux driver for PlayStation 5 DualSense controllers

HARDWARE -

Well, here’s a nice Christmas surprise … Sony has published a new Linux kernel driver “hid-playstation” to bring the PlayStation 5 DualSense controller and it will also be used to support other PlayStation hardware on Linux.

This new Linux kernel driver supports the PlayStation 5 “DualSense” game controller in USB and Bluetooth modes. All the main features, along with LEDs, motion sensors, touchpad, battery, lightbar and noise are supported by this official Sony Linux driver.

The Linux kernel already has the existing “hid-sony” driver, while this PlayStation 5 game controller comes with the hid-playstation driver. In announcing the new driver, they are planning to move part of Sony Interactive Entertainment’s hardware support from existing hid-sony drivers to hid-playstation drivers. The hid-sony driver will continue to be maintained and used by larger Sony devices. This new driver follows Sony’s change about a year ago “officially” keeping the incoming Linux driver hidden.

The Linux driver exposes DualSense functionality as a ‘rendering device’ similar to DualShock 4 in hid-sony, spanning several frameworks. First, it exposes 3 evdev nodes for the ‘gamepad’, ‘touchpad’ and ‘motion sensors’ respectively. The FF framework is used to provide basic rumble capabilities. The leds class is used to implement the Player indicator LEDs below the DualSense touchpad, while the new ‘leds-class-multicolor’ is used for the light bars next to the touchpad.

New exclusive features introduced by DualSense, such as Adaptive Triggers and VCM-based Haptics, are not yet supported. These features require a large amount of data and complex data structures. It is not clear how to expose this. The current Evdev and FF structures are very limiting. We hope to have a dialogue on how to expose them over time in a generic way.

This new driver comes with just over 1,400 lines of code in its initial form aimed at the PS5 controller. When transitioning from support for older hardware to this new driver, there is also a promise of unit test coverage and more.

The new HID-PlayStation driver is currently under review and is not yet in line for installation, but those who want to try it out can find the 13 patches for testing.

Separately, SDL 2.0.14 was also released this week with its initial mapping support for the PlayStation 5 control buttons for that library that is widely used by cross-platform games.

.Source