Using a Dualshock 4 on Linux 6.3+

calendar

April 29, 2023

categories
Guides
tags
dualshock sony
comments

1 Comment

Content:

The Dualshock 4 is a great controller to use for gaming on Linux. Drivers are available which support the controller out of the box, including support for the speaker and headphone jack.

However, following driver changes in Linux 6.3, you could have found your controller non-functional. This article will explain the changes, and what you need to do to get your controller working again.

Before going any further, this article is focused on a recent change to the HID driver required for the Dualshock 4. This is only relevant to Linux users who compile their own kernels.

Driver Changes

Back in 2020, Sony released a brand new Linux driver to support their PS5 Dualsense controller, as covered at the time by Phoronix. This driver, named hid-playstation, is described as exposing support for all of the main Dualsense features.

The intention at the time was to eventually move some existing driver support from the older hid-sony driver, which was used for other peripherals such as the Dualshock 3/4. Linux 6.2 added support for the Dualshock 4 to hid-playstation, and Linux 6.3 has seen Dualshock 4 support stripped from hid-sony.

Despite this, the kernel source for Linux 6.3 still describes hid-sony as supporting the Dualshock 4, which could cause confusion when your controller is no longer functional.

Updating Your Kernel

If you’re using the hid-sony driver, you’ll need to switch to hid-playstation for Linux 6.3+ to keep using your controller.

Depending on your kernel config, this option might not be visible, due to an additional prerequisite being required compared to hid-sony.

Due to additional LED support being exposed in this new driver, CONFIG_LEDS_CLASS_MULTICOLOR needs to be enabled before you can enable hid-playstation. This option can be found under Device Drivers > LED Support.

Kernel config help page for config_leds_class_multicolor
Ensure that CONFIG_LEDS_CLASS_MULTICOLOR is enabled

With this enabled, it is then possible to also enable the new hid-playstation driver, by setting CONFIG_HID_PLAYSTATION.

Kernel config help page for config_hid_playstation

Recompile and install the new kernel, and your Dualshock 4 should work again as it did previously.

It’s worth noting that at this time, Dualshock 3 support is absent from hid-playstation. If you also use Dualshock 3 controllers, ensure hid-sony is still enabled.

It will be interesting to see how many additional drivers are moved to the new driver going forward.

If you like what we do, consider supporting us on Ko-fi