Debian 11 bluetooth sap driver initialization failed
I tried connecting my speaking to my laptop through bluetooth and as I was connecting to it the laptop gave the message "The setup of ACTION II has failed." I did some searching around, installed the non-free repository but its still not working. Eventually I found this post and decided to see what my PC would respond with. I executed systemctl status bluetooth.service
which resulted in:
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-06-07 20:19:30 CEST; 20min ago
Docs: man:bluetoothd(8)
Main PID: 686 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 18984)
Memory: 6.7M
CPU: 105ms
CGroup: /system.slice/bluetooth.service
└─686 /usr/libexec/bluetooth/bluetoothd
Jun 07 20:19:30 debian bluetoothd[686]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Jun 07 20:19:30 debian bluetoothd[686]: sap-server: Operation not permitted (1)
Jun 07 20:20:40 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
Jun 07 20:20:40 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-source profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
Jun 07 20:21:22 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
Jun 07 20:21:22 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-source profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
Jun 07 20:21:24 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
Jun 07 20:21:24 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-source profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
Jun 07 20:21:28 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
Jun 07 20:21:28 debian bluetoothd[686]: src/service.c:btd_service_connect() a2dp-source profile connect failed for 54:B7:E5:6D:D3:68: Protocol not available
I haven’t really been able to find what the sap driver even is or how to install it, I’m quite new to linux so I’m afraid of like burning the house down if I download the wrong thing lol. Appreciate the help!
The messages you’re seeing indicate two separate issues.
Bluetooth audio not working
The messages like
src/service.c:btd_service_connect() a2dp-sink profile connect failed for <Bluetooth device address>: Protocol not available
src/service.c:btd_service_connect() a2dp-source profile connect failed for <Bluetooth device address>: Protocol not available
suggest that the package pulseaudio-module-bluetooth
might be missing. Debian 11 defaults to handling Bluetooth audio devices using PulseAudio.
Messages about SAP
In the context of Bluetooth, SAP refers to SIM Access Profile: a Bluetooth profile that allows a smartphone in your pocket to lend the use of its SIM/USIM card to mobile phone hardware that’s built into a car (or to an aftermarket car kit), to take advantage of a car-optimized hands-free capabilities, a better antenna, and the availability of more power for the radio components from the car’s electrical system.
It should be obvious that such SIM card sharing should be allowed only between trusted, paired devices.
In a desktop or a laptop with no SIM card slot and no mobile phone network communication capabilities, the Bluetooth SIM Access Profile is quite useless. It is present in the BlueZ software suite because apparently this part of the software suite was used in some old smartphones. The API for the SIM Access Protocol is still present, but to make any use of it, you would have to write a suitable interface between BlueZ and a SIM card reader (= the SAP driver).
The BlueZ source package still includes a sap-dummy.c
file as an example of how to write a SAP driver. If I understood the code correctly, instead of communicating with a real SIM card, sap-dummy.c
will provide a D-Bus interface, which would allow troubleshooting of the SAP features of another Bluetooth device… which might be useful when developing smartphones and the like.
It seems to me that the sap-server: Operation not permitted (1)
error message is caused by the D-Bus not being configured by default with the necessary permissions to allow the SAP dummy interface to be set up.
The only other SAP driver that used to exist in the BlueZ source code tree was specific to the ST-Ericsson U8500 platform for smartphones and tablets, which was announced back in 2011. That code was removed from the repository in 2017 with the comments that the U8500 platform is "long dead".
So unless you are building your own device with mobile phone network connectivity, you can safely ignore it.
If you want to clean up the messages, you might want to write a /etc/systemd/system/bluetooth.service.d/override.conf
file with the following contents:
[Service]
ExecStart=
ExecStart=/usr/libexec/bluetooth/bluetoothd --noplugin=sap
This will cause the bluetoothd
process to be started with the --noplugin=sap
option added, which will disable the remnants of the SAP functionality and silence the messages related to the Bluetooth SAP profile.
According to the Debian package changelog, the maintainer of Debian’s BlueZ packages made the choice of enabling the SAP profile support back in 2011, and hasn’t revised that particular decision since.
A bug report already exists referring to this issue.