Bluetooth Ubuntu Server [ RockPi X ]

I am doing some experiments with BT using the (stock) Ubuntu Kernel (Server) but I have a feeling some setting is needed in the BIOS.

Before I go with my own kernel with EFI support, does anyone have the BT working without issues in Linux? If so, which kernel version?

Here is the kernel message to investigate:

ubuntu@rockpix:~$ dmesg|grep -i bcm
[    8.405175] hci_uart_bcm serial0-0: Unexpected ACPI gpio_int_idx: -1
[    8.405181] hci_uart_bcm serial0-0: Unexpected number of ACPI GPIOs: 2
[    8.405460] hci_uart_bcm serial0-0: serial0-0 supply vbat not found, using dummy regulator
[    8.405496] hci_uart_bcm serial0-0: serial0-0 supply vddio not found, using dummy regulator
[    8.651291] Bluetooth: hci0: BCM: failed to write clock (-56)
[    8.777163] Bluetooth: hci0: BCM: chip id 107
[    8.779430] Bluetooth: hci0: BCM: features 0x2f
[    8.802594] Bluetooth: hci0: BCM4345C0
[    8.802602] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0000
[   10.864485] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[   10.977524] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[   10.989123] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Mar  1 2015 07:29:38 version 7.45.18 (r538002) FWID 01-6a2c8ad4
[   15.340350] Bluetooth: hci0: BCM: failed to write clock (-56)
[   15.460750] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0339
ubuntu@rockpix:~$ hcitool dev
Devices:
	hci0	10:2C:6B:50:66:E1
ubuntu@rockpix:~$ uname -ra
Linux rockpix 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:37:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Managed to build the latest mainline kernel, but BT is in the same situation. It is lighter than the ubuntu kernel, but some funny things about the pinctrl. I had /dev/i2c with Ubuntu kernel, now it’s gone.

Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.10.0-rc7-rockpix x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Fri 11 Dec 2020 08:48:15 PM UTC

  System load:            0.08
  Usage of /:             42.3% of 13.67GB
  Memory usage:           6%
  Swap usage:             0%
  Temperature:            51.0 C
  Processes:              111
  Users logged in:        1
  IPv4 address for wlan0: 192.168.254.73
  IPv6 address for wlan0: 2804:7f4:3580:4e5c:122c:6bff:fe50:66e0

0 updates can be installed immediately.
0 of these updates are security updates.


Last login: Fri Dec 11 20:37:41 2020

Regarding BT:

ubuntu@rockpix:~$ sudo dmesg|grep -i bcm
[sudo] password for ubuntu: 
[    7.547849] hci_uart_bcm serial0-0: Unexpected ACPI gpio_int_idx: -1
[    7.547854] hci_uart_bcm serial0-0: Unexpected number of ACPI GPIOs: 2
[    7.809498] Bluetooth: hci0: BCM: failed to write clock (-56)
[    7.924775] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    7.944007] Bluetooth: hci0: BCM: chip id 107
[    7.946391] Bluetooth: hci0: BCM: features 0x2f
[    7.969531] Bluetooth: hci0: BCM4345C0
[    7.969539] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0000
[    7.970325] Bluetooth: hci0: BCM4345C0 'brcm/BCM4345C0.hcd' Patch
[    8.039637] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    8.040059] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Mar  1 2015 07:29:38 version 7.45.18 (r538002) FWID 01-6a2c8ad4
[   14.521251] Bluetooth: hci0: BCM: failed to write clock (-56)
[   14.676727] Bluetooth: hci0: BCM43455 37.4MHz Raspberry Pi 3+
[   14.676761] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0339

I have received the board with BIOS up to date and have not changed any settings.

The missing i2c seems to be related to:

[    7.081985] ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion] (20200925/evregion-264)
[    7.086539] ACPI Error: Aborting method \_SB.STR0._TMP due to previous error (AE_ERROR) (20200925/psparse-529)

The board is running smooth, wlan0 working fine.

  • Fixed with the correct PINCTRL config

Just for the record in the case, if someone wants to follow this, I can stream sound from a phone to the rockpix but I get choppy sound. Increasing the buffer (latency), get a little better.

	Name: bluez_card.00_17_CA_F7_38_18
	Driver: module-bluez5-device.c
	Owner Module: 29
	Properties:
		device.description = "Haier HW-W910"
		device.string = "00:17:CA:F7:38:18"
		device.api = "bluez"
		device.class = "sound"
		device.bus = "bluetooth"
		device.form_factor = "phone"
		bluez.path = "/org/bluez/hci0/dev_00_17_CA_F7_38_18"
		bluez.class = "0x5a020c"
		bluez.alias = "Haier HW-W910"
		device.icon_name = "audio-card-bluetooth"
	Profiles:
		a2dp_source: High Fidelity Capture (A2DP Source) (sinks: 0, sources: 1, priority: 20, available: yes)
		headset_audio_gateway: Headset Audio Gateway (HSP/HFP) (sinks: 1, sources: 1, priority: 10, available: no)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: a2dp_source
	Ports:
		phone-output: Phone (priority: 0, latency offset: 90000 usec, not available)
			Part of profile(s): headset_audio_gateway
		phone-input: Phone (priority: 0, latency offset: 0 usec, available)
			Part of profile(s): a2dp_source, headset_audio_gateway

Tested on the latest mainline kernel:

Linux rockpix 5.10.0-rockpix #1 SMP Tue Dec 15 12:45:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

[ 4708.801055] Bluetooth: Unexpected start frame (len 592)
[ 4711.640801] Bluetooth: Unexpected start frame (len 592)
[ 4739.688247] Bluetooth: Unexpected start frame (len 592)
[ 4773.055502] Bluetooth: Unexpected start frame (len 592)
[ 4775.541031] Bluetooth: Unexpected start frame (len 592)
[ 4792.225429] Bluetooth: Unexpected start frame (len 592)
[ 4884.170283] Bluetooth: Unexpected start frame (len 592)
[ 4887.010090] Bluetooth: Unexpected start frame (len 592)
[ 4920.025093] Bluetooth: Unexpected start frame (len 592)
[ 4942.035408] Bluetooth: Unexpected start frame (len 592)

Maybe I am using the wrong BT patch (tested many) or some uart config needed, who knows.