Optimize Bluetooth LE L2CAP throughput between Linux running bluer l2cat and iOS

272 Views Asked by At

In transferring a raw stream of data over Bluetooth LE L2CAP between Linux and iOS, I get a throughput of approx. 9 kilobyte payload per sec. I expected to be able to transfer approx. 25 kB/s.

How can I investigate and/or optimize on the transfer rate?

Client Details

The L2CAP client is an iPhone 13 Pro running iOS 16 using the "CBL2CAPChannel-Demo" app over PSM 0x95.

It is essentially using Apple's open2LCAPChannel(_ PSM:) method in CBPeripheral.

As far as I see, Apple offers no configuration options for changing connection intervals, MTUs or anything like that. It all seems to be automatic.

Server Details

The L2CAP server is a Linux computer running Linux 5.10 using the bluez Bluetooth stack.

The test program is the command l2cat from Rust's bluer-tools.

I have used btmon to examine the exchanged packets, and they seem to be generally either 188 or 243 bytes in length.

Per Apple's recommendation, I have tried setting the connection interval min/max to 15 like so:

echo 15 > /sys/kernel/debug/bluetooth/hci0/conn_min_interval
echo 15 > /sys/kernel/debug/bluetooth/hci0/conn_max_interval

It did not have any effect on throughput.

How can I tell whether the Bluetooth module is using the 1Mbps PHY or the 2Mbps PHY?

I have tested the server on two seperate types of hardware:

  1. Raspberry Pi CM4 with its built-in Bluetooth module and an external antennae

  2. i.MX 8M Mini computer with an Intel WiFi 6 AX200 module and an external antennae

Note: It was tested with two different types of external antennae, and it was verified that the antennaes were connected properly.

0

There are 0 best solutions below