Tutorial  Updated

Using an UNWIRED PlayStation 4 controller in Linux (Fedora32)

Even though Bluetooth connections work in PS4 versions of Linux, the PlayStation 4 controller will not connect. I have seen several people say that a wired controller is needed to be used for PS4 Linux. This is not true for Fedora 32 and potentially other distros. As of now, I find Fedora 32 to be the best distro for PS4 Linux. Yes, Fedora and Manjaro both have issues with Bluetooth. I haven't tried Gentoo yet but it probably has the same problem. This guide is here to resolve that.

The PS4 controller is a great overall controller for gaming but also in the OS itself. The touchpad on the controller works just like the touchpad on a laptop in Linux where left click works when you press the bottom left corner and right click being the bottom right. This is really handy for using menus to open different software without having to grab your keyboard.

To note, I'm using a white PS4 Pro CUH-7102B with the original ITMania release of Fedora 32 on 6.72 firmware. The variety of PS4s and kernels available makes it hard to guarantee success. If it works it works, if it doesn't it doesn't. If you're testing, please post the the model number, OS version and firmware to help other users if you have success or not.

For this to work, you will need:

- A PlayStation 4 with Fedora 32 Linux installed.
- A keyboard
- A mouse
- A USB cable to connect your controller to the PS4.
- A seperate PlayStation 4 controller to the one you are using in Orbis. It should also work with PS3 controllers or any controller which connects via Bluetooth and you can also connect via USB.
- A USB hub for connecting multiple devices into slot 2.

Do this at your own risk. Updating the wrong files or errors in changing drivers in Linux can break your install. If you follow instructions correctly, this shouldn't be a problem but look into making backups whenever you mess with drivers if you aren't confident with reinstalling and configuring stuff the way you like it if something does go wrong. (See this thread: https://gbatemp.net/threads/guide-using-a-backup-restore-point-of-your-usb-linux-install.581673/)

1. Uninstall Bluez

in terminal:

sudo su
enter password
dnf remove bluez


2. Install Blueman

in terminal:

dnf install blueman

3. Reboot

4. Pair the controller


Click Menu (bottom left corner) > Preferences > Bluetooth Manager.
Set the controller to seek (hold the playstation button then press share)
Click Device > Trust

5. Make the file /etc/udev/rules.d/bluetooth.rules


in terminal:

sudo su
enter password
sudo nano /etc/udev/rules.d/bluetooth.rules


and add the following in the file:

#
# stops power saving on bluetooth
# install in /etc/udev/rules.d/
ACTION=="add", SUBSYSTEM=="hid", ATTR{power/control}="on"


6. Save and close the file

ctrl + o
press enter
ctrl + x


7. Check to see if Bluetooth is autoenabled

This should be there by default in Fedora 32. In Manjaro it isn't so just to be sure:

in terminal:

sudo nano /etc/bluetooth/main.conf

Scroll down and look for [Policy] and [General]. Somewhere underneath those, it should say:

[Policy]
AutoEnable=true


and

[General]
DiscoverableTimeout = 0
Discoverable=true


If you can't see those under them, add them. You might have lines which begin with a # in between them. Pretend they don't exist. They are notes in the code.

This allows for Linux to boot with Bluetooth enabled. If you use Manjaro, this is also really handy regardless if you are using Bluetooth for a controller or not. I personally use a Bluetooth keyboard.

Save and close the file if you added anything.

ctrl + o
press enter
ctrl + x


8. Reload the rules

in terminal:

udevadm control --reload-rules && udevadm trigger

or reboot the system if you have the patience.

9. Plug the controller into the second USB port and let it recognise it automatically

10. Click "always recognise" in Bluetooth Manager (top right corner)

11. Unplug the controller


You should now have access to the controller wirelessly in Linux.

This is how mine works:



edit:

Issues:

Before you make any changes, update your Linux install. ONLY do this in terminal and back up your install! I cannot stress this enough.

in terminal:

sudo dnf update -x kernel*,libdrm*,mesa*,xorg-x11-drv-a*

Testing takes time. Play around with these suggestions. It can work the way you want it to if you are patient.

Disable Auto-suspend

I have found that after a few hours of not using bluetooth (say you were watching youtube or a movie and not touch your bluetooth device) that there is an autosuspend function in Fedora 32. To avoid headaches, you'll need to fix the "Bluetooth turning off after a short amount of time" problem a lot of users experience. This is due to a power saving function native to Fedora 32. This has also caused problems in different installs, so if you have problems after you make this script, remove it.

in terminal:

sudo su
enter password

sudo nano /etc/rc.local


then add the following to the file:

cd `readlink -f /sys/class/bluetooth/hci0`
cd ../../../power/
echo on > level


then save the file and close it.

ctrl + o
press enter
ctrl + x


This script disables autosuspend for the bluetooth system. It's not entirely necessary but it can be annoying if you are using Linux for other things beyond gaming. I would highly recommend you make this script file as your step 12 and reboot right after that to complete the process.

Also, you want to disable the plugin that reenables this. Right click the bluetooth icon in the taskbar, go to plugins and uncheck "Killswitch" and "PowerManager."

Bluetooth should be completely permanent now.

Manual Re-pairing and Re-trusting

One issue I have come across is if the controller runs out of battery, you will need to re-pair and re-trust the controller. To avoid this, it's easiest to keep it charged. It is also possible for different models to have issues with WiFi and Bluetooth functionality in Linux. (I have only heard of this happening, it is not an issue for me) This may not work in Bluetooth Manager and you will most likely need to re-pair and re-trust it manually. To do that:

in terminal:

bluetoothctl
bluetoothctl show
default-agent
power on
scan on


Now set device to seek.

If it finds your controller, it will say something like this in terminal:

[CHG] Controller 5C:FB:7C:A4:13:C6 Discovering: yes

except 5C:FB:7C:A4:13:C6 will be different. Take note of this.

now to pair the controller. (replace "5C:FB:7C:A4:13:C6" with the address of your own device)

in terminal:

pair 5C:FB:7C:A4:13:C6
trust 5C:FB:7C:A4:13:C6
connect 5C:FB:7C:A4:13:C6


You can test your controller with the touchpad if you are using a PS4 controller.

Software

You must use the standard version of PPSSPP. The Qt version stutters like crazy with a bluetooth connected controller when wired works just fine.

Shout Outs

Shout out to ITmania (https://www.youtube.com/channel/UCkVRqtCIS3Xj-E1HY4j9_EA) for the distros and grabman (https://www.youtube.com/channel/UCzPmgEh1LSc80cRfNPL5GLg) for his videos relating to PS4 Linux.
 
Last edited by bbqtool,

singho1122

Member
Newcomer
Joined
Jul 3, 2022
Messages
6
Trophies
0
Age
40
Location
HONG KONG
XP
28
Country
Hong Kong
Try doing a full reset of the controller using the button on the back of the controller next to the top right screw. (Use a paperclip and hold for 20 seconds)

Install DS4DRV from here:

Then retrust and re-pair the controller in terminal.

Hi Sir,

I followed your steps to reset the controllers, and installed DS4DRV, retrust and re-pair them,

They still paired as white light not blue light, also I don't know how the DS4DRV works, please help
 

Attachments

  • WhatsApp Image 2022-07-03 at 11.42.44 PM.jpeg
    WhatsApp Image 2022-07-03 at 11.42.44 PM.jpeg
    413.6 KB · Views: 47
  • WhatsApp Image 2022-07-03 at 11.42.43 PM.jpeg
    WhatsApp Image 2022-07-03 at 11.42.43 PM.jpeg
    282.7 KB · Views: 54

bbqtool

Well-Known Member
OP
Member
Joined
Aug 21, 2018
Messages
174
Trophies
0
Age
39
XP
1,270
Country
Australia
thanks for your reply!!

I still have questions:

1. reset the controller by paperclip, but what's the controller status first? do you mean when it paired by bluetooth with white light?

2. Fedora 32 can install DS4DRV by above gh link directly?

sorry for many questions.

1. No, so long as the controller has charge you reset it with the controller powered off.

2. Yes. There are instructions to install DS4DRV in the github link which you did in the photo you posted.

Basically, the Bluetooth drivers, PS4 controller drivers and the PS4 aren't very good together. They do work, but it is an effort because they are so sensitive. As in different versions of other drivers make a difference too. Standard Linux problems. If you're using modded_warfare's release of Fedora, I'm not sure what other stuff he has installed/updated which also has an impact on how the drivers work. I'm not using that release, just the original ITmania release.

From memory, you cannot pair two PS4 controllers at once with DS4DRV. I remember reading that somewhere. I can't test it with two controllers because all my PS4 controllers are being used. The PS4 controller needs to be the default agent and PS4s have this weird security with Bluetooth to prevent other controllers from working. If you have multiple Bluetooth devices, it doesn't like it. (If that doesn't mean anything to you, ignore it)

White light is good because it's a step beyond just auto-disconnecting. From what I can tell, the driver has an issue with trusting the controllers or which is the default agent and that's why it's not working.

When you get the white light, try plugging it into the PS4 waiting a few seconds then unplugging. If it stays blue after disconnecting, you're good. It'll stay recognised.

If when you unplug it goes straight back to white, it means it isn't trusted or paired correctly. Reset the controller with the button on the back and paperclip and manually re-pair and retrust it in terminal.

in terminal:

bluetoothctl
bluetoothctl show
default-agent
power on
scan on


Now set device to seek.

If it finds your controller, it will say something like this in terminal:

[CHG] Controller 5C:FB:7C:A4:13:C6 Discovering: yes

except 5C:FB:7C:A4:13:C6 will be different. Take note of this. Copy it.

now to pair the controller. (replace "5C:FB:7C:A4:13:C6" with the address of your own device)

in terminal:

pair 5C:FB:7C:A4:13:C6
trust 5C:FB:7C:A4:13:C6
connect 5C:FB:7C:A4:13:C6


Then plugging it in to the PS4 then unplugging it.

Since I first wrote this, I found that it takes a lot of trial and error because different PS4s use different bluetooth hardware. It might also take a few tries and unplugging and retrusting in different order. I've seen other people complaining about this issue with PS4 controllers with Raspberry Pis and confirmed it might take a few tries unplugging it, re-pairing and retrusting. Once you get it to pair once, it'll stay paired though. Good luck.
 
Last edited by bbqtool,
  • Like
Reactions: godreborn

singho1122

Member
Newcomer
Joined
Jul 3, 2022
Messages
6
Trophies
0
Age
40
Location
HONG KONG
XP
28
Country
Hong Kong
1. No, so long as the controller has charge you reset it with the controller powered off.

2. Yes. There are instructions to install DS4DRV in the github link which you did in the photo you posted.

Basically, the Bluetooth drivers, PS4 controller drivers and the PS4 aren't very good together. They do work, but it is an effort because they are so sensitive. As in different versions of other drivers make a difference too. Standard Linux problems. If you're using modded_warfare's release of Fedora, I'm not sure what other stuff he has installed/updated which also has an impact on how the drivers work. I'm not using that release, just the original ITmania release.

From memory, you cannot pair two PS4 controllers at once with DS4DRV. I remember reading that somewhere. I can't test it with two controllers because all my PS4 controllers are being used. The PS4 controller needs to be the default agent and PS4s have this weird security with Bluetooth to prevent other controllers from working. If you have multiple Bluetooth devices, it doesn't like it. (If that doesn't mean anything to you, ignore it)

White light is good because it's a step beyond just auto-disconnecting. From what I can tell, the driver has an issue with trusting the controllers or which is the default agent and that's why it's not working.

When you get the white light, try plugging it into the PS4 waiting a few seconds then unplugging. If it stays blue after disconnecting, you're good. It'll stay recognised.

If when you unplug it goes straight back to white, it means it isn't trusted or paired correctly. Reset the controller with the button on the back and paperclip and manually re-pair and retrust it in terminal.

in terminal:

bluetoothctl
bluetoothctl show
default-agent
power on
scan on


Now set device to seek.

If it finds your controller, it will say something like this in terminal:

[CHG] Controller 5C:FB:7C:A4:13:C6 Discovering: yes

except 5C:FB:7C:A4:13:C6 will be different. Take note of this. Copy it.

now to pair the controller. (replace "5C:FB:7C:A4:13:C6" with the address of your own device)

in terminal:

pair 5C:FB:7C:A4:13:C6
trust 5C:FB:7C:A4:13:C6
connect 5C:FB:7C:A4:13:C6


Then plugging it in to the PS4 then unplugging it.

Since I first wrote this, I found that it takes a lot of trial and error because different PS4s use different bluetooth hardware. It might also take a few tries and unplugging and retrusting in different order. I've seen other people complaining about this issue with PS4 controllers with Raspberry Pis and confirmed it might take a few tries unplugging it, re-pairing and retrusting. Once you get it to pair once, it'll stay paired though. Good luck.

Hi Sir, thanks for your reply, what's your wireless controler connected bluetooth with which light? blue light?
 

bbqtool

Well-Known Member
OP
Member
Joined
Aug 21, 2018
Messages
174
Trophies
0
Age
39
XP
1,270
Country
Australia
so sad, I connected only white light, I don't know how to make it blue light >.<
Keep playing around with plugging it in/unplugging it when it is white and trusting/pairing it in terminal and which one you do first. If you can get to the white light, chances are it will work you just have to do it in the right order. I don't know what that is but when I've tried to connect the controller, that's what has happened.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    BakerMan @ BakerMan: it looks like a little kids' game, and bunny (welcome btw) is looking for an uncensor patch