Kernel not supporting Bluetooth SPP?


#1

Hello,

The Bluetooth Serial Port Profile (SPP) is a commonly used connection method using Bluetooth Classic. I’ve been trying to implement an SPP server on the Dragonboard with the latest kernel on Debian Stretch (209 build):

$ uname -a
Linux linaro-alip 4.9.0-linaro-lt-qcom #1 SMP PREEMPT Mon Apr 3 08:58:12 UTC 2017 aarch64 GNU/Linux

However when I start the server I get the following in the Bluetooth logs:

= bluetoothd: RFCOMM server failed for SerialPort: socket(STREAM, RFCOMM): Protocol not supported (93)

I am being told on the BlueZ mail list:

That usually means that your kernel is incorrectly configured and lacking RFCOMM support.

I am not easily able to swap back to an older kernel so I haven’t tested previous versions. Either way it seems like support of RFCOMM might be useful to support. Is there a reason the kernel doesn’t support RFCOMM?

Thanks,
Barry


Procedure of Bluetooth Rfcomm
#2

Hello,

I noticed that there are also issues being reported from the Bluetooth service as the daemon starts up:

$ sudo service bluetooth status
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2017-04-10 06:21:10 UTC; 27min ago
     Docs: man:bluetoothd(8)
 Main PID: 1908 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/bluetooth.service
           └─1908 /usr/lib/bluetooth/bluetoothd

Apr 10 06:21:10 linaro-alip bluetoothd[1908]: Bluetooth daemon 5.43
Apr 10 06:21:10 linaro-alip bluetoothd[1908]: Starting SDP server
Apr 10 06:21:10 linaro-alip bluetoothd[1908]: Bluetooth management interface 1.14 initialized
Apr 10 06:21:10 linaro-alip bluetoothd[1908]: Failed to obtain handles for "Service Changed" characteristic
Apr 10 06:21:10 linaro-alip bluetoothd[1908]: Sap driver initialization failed.
Apr 10 06:21:10 linaro-alip bluetoothd[1908]: sap-server: Operation not permitted (1)
Apr 10 06:21:15 linaro-alip bluetoothd[1908]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSource
Apr 10 06:21:15 linaro-alip bluetoothd[1908]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSink
Apr 10 06:21:15 linaro-alip bluetoothd[1908]: RFCOMM server failed for Headset Voice gateway: socket(STREAM, RFCOMM): Protoc lines 1-19/19

#3

hi @barryb,

thanks for your time, and for finding this issue. It was indeed something we missed when moving from 4.4 kernel to 4.9! I have submitted a patch for it, and started new build. If all goes well there will be #210 with the fix in a couple of hours.

thanks again for your help!


#4

Hi @ndec,

That seems to be a lot better. However I am still seeing this:

$ sudo service bluetooth status
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2017-04-10 21:55:45 UTC; 19s ago
     Docs: man:bluetoothd(8)
 Main PID: 2496 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/bluetooth.service
           └─2496 /usr/lib/bluetooth/bluetoothd

Apr 10 21:55:45 linaro-alip bluetoothd[2496]: Bluetooth daemon 5.43
Apr 10 21:55:45 linaro-alip bluetoothd[2496]: Starting SDP server
Apr 10 21:55:45 linaro-alip bluetoothd[2496]: Bluetooth management interface 1.14 initialized
Apr 10 21:55:45 linaro-alip bluetoothd[2496]: Failed to obtain handles for "Service Changed" characteristic
Apr 10 21:55:45 linaro-alip bluetoothd[2496]: Sap driver initialization failed.
Apr 10 21:55:45 linaro-alip bluetoothd[2496]: sap-server: Operation not permitted (1)
Apr 10 21:55:45 linaro-alip bluetoothd[2496]: Endpoint registered: sender=:1.39 path=/MediaEndpoint/A2DPSource
Apr 10 21:55:45 linaro-alip bluetoothd[2496]: Endpoint registered: sender=:1.39 path=/MediaEndpoint/A2DPSink

Doesn’t appear to be an issue for what I’m doing but I thought I’d feed it back anyway.

Thanks.


#5

thanks for the feedback. To be honest, i am not sure this needs to be considered as an issue. SAP server is related to SIM card, so it’s not too much of a surprise if it fails. By the way, it fails the same way on my laptop (also running Debian). So unless someone knows more about that, I am tempted to ignore that for now…


#6

Agreed.

This is probably why in the next release (5.44) of BlueZ the SAP profile is disabled by default and you have to enable it:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/README?h=5.44#n201


#7

Hi guys,
I got lost, then, Is SPP Bluetooth service works on DragonBoard 410c or not ?

Regards,

Wilson.


#8

Hi Wilson,

I have SPP working on the Dragonboard with the 210 snapshot.
https://builds.96boards.org/snapshots/dragonboard410c/linaro/debian/210/

I have posted over in another thread how I got it working:

Does that help?


#9

Hi Barry

Thank you !!!