DualShock 4 Bluetooth issues
-
I can confirm the same exact bluetooth problem happening with my recent Pi4 4GB purchase running RetroPie 4.7.1 built using the the Pi Imager. What's more strange in my case is I also have a Pi400 working without any issues at all using the same SD with RetroPie installed which makes it seem hardware related but it's my understanding the hardware is the same between the two devices. On the standalone Pi4 I'm getting a series of errors from bluez stating it's not ready and I'm not able to power it on via bluetoothctl. I've used a separate SD and a new image with no success on the standalone Pi4 whereas it continues to work without issue on the Pi400.
-
@endo said in DualShock 4 Bluetooth issues:
On the standalone Pi4 I'm getting a series of errors from bluez stating it's not ready
This looks to be a different issue. Is bluetooth enabled ? Check what
sudo rfkill list all
reports. -
@mitu this software is so buggy and inconsistent. Sometimes I’ll get a bluez error, sometimes the wireless controller will have been connected without me even choosing the controller from the list of found devices (even after I have removed it from the list of connected devices). Other times it won’t find anything. Other times nothing happens and I can start inputting code at the bottoms of the splash screen. If I have the luck of it connecting by random chance (didn’t even get through to choose which device to connect and it connected automatically once) I won’t be able to re connect it on a different gaming session from boot even though the connect mode is set to boot. I’m beginning to think I made a big mistake running retro pie as an emulator.
-
@mrttime I'm regularly using a DS4 controller on a Pi4 (and before that, on a Pi3) and I don't have an issue, either pairing it or using it.
The Bluetooth pairing/connection part it a bit finicky indeed and sometimes requires a 2nd re-scan to find and pair the controller, but it should work.
Do you have any other devices connected to the Pi ? Do you have the Pi in a case or something similar that would interfere with the the Bluetooth wireless ? -
@mitu You’re telling me... Works fine plugged in but it’s been nothing but a pain to get it up and running in wireless mode. I don’t have anything else connected to it besides the keyboard I use to try and set it up. I have it in an official Raspberry Pi case. The case obviously doesn’t interfere with the Bluetooth connectivity because it’s finding the controller and other Bluetooth devices.
Update: latest error: An error occurs connecting to the bluetooth device (Creating device failed: org.bluez.Error.AuthenticationFailed: Authentication Failed)
-
@mitu update: I thought it could maybe be that the PS4 controller is defective or maybe just a model that doesn’t comply with Pi4 but I tried my Xbox One controller and I got the same issue. Doesn’t accept input past security menu and the screen starts moving up with each enter input pressed. I’ll go into the Bluetooth menu to check if the device is synced and it shows the controller as being synced but won’t connect to the Pi.
-
@mitu I've checked rfkill and all is unblocked. I've also tested bluetooth with the standalone Pi 4 with Raspberry Lite and the full Raspberry OS with desktop and all are stating org.bluez.Error.NotReady. When I use bluetoothctl to manually try setting up my controller (which works fine with my Pi400), the Pi 4 sees the controller, let's me pair with it, connects to it, and then immediately disconnects. All the while this is happening, the controller itself is still in pairing mode like nothing has actually happened. I'm debating whether to try and return the board as I just purchased it or just buy a bluetooth dongle and see if that works. Pretty frustrated with the whole process.
-
After another round of research and troubleshooting, I found that running the command below prior to pairing the controller and after each reboot of the OS, works 99% of the time for me. The closest I've gotten to answer so far is laid out in this article on Github. It has to do with the order in which devices and services are starting. I tried the sleep method in the article with no luck. I'm going to keep searching to see if there is a better resolution until this gets resolved in the OS itself because I don't want to have to run that command each time I restart the Pi.
sudo systemctl restart bluetooth
@mitu have you seen or heard of this problem before? That article on Github is from 2018 but this still seems to be a lingering problem for some.
@mrttime hopefully this works for you like it did me so that you can at least move forward with a workaround.
-
@endo Can you post the contents of the
/etc/bluetooth/main.conf
file ?Is the
bluetooth
service enabled ?By default it's enabled and automatically started at boot (you can check withsystemctl status bluetooth
). -
@mitu Below is the main.conf. I posted it as code as it was posting really large otherwise. I haven't modified this file manually at all. I did a restart and verified that the bluetooth service shows as active (running) using
systemctl status bluetooth
although I still have to executesudo systemctl restart bluetooth
for the controller to automatically reconnect.[General] # Defaults to 'BlueZ X.YZ', if Name is not set here and plugin 'hostname' is not loaded. # The plugin 'hostname' is loaded by default and overides the Name set here so # consider modifying /etc/machine-info with variable PRETTY_HOSTNAME=<NewName> instead. #Name = BlueZ # Default device class. Only the major and minor device class bits are # considered. Defaults to '0x000000'. #Class = 0x000100 # How long to stay in discoverable mode before going back to non-discoverable # The value is in seconds. Default is 180, i.e. 3 minutes. # 0 = disable timer, i.e. stay discoverable forever #DiscoverableTimeout = 0 # How long to stay in pairable mode before going back to non-discoverable # The value is in seconds. Default is 0. # 0 = disable timer, i.e. stay pairable forever #PairableTimeout = 0 # Use vendor id source (assigner), vendor, product and version information for # DID profile support. The values are separated by ":" and assigner, VID, PID # and version. # Possible vendor id source values: bluetooth, usb (defaults to usb) #DeviceID = bluetooth:1234:5678:abcd # Do reverse service discovery for previously unknown devices that connect to # us. This option is really only needed for qualification since the BITE tester # doesn't like us doing reverse SDP for some test cases (though there could in # theory be other useful purposes for this too). Defaults to 'true'. #ReverseServiceDiscovery = true # Enable name resolving after inquiry. Set it to 'false' if you don't need # remote devices name and want shorter discovery cycle. Defaults to 'true'. #NameResolving = true # Enable runtime persistency of debug link keys. Default is false which # makes debug link keys valid only for the duration of the connection # that they were created for. #DebugKeys = false # Restricts all controllers to the specified transport. Default value # is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW). # Possible values: "dual", "bredr", "le" #ControllerMode = dual # Enables Multi Profile Specification support. This allows to specify if # system supports only Multiple Profiles Single Device (MPSD) configuration # or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple # Devices (MPMD) configurations. # Possible values: "off", "single", "multiple" #MultiProfile = off # Permanently enables the Fast Connectable setting for adapters that # support it. When enabled other devices can connect faster to us, # however the tradeoff is increased power consumptions. This feature # will fully work only on kernel version 4.1 and newer. Defaults to # 'false'. #FastConnectable = false # Default privacy setting. # Enables use of private address. # Possible values: "off", "device", "network" # "network" option not supported currently # Defaults to "off" # Privacy = off [GATT] # GATT attribute cache. # Possible values: # always: Always cache attributes even for devices not paired, this is # recommended as it is best for interoperability, with more consistent # reconnection times and enables proper tracking of notifications for all # devices. # yes: Only cache attributes of paired devices. # no: Never cache attributes # Default: always #Cache = always # Minimum required Encryption Key Size for accessing secured characteristics. # Possible values: 0 and 7-16. 0 means don't care. # Defaults to 0 # MinEncKeySize = 0 [Policy] # # The ReconnectUUIDs defines the set of remote services that should try # to be reconnected to in case of a link loss (link supervision # timeout). The policy plugin should contain a sane set of values by # default, but this list can be overridden here. By setting the list to # empty the reconnection feature gets disabled. #ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb,0000111f-0000-1000-8000-00805f9b34fb,0000110a-0000-1000-8000-00805f9b34fb # ReconnectAttempts define the number of attempts to reconnect after a link # lost. Setting the value to 0 disables reconnecting feature. #ReconnectAttempts=7 # ReconnectIntervals define the set of intervals in seconds to use in between # attempts. # If the number of attempts defined in ReconnectAttempts is bigger than the # set of intervals the last interval is repeated until the last attempt. #ReconnectIntervals=1,2,4,8,16,32,64 # AutoEnable defines option to enable all controllers when they are found. # This includes adapters present on start as well as adapters that are plugged # in later on. Defaults to 'false'. AutoEnable=true
-
The config is ok - it looks like the stock config that's shipped with Raspberry Pi OS/RetroPie.
-
@mitu Still getting connection issues. (Creating device failed: org.bluez.Error.AuthenticationFailed: Authentication Failed)
-
@mrttime Sorry, don't have any ideas about this one. You can enable debugging in the bluetooth service - see here - and provide a log from the pairing process (use pastebin.com for posting the log), maybe that will shed some light on the error.
-
@mitu OK. Thanks anyway. In one last attempt to maybe figure it out when I get to the point of choosing the security mode and select 1 DisplayYesNo the cursor activates at the bottom of the blue screen and when I press the directional buttons I get output that looks like ^[[C^[[3^[[3^[[D^[[B etc. etc. depending on the key I press.
-
I have this exact same issue using a couple of different Retropie images. It might work the very first time I boot the image, but maybe not - and any following boots I have the same problem (also with a Pi 4).
-
I'm curious if you have the same issue I noticed I have from this thread:
https://www.raspberrypi.org/forums/viewtopic.php?f=140&t=306920
On boot, bluetoothctl and do a "list" to see what the MAC address of your bluetooth device on your pi controller.
Then perform a sudo systemctl restart bluetooth.service
Then go into bluetoothctl and do a list again to see if it's a different MAC address.
When I do this, I do get a different MAC address and at that point, I can connect to bluetooth devices as expected. I have no idea why it has this changing MAC address though. I think I've had this issue on 2 different Pi 4 units.
Editing: Restarting bluetooth.service doesn't always fix it - it seems more likely that just restarting bluetooth gives it a chance to get the right MAC address (which is why sometimes it always works on a reboot).
-
Hi there, I have the exact same issue as the OP, so just to sum up :
- Raspberry PI 4 8GB bought 3 weeks ago (might be a faulty series ?)
- Official Retropie 4.7.1 for RP4/400 up to date
- RAW settings, go to bluetooth, pairing a device
- Press and hold home+share button on the DS4 to get it into pairing mode
- Here the result depends, sometimes there's no device found, sometimes it finds several devices, including my "Wireless Controller"
- If it found my DS4, I select "DisplayYesNo" to start pairing while the DS4 is still blinking in pairing mode
- At that moment, the DS4 starts to display a solid white LED for like 1 sec, and then just shuts down and does nothing more, where I guess it should get to solid blue for successful pairing
- From there, the retropie is just hanging on that "DisplayYesNo" screen and I have to go to remote terminal to reboot it
-
Here is some log, I hope this can help.
So I did stop the bluetooth service (sudo systemctl stop bluetooth.service) and then restarted it with debuging info (sudo bluetoothd -d -n).pi@retropie:~ $ sudo bluetoothd -d -n bluetoothd[1149]: Bluetooth daemon 5.50 bluetoothd[1149]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “DiscoverableTimeout” in group “General” bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “PairableTimeout” in group “General” bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “Privacy” in group “General” bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “Name” in group “General” bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “Class” in group “General” bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “DeviceID” in group “General” bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “ReverseServiceDiscovery” in group “General” bluetoothd[1149]: src/main.c:parse_config() Key file does not have key “MinEncKeySize” in group “GATT” bluetoothd[1149]: src/adapter.c:adapter_init() sending read version command bluetoothd[1149]: Starting SDP server bluetoothd[1149]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:0532 bluetoothd[1149]: src/plugin.c:plugin_init() Loading builtin plugins bluetoothd[1149]: src/plugin.c:add_plugin() Loading hostname plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading wiimote plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading autopair plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading policy plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading neard plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading sap plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading a2dp plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading avrcp plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading network plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading input plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading hog plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading health plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading gap plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading scanparam plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading deviceinfo plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading midi plugin bluetoothd[1149]: src/plugin.c:add_plugin() Loading battery plugin bluetoothd[1149]: src/plugin.c:plugin_init() Loading plugins /usr/lib/arm-linux-gnueabihf/bluetooth/plugins bluetoothd[1149]: src/plugin.c:add_plugin() Loading sixaxis plugin bluetoothd[1149]: profiles/health/hdp.c:hdp_manager_start() Starting Health manager bluetoothd[1149]: profiles/input/suspend-none.c:suspend_init() bluetoothd[1149]: profiles/network/manager.c:read_config() /etc/bluetooth/network.conf: Key file does not have key “DisableSecurity” in group “General” bluetoothd[1149]: profiles/network/manager.c:read_config() Config options: Security=true bluetoothd[1149]: plugins/neard.c:neard_init() Setup neard plugin bluetoothd[1149]: plugins/sixaxis.c:sixaxis_init() bluetoothd[1149]: src/main.c:main() Entering main loop bluetoothd[1149]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 1 op 0 soft 0 hard 0 bluetoothd[1149]: Bluetooth management interface 1.18 initialized bluetoothd[1149]: src/adapter.c:read_version_complete() sending read supported commands command bluetoothd[1149]: src/adapter.c:read_version_complete() sending read index list command bluetoothd[1149]: src/rfkill.c:rfkill_event() RFKILL event idx 1 type 2 op 0 soft 0 hard 0 bluetoothd[1149]: src/adapter.c:read_commands_complete() Number of commands: 79 bluetoothd[1149]: src/adapter.c:read_commands_complete() Number of events: 40 bluetoothd[1149]: src/adapter.c:read_commands_complete() enabling kernel-side connection control bluetoothd[1149]: src/adapter.c:read_index_list_complete() Number of controllers: 1 bluetoothd[1149]: src/adapter.c:read_index_list_complete() Found index 0 bluetoothd[1149]: src/adapter.c:index_added() index 0 bluetoothd[1149]: src/adapter.c:btd_adapter_new() System name: BlueZ 5.50 bluetoothd[1149]: src/adapter.c:btd_adapter_new() Major class: 0 bluetoothd[1149]: src/adapter.c:btd_adapter_new() Minor class: 0 bluetoothd[1149]: src/adapter.c:btd_adapter_new() Modalias: usb:v1D6Bp0246d0532 bluetoothd[1149]: src/adapter.c:btd_adapter_new() Discoverable timeout: 180 seconds bluetoothd[1149]: src/adapter.c:btd_adapter_new() Pairable timeout: 0 seconds bluetoothd[1149]: src/adapter.c:index_added() sending read info command for index 0 bluetoothd[1149]: src/adapter.c:read_info_complete() index 0 status 0x00 bluetoothd[1149]: src/adapter.c:clear_uuids() sending clear uuids command for index 0 bluetoothd[1149]: src/adapter.c:clear_devices() sending clear devices command for index 0 bluetoothd[1149]: src/adapter.c:set_privacy() sending set privacy command for index 0 bluetoothd[1149]: src/adapter.c:set_privacy() setting privacy mode 0x00 for index 0 bluetoothd[1149]: src/gatt-database.c:btd_gatt_database_new() GATT Manager registered for adapter: /org/bluez/hci0 bluetoothd[1149]: src/advertising.c:btd_adv_manager_new() LE Advertising Manager created for adapter: /org/bluez/hci0 bluetoothd[1149]: profiles/audio/a2dp.c:media_server_probe() path /org/bluez/hci0 bluetoothd[1149]: plugins/policy.c:policy_adapter_probe() bluetoothd[1149]: src/adapter.c:set_mode() sending set mode command for index 0 bluetoothd[1149]: plugins/hostname.c:hostname_probe() bluetoothd[1149]: profiles/network/manager.c:panu_server_probe() path /org/bluez/hci0 bluetoothd[1149]: profiles/network/server.c:server_register() Registered interface org.bluez.NetworkServer1 on path /org/bluez/hci0 bluetoothd[1149]: profiles/network/manager.c:gn_server_probe() path /org/bluez/hci0 bluetoothd[1149]: profiles/network/manager.c:nap_server_probe() path /org/bluez/hci0 bluetoothd[1149]: profiles/audio/avrcp.c:avrcp_controller_server_probe() path /org/bluez/hci0 bluetoothd[1149]: src/adapter.c:adapter_service_add() /org/bluez/hci0 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10001 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110f-0000-1000-8000-00805f9 bluetoothd[1149]: src/adapter.c:adapter_service_insert() /org/bluez/hci0 bluetoothd[1149]: src/adapter.c:add_uuid() sending add uuid command for index 0 bluetoothd[1149]: profiles/audio/avrcp.c:avrcp_target_server_probe() path /org/bluez/hci0 bluetoothd[1149]: src/adapter.c:adapter_service_add() /org/bluez/hci0 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10002 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110c-0000-1000-8000-00805f9 bluetoothd[1149]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9 bluetoothd[1149]: src/adapter.c:adapter_service_insert() /org/bluez/hci0 bluetoothd[1149]: src/adapter.c:add_uuid() sending add uuid command for index 0 bluetoothd[1149]: profiles/audio/a2dp.c:a2dp_sink_server_probe() path /org/bluez/hci0 bluetoothd[1149]: profiles/audio/a2dp.c:a2dp_source_server_probe() path /org/bluez/hci0 bluetoothd[1149]: profiles/sap/manager.c:sap_server_probe() path /org/bluez/hci0 bluetoothd[1149]: Sap driver initialization failed. bluetoothd[1149]: sap-server: Operation not permitted (1) bluetoothd[1149]: src/adapter.c:btd_adapter_unblock_address() hci0 00:00:00:00:00:00 bluetoothd[1149]: src/adapter.c:load_link_keys() hci0 keys 0 debug_keys 0 bluetoothd[1149]: src/adapter.c:load_ltks() hci0 keys 0 bluetoothd[1149]: src/adapter.c:load_irks() hci0 irks 0 bluetoothd[1149]: src/adapter.c:load_conn_params() hci0 conn params 0 bluetoothd[1149]: src/adapter.c:adapter_service_insert() /org/bluez/hci0 bluetoothd[1149]: src/adapter.c:add_uuid() sending add uuid command for index 0 bluetoothd[1149]: src/adapter.c:set_did() hci0 source 2 vendor 1d6b product 246 version 532 bluetoothd[1149]: src/adapter.c:adapter_register() Adapter /org/bluez/hci0 registered bluetoothd[1149]: src/adapter.c:set_dev_class() sending set device class command for index 0 bluetoothd[1149]: src/adapter.c:set_name() sending set local name command for index 0 bluetoothd[1149]: src/adapter.c:set_privacy_complete() Successfully set privacy for index 0 bluetoothd[1149]: plugins/hostname.c:property_changed() static hostname: retropie bluetoothd[1149]: plugins/hostname.c:property_changed() pretty hostname: bluetoothd[1149]: plugins/hostname.c:update_name() name: retropie bluetoothd[1149]: src/adapter.c:adapter_set_name() name: retropie bluetoothd[1149]: src/adapter.c:adapter_set_name() alias: retropie bluetoothd[1149]: src/adapter.c:set_name() sending set local name command for index 0 bluetoothd[1149]: plugins/hostname.c:property_changed() chassis: bluetoothd[1149]: Loading LTKs timed out for hci0 bluetoothd[1149]: Failed to set mode: Failed (0x03) bluetoothd[1149]: src/adapter.c:load_link_keys_complete() link keys loaded for hci0 bluetoothd[1149]: src/adapter.c:load_irks_complete() IRKs loaded for hci0 bluetoothd[1149]: src/adapter.c:load_conn_params_complete() Connection Parameters loaded for hci0 bluetoothd[1149]: src/adapter.c:local_name_changed_callback() Name: BlueZ 5.50 bluetoothd[1149]: src/adapter.c:local_name_changed_callback() Short name: bluetoothd[1149]: src/adapter.c:local_name_changed_callback() Current alias: BlueZ 5.50 bluetoothd[1149]: src/adapter.c:local_name_changed_callback() Name: retropie bluetoothd[1149]: src/adapter.c:local_name_changed_callback() Short name: bluetoothd[1149]: src/adapter.c:local_name_changed_callback() Current alias: retropie
-
-
@pscotto1234 Thanks for that sharing, the link provided does explain and works around the issue pretty well, I can now enjoy my PI4 as I wished
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.