Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ps3 controller trust reset on USB reconnection #2255

Closed
1 task done
twistedddx opened this issue Feb 5, 2024 · 7 comments
Closed
1 task done

ps3 controller trust reset on USB reconnection #2255

twistedddx opened this issue Feb 5, 2024 · 7 comments
Labels

Comments

@twistedddx
Copy link

twistedddx commented Feb 5, 2024

blueman: 2.3.5
BlueZ: 5.64
Distribution: Linux Mint
Desktop environment: xcfe

Everytime I connect USB to a genuine PlayStation 3 controller a "Bluetooth Authentication" pops asking for Always Accept, accept, deny.
I click always accept and the device is shown in blueman Bluetooth Devices with a green tick.
If I disconnect USB and reconnect I am again greeted with Bluetooth Authentication window asking if to always accept, accept or deny. This occurs everytime the USB is reconnected.

I believe this issue was an issue in bluez and was corrected here:
bluez/bluez#372
https://patchwork.kernel.org/project/bluetooth/patch/20220802163441.2522333-1-luiz.dentz@gmail.com/

After a user has manually selected to always accept/trust the device mac that setting should be respected and no future popups are required.

I also have already set:
/etc/bluetooth/input.conf ClassicBondedOnly=false
Which is related to being able to bond to the ps3 controller.

bluetooth.service logs this on USB connection:
bluetoothd: sixaxis: compatible device connected. Sony PLAYSTATION(R)3 Controller
bluetoothd: sixaxis: setting up new device

@twistedddx
Copy link
Author

twistedddx commented Feb 5, 2024

Blueman-applet debug log:

blueman-applet 21.42.29 DEBUG Base:60 do_g_properties_changed: /org/bluez/hci0/dev_{'Trusted': True, 'UUIDs': ['00001124-0000-1000-8000-00805f9b34fb'], 'WakeAllowed': True}
blueman-applet 21.42.35 DEBUG Base:60 do_g_properties_changed: /org/bluez/hci0/dev_{'Trusted': False}
blueman-applet 21.42.35 INFO BluezAgent:237 _on_authorize_service: Agent.Authorize

@infirit
Copy link
Contributor

infirit commented Feb 5, 2024

Blueman is asked to handle authentication and we do. The request is send by BlueZ and we have no control over it.

input.conf should look like this BTW.

[General]
ClassicBondedOnly=false

@twistedddx
Copy link
Author

twistedddx commented Feb 5, 2024

I confirm my input.conf is already as you said.
If ClassicBondedOnly=true, which is the current default, a screen asking for pairing pin opens and the Bluetooth can not connect at all.

There is bluez source located in:
/blueman/bluez
It appears this lacks some patches that the bluez repo has. Including the patch that apparently fixed the trust flipping.
Is that source code used?

@cschramm
Copy link
Member

cschramm commented Feb 5, 2024

As you mentioned correctly, your distribution provides BlueZ 5.64. That does not contain the change that you mention.

@twistedddx
Copy link
Author

I see the Linux Mint BlueZ is just out of date.
I might continue down the path of compiling bluez from source but a temp hack that appears to work is to grab 5.66 deb from Debian repo.

@twistedddx
Copy link
Author

twistedddx commented Feb 9, 2024

I am happy for this issue to be closed as it is as simple as BlueZ 5.64 included in the current Linux Mint 21.3 and Ubuntu 22.04 LTS does not include the fix for this exact issue. My bad for assuming that patch would be included by now and that blueman had an issue.

If anyone ends up finding this issue to try and fix it thsemselves this is the steps I did to build and install BlueZ from source on Linux Mint.

Remove bluez 5.64:
sudo apt remove bluez

Download and build bluez and move bluetoothd to sbin:

cd ~
git clone https://github.com/bluez/bluez.git
cd bluez
./bootstrap
./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-sixaxis
make
sudo make install
sudo cp ./src/bluetoothd /usr/sbin/bluetoothd

Use equivs to tell package manager that you have an equivalent to bluez being installed so that you can reinstall blueman and pulseaudio-module-bluetooth:

sudo apt install equivs
equivs-control bluez
nano bluez

Fill out fields Section, Priority, Standards-Version, Package, Maintainer, Version, Architecture, Description

equivs-build bluez
sudo dpkg -i bluez_5.79_all.deb

Reinstall blueman and pulseaudio-module-bluetooth
sudo apt install blueman pulseaudio-module-bluetooth

Enable Bluetooth bonding via USB:
sudo nano /etc/bluetooth/input.conf
Under [General] set ClassicBondedOnly=false

Restart bluetooth

sudo systemctl daemon-reload
sudo systemctl restart bluetooth

If Bluetooth remains disabled try to unblock Bluetooth
sudo rfkill unblock bluetooth

@twistedddx
Copy link
Author

Apparently I can close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants