Bluetooth works on desktop but not on ubuntu core

Bug #2006517 reported by Wendell Duncan
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bluez (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

We have built a snap that uses some bluetooth functionality.

The snap runs well when using Ubuntu desktop 22.04 (all updates applied end of Jan 2022).
We have tried using this same snap on Ubuntu Core 22 running on X86_64.

On some hardware platforms (thinkpad E15 and x86 Mac) everything works as expected.
We can install the snap on Jammy 22.04 or Core 22 on these platforms and get expected functionality regardless of OS.

On our targeted platform (a Dell 5570) things are not working. When running 22.04 Jammy, everything works. When running Core 22, some advanced bluetooth functionality is not available.
Since the Core 22 image installs and runs on other X86_64 hardware we suspect a device driver issue.

Attached are several files taken from the Dell 5570
1) dmesg from Core 22.
2) dmesg from Jammy 22.04
3) output of lspci from Jammy 22.04
4) Output of lsusb from Jammy 22.04

Tags: jammy
Revision history for this message
Wendell Duncan (wduncan) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 2006517

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Wendell Duncan (wduncan) wrote :

This bug is for Core - so apport-collect is not available.

Adding some more logging output in this comment. I believe our bug is a result of the logging at that says: src/advertising.c:read_adv_features_callback() Failed to read advertising features: Not Supported (0x0c)

Our code does try to call the bluetooth adv_features. The same snap package does work when install on different hardware.

Feb 07 23:50:34 ubuntu systemd[1]: Started Service for snap application bluez.bluez.
Feb 07 23:50:34 ubuntu bluetoothd[1562]: Starting SDP server
Feb 07 23:50:34 ubuntu audit[2041]: AVC apparmor="ALLOWED" operation="recvmsg" profile="snap.nvidia-assemble.nvidia-assemble" pid=2041 comm="udevadm" family="netlink" sock_type="raw" protocol=15 requested_mask="receive" denied_mask="receive"
Feb 07 23:50:34 ubuntu dbus-daemon[1300]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.7' (uid=0 pid=1562 comm="/snap/bluez/331/usr/lib/bluetooth/bluetoothd -E " label="snap.bluez.bluez (enforce)")
Feb 07 23:50:34 ubuntu bluetoothd[1562]: Bluetooth management interface 1.21 initialized
Feb 07 23:50:34 ubuntu bluetoothd[1562]: Battery Provider Manager created
Feb 07 23:50:34 ubuntu audit[1562]: AVC apparmor="DENIED" operation="create" profile="snap.bluez.bluez" pid=1562 comm="bluetoothd" family="alg" sock_type="seqpacket" protocol=0 requested_mask="create" denied_mask="create"
Feb 07 23:50:34 ubuntu bluetoothd[1562]: src/advertising.c:read_adv_features_callback() Failed to read advertising features: Not Supported (0x0c)
Feb 07 23:50:34 ubuntu bluetoothd[1562]: Adv Monitor Manager created with supported features:0x00000001, enabled features:0x00000001, max number of supported monitors:32, max number of supported patterns:16
Feb 07 23:50:34 ubuntu kernel: Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Feb 07 23:50:34 ubuntu kernel: Bluetooth: BNEP filters: protocol multicast
Feb 07 23:50:34 ubuntu kernel: Bluetooth: BNEP socket layer initialized

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

When you run desktop on the Dell 5570 (where everything works), what files are open by the bluetoothd process? Anything unusual in /dev/ ?

tags: added: jammy
Revision history for this message
Wendell Duncan (wduncan) wrote : Re: [Bug 2006517] Re: Bluetooth works on desktop but not on ubuntu core

I don't see any files opened by bluetoothd.

No output from: "lsof | grep bluetoothd"

I find the bluetooth device is at /dev/bus/usb/003/004, and don't see
anything unusual in the usb tree in /dev. The bluetooth is enumerating
on the usb bus in the same place or both Jammy and Core.

On Wed, 2023-02-08 at 06:01 +0000, Daniel van Vugt wrote:
> [You don't often get email from <email address hidden>. Learn why
> this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> CAUTION: This email originated from outside of the organization. Do
> not click links or open attachments unless you recognize the sender
> and know the content is safe.
>
>
> When you run desktop on the Dell 5570 (where everything works), what
> files are open by the bluetoothd process? Anything unusual in /dev/ ?
>
>
> ** Tags added: jammy
>
> --
> You received this bug notification because you are subscribed to the
> bug
> report.
> https://bugs.launchpad.net/bugs/2006517
>
> Title:
>   Bluetooth works on desktop but not on ubuntu core
>
> Status in linux package in Ubuntu:
>   Confirmed
>
> Bug description:
>   We have built a snap that uses some bluetooth functionality.
>
>   The snap runs well when using Ubuntu desktop 22.04 (all updates
> applied end of Jan 2022).
>   We have tried using this same snap on Ubuntu Core 22 running on
> X86_64.
>
>   On some hardware platforms (thinkpad E15 and x86 Mac) everything
> works as expected.
>   We can install the snap on Jammy 22.04 or Core 22 on these
> platforms and get expected functionality regardless of OS.
>
>
>   On our targeted platform (a Dell 5570) things are not working.
> When running 22.04 Jammy, everything works.  When running Core 22,
> some advanced bluetooth functionality is not available.
>   Since the Core 22 image installs and runs on other X86_64 hardware
> we suspect a device driver issue.
>
>   Attached are several files taken from the Dell 5570
>   1) dmesg from Core 22.
>   2) dmesg from Jammy 22.04
>   3) output of lspci from Jammy 22.04
>   4) Output of lsusb from Jammy 22.04
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2006517/+subscriptions
>

Revision history for this message
Wendell Duncan (wduncan) wrote :

Doing a bit of research on this.

I found these two bug reports that are similar:

https://github.com/bluez/bluez/issues/434
https://github.com/bluez/bluez/issues/434

The apt version of bluez in Jammy is 5.64.
The snap version of bluez on the Core 22 branch is 5.64.

Is the pc-kernel snap missing some kernel config options for bluetooth?
On Core, the /proc/config.gz configuration file is not available.

I also turned on the bluez debugging logs and have attached the
produced logs. This logging line is related to our issue.

src/advertising.c:read_adv_features_callback() Failed to read
advertising features: Not Supported (0x0c)

On Wed, 2023-02-08 at 06:01 +0000, Daniel van Vugt wrote:
> [You don't often get email from <email address hidden>. Learn why
> this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> CAUTION: This email originated from outside of the organization. Do
> not click links or open attachments unless you recognize the sender
> and know the content is safe.
>
>
> When you run desktop on the Dell 5570 (where everything works), what
> files are open by the bluetoothd process? Anything unusual in /dev/ ?
>
>
> ** Tags added: jammy
>
> --
> You received this bug notification because you are subscribed to the
> bug
> report.
> https://bugs.launchpad.net/bugs/2006517
>
> Title:
>   Bluetooth works on desktop but not on ubuntu core
>
> Status in linux package in Ubuntu:
>   Confirmed
>
> Bug description:
>   We have built a snap that uses some bluetooth functionality.
>
>   The snap runs well when using Ubuntu desktop 22.04 (all updates
> applied end of Jan 2022).
>   We have tried using this same snap on Ubuntu Core 22 running on
> X86_64.
>
>   On some hardware platforms (thinkpad E15 and x86 Mac) everything
> works as expected.
>   We can install the snap on Jammy 22.04 or Core 22 on these
> platforms and get expected functionality regardless of OS.
>
>
>   On our targeted platform (a Dell 5570) things are not working.
> When running 22.04 Jammy, everything works.  When running Core 22,
> some advanced bluetooth functionality is not available.
>   Since the Core 22 image installs and runs on other X86_64 hardware
> we suspect a device driver issue.
>
>   Attached are several files taken from the Dell 5570
>   1) dmesg from Core 22.
>   2) dmesg from Jammy 22.04
>   3) output of lspci from Jammy 22.04
>   4) Output of lsusb from Jammy 22.04
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2006517/+subscriptions
>

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The locality to this apparmor denial suggests to me it's just the bluez snap that needs to request some extra privileges.

Feb 07 23:50:34 ubuntu audit[1562]: AVC apparmor="DENIED" operation="create" profile="snap.bluez.bluez" pid=1562 comm="bluetoothd" family="alg" sock_type="seqpacket" protocol=0 requested_mask="create" denied_mask="create"
Feb 07 23:50:34 ubuntu bluetoothd[1562]: src/advertising.c:read_adv_features_callback() Failed to read advertising features: Not Supported (0x0c)

affects: linux (Ubuntu) → bluez (Ubuntu)
Revision history for this message
Alex Kaluzhny (alex-kaluzhny) wrote :

@Daniel,
The same Ubuntu Core image works as expected on the Thinkpad E15 and x86 Mac. Why would the lack of "some extra privileges" impact how it runs on the Dell system, but not Thinkpad and Mac?

Revision history for this message
Dilyn (dilyn-corner) wrote :

@Daniel,

Those denials should be resolved by this PR (https://github.com/snapcore/snapd/pull/12496). The problem is if we run this snap in devmode, skipping over apparmor entirely, the root problem still exists. Namely, bluetooth does not function on the device. With the relevant interface changes made and the snap installed fully confined on the two devices Alex mentions above, the snap in question works fine. This indicates to me that this is more a problem with something in the pc-kernel snap.

Revision history for this message
AceLan Kao (acelankao) wrote :

Are you sure the function is lost? Looks like the Adv Monitor is running even the features callback returns an invalid value.

Feb 07 23:50:34 ubuntu bluetoothd[1562]: src/advertising.c:read_adv_features_callback() Failed to read advertising features: Not Supported (0x0c)
Feb 07 23:50:34 ubuntu bluetoothd[1562]: Adv Monitor Manager created with supported features:0x00000001, enabled features:0x00000001, max number of supported monitors:32, max number of supported patterns:16

Revision history for this message
Wendell Duncan (wduncan) wrote :

I'm not sure what your question means "Are you sure the function is lost?"

The logging messages in this comment thread are from the logging from bluetoothd.

We have our own software that we run at a later point that attempts to use the bluetooth adv_features, but it fails to find any adv_features available. The error messages are reporting the same issue as the bluetoothd logging from the bluez package.

Same version of the bluetoothd software that does not work on Core22 works fine on the same hardware if running Jammy.

Revision history for this message
AceLan Kao (acelankao) wrote :

From the dmesg logs, the kernel you use on desktop(5.15.0-56) and on core(5.15.0-58) are not the same, but I've checked the kernel logs, there is no update on bt driver part between the 2 kernel versions. It'd be good if you can help me to update the kernel to make sure the kernel versions are identical and check the issue again.(I feel the result won't change)

The snap package works on desktop, but not on core, this doesn't look like a kernel/driver issue. Could you provide more info about which function call failed? or provide a simple program that we could try on our side?

BTW, the difference between the dmesg logs is that rfcomm is loaded on the desktop, but not on the core system, could you also try to load it on the core system to see if it makes any difference, thanks.

Revision history for this message
Wendell Duncan (wduncan) wrote :

I refreshed the pc-kernel on Ubuntu Core.

22/candidate: 5.15.0-66.73.1 2023-02-14 (1224)

Output from uname:
uname -a
Linux BRMD-0009.I2SMicro.com 5.15.0-66-generic #73-Ubuntu SMP Fri Feb 3
14:23:37 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Logging from journalctl.

Feb 22 21:08:41 ubuntu bluetoothd[1758]: Bluetooth daemon 5.64
Feb 22 21:08:41 ubuntu systemd[1]: Started Service for snap application
bluez.bluez.
Feb 22 21:08:41 ubuntu bluetoothd[1758]: Starting SDP server
Feb 22 21:08:41 ubuntu dbus-daemon[1520]: [system] Activating via
systemd: service name='org.freedesktop.hostname1' unit='dbus-
org.freedesktop.hostname1.service' requested by ':1.7' (uid=0 pid=17>
Feb 22 21:08:41 ubuntu audit[1758]: AVC apparmor="DENIED"
operation="create" profile="snap.bluez.bluez" pid=1758
comm="bluetoothd" family="alg" sock_type="seqpacket" protocol=0
requested_mask="cr>
Feb 22 21:08:41 ubuntu bluetoothd[1758]: Bluetooth management interface
1.21 initialized
Feb 22 21:08:41 ubuntu bluetoothd[1758]: Battery Provider Manager
created
Feb 22 21:08:41 ubuntu bluetoothd[1758]:
src/advertising.c:read_adv_features_callback() Failed to read
advertising features: Not Supported (0x0c)
Feb 22 21:08:41 ubuntu bluetoothd[1758]: Adv Monitor Manager created
with supported features:0x00000001, enabled features:0x00000001, max
number of supported monitors:32, max number of supported >

The software that logs the above error is just the Canonical bluez
snap.
On an ubuntu core22 system: snap install --channel=22/stable bluez

bluez 22/stable: 5.64-2 2022-05-03 (331)

So a vanilla Ubuntu Core22 install -- then install the bluez 22/stable
snap. The bluetoothd system daemon reports the error.

Wendell

On Sat, 2023-02-18 at 01:49 +0000, AceLan Kao wrote:
> CAUTION: This email originated from outside of the organization. Do
> not click links or open attachments unless you recognize the sender
> and know the content is safe.
>
>
> From the dmesg logs, the kernel you use on desktop(5.15.0-56) and on
> core(5.15.0-58) are not the same, but I've checked the kernel logs,
> there is no update on bt driver part between the 2 kernel versions.
> It'd
> be good if you can help me to update the kernel to make sure the
> kernel
> versions are identical and check the issue again.(I feel the result
> won't change)
>
> The snap package works on desktop, but not on core, this doesn't look
> like a kernel/driver issue. Could you provide more info about which
> function call failed? or provide a simple program that we could try
> on
> our side?
>
> BTW, the difference between the dmesg logs is that rfcomm is loaded
> on
> the desktop, but not on the core system, could you also try to load
> it
> on the core system to see if it makes any difference, thanks.
>
> --

Revision history for this message
Rex Tsai (chihchun) wrote :

The title of the bug seems incorrect, the Bluetooth AdvertisementMonitor does not work with bluetoohd from bluez 22/stable: 5.64-2 2022-05-03 with Ubuntu Core22 on Dell Precision 5570.

I would assume the rest of bluetooth functions and profile are still working, eg
% bluetoothctl show

If order to isolate the root cause is between kernel hci driver or bluetoothd. Could you please run the following commands on core to see if the hci driver works as expected?
% sudo btmgmt version
% sudo btmgmt revision
% sudo btmgmt monitor.features
% sudo btmon --mgmt

Revision history for this message
Wendell Duncan (wduncan) wrote :

Requested output:

------------------------------- bluez.bluetoothctl show

root@ubuntu:/home/wduncan# bluez.bluetoothctl show
Controller 14:75:5B:5B:3A:91 (public)
 Name: BlueZ 5.64
 Alias: BlueZ 5.64
 Class: 0x00000000
 Powered: no
 Discoverable: no
 DiscoverableTimeout: 0x000000b4
 Pairable: no
 UUID: Generic Attribute Profile (00001801-0000-1000-8000-
00805f9b34fb)
 UUID: Generic Access Profile (00001800-0000-1000-8000-
00805f9b34fb)
 UUID: PnP Information (00001200-0000-1000-8000-
00805f9b34fb)
 UUID: A/V Remote Control Target (0000110c-0000-1000-8000-
00805f9b34fb)
 UUID: A/V Remote Control (0000110e-0000-1000-8000-
00805f9b34fb)
 UUID: Device Information (0000180a-0000-1000-8000-
00805f9b34fb)
 Modalias: usb:v1D6Bp0246d0540
 Discovering: no
 Roles: central
 Roles: peripheral
 Roles: central-peripheral
 ExperimentalFeatures: BlueZ Experimental Simu.. (671b10b5-
42c0-4696-9227-eb28d1b049d6)
 ExperimentalFeatures: BlueZ Experimental LL p.. (15c0a148-
c273-11ea-b3de-0242ac130004)
Advertisement Monitor Features:
 SupportedMonitorTypes: or_patterns

------------------------------- bluez.btmgmt version

root@BRMD-0009:/tmp# bluez.btmgmt version
Unable to open mgmt_socket

------------------------------- bluez.btmgmt revision

root@BRMD-0009:/tmp# bluez.btmgmt revision
Unable to open mgmt_socket

------------------------------- bluez.btmgmt monitor.features

root@BRMD-0009:/tmp# bluez.btmgmt monitor.features
Unable to open mgmt_socket

------------------------------- bluez.btmon --mgmt

root@BRMD-0009:/tmp# bluez.btmon --mgmt
Bluetooth monitor ver 5.64
Failed to open channel: Permission denied------------------------------
- bluetoothctl show

On Fri, 2023-03-10 at 05:04 +0000, Rex Tsai wrote:
> CAUTION: This email originated from outside of the organization. Do
> not click links or open attachments unless you recognize the sender
> and know the content is safe.
>
>
> The title of the bug seems incorrect, the Bluetooth
> AdvertisementMonitor
> does not work with bluetoohd from bluez 22/stable: 5.64-2 2022-05-03
> with Ubuntu Core22 on Dell Precision 5570.
>
> I would assume the rest of bluetooth functions and profile are still
> working, eg
> % bluetoothctl show
>
> If order to isolate the root cause is between kernel hci driver or
> bluetoothd. Could you please run the following commands on core to
> see if the hci driver works as expected?
> % sudo btmgmt version
> % sudo btmgmt revision
> % sudo btmgmt monitor.features
> % sudo btmon --mgmt
>

Revision history for this message
AceLan Kao (acelankao) wrote :

From Jesse, the interface is not connected, could you try below connect command and try your app again?

$ sudo snap connect bluez:bluetooth-control

acelankao@ubuntu:~$ sudo btmgmt version
Version 5.53
acelankao@ubuntu:~$ sudo btmgmt revision
Invalid command in menu main: revision

Use "help" for a list of available commands in a menu.
Use "menu <submenu>" if you want to enter any submenu.
Use "back" if you want to return to menu main.
acelankao@ubuntu:~$ sudo btmgmt monitor.features
Invalid command in menu main: monitor

Use "help" for a list of available commands in a menu.
Use "menu <submenu>" if you want to enter any submenu.
Use "back" if you want to return to menu main.
acelankao@ubuntu:~$ sudo btmon --mgmt
sudo: btmon: command not found
acelankao@ubuntu:~$ sudo bluez.btmon --mgmt
/snap/bluez/334/usr/bin/btmon: unrecognized option '--mgmt'

Revision history for this message
AceLan Kao (acelankao) wrote :

Should work well now

acelankao@ubuntu:~$ sudo bluez.btmgmt
[mgmt]# info
Index list with 1 item
hci0: Primary controller
        addr 60:E3:2B:67:3E:CC version 12 manufacturer 2 class 0x10010c
        supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr hs le advertising secure-conn debug-keys privacy configuration static-addr
        current settings: powered ssp br/edr le advertising secure-conn
        name BlueZ 5.53
        short name
hci0: Configuration options
        supported options: public-address
        missing options:
hci0 type 7 discovering off
[mgmt]# advinfo
Supported flags: connectable general-discoverable limited-discoverable managed-flags tx-power scan-rsp-appearance scan-rsp-local-name Secondary-channel-1M Secondary-channel-2M Secondary-channel-CODED
Max advertising data len: 31
Max scan response data len: 31
Max instances: 8
Instances list with 0 items
[mgmt]# power on
hci0 Set Powered complete, settings: powered ssp br/edr le advertising secure-conn
[mgmt]# find
Discovery started
hci0 type 7 discovering on
hci0 dev_found: 24:5A:4C:13:CF:27 type LE Public rssi -68 flags 0x0004
AD flags 0x00
name U6-LITE
hci0 dev_found: 00:91:9E:32:09:5F type BR/EDR rssi -57 flags 0x0001
eir_len 5
confirm_name succeeded for 00:91:9E:32:09:5F
hci0 dev_found: 60:E3:2B:81:A4:15 type BR/EDR rssi -68 flags 0x0000
name u-HP-EliteBook-830-13-inch-G10-Notebook-PC
hci0 dev_found: 7A:FC:87:61:33:B9 type LE Random rssi -63 flags 0x0000
AD flags 0x1a
eir_len 19
hci0 dev_found: 00:91:9E:32:09:5F type BR/EDR rssi -59 flags 0x0000
name u-HP-Elite-x360-830-13-inch-G10-2-in-1-Notebook-
hci0 dev_found: FC:F6:E0:56:87:8D type LE Random rssi -62 flags 0x0004
AD flags 0x00
eir_len 8
hci0 dev_found: 34:6F:24:A8:93:EE type LE Public rssi -70 flags 0x0000
AD flags 0x1a
eir_len 21
hci0 dev_found: 94:53:30:A9:DA:A4 type BR/EDR rssi -72 flags 0x0000
name ubuntu-Vostro-5581
hci0 dev_found: 4C:80:93:CC:AC:21 type BR/EDR rssi -67 flags 0x0001
eir_len 5
confirm_name succeeded for 4C:80:93:CC:AC:21
hci0 dev_found: 4C:80:93:CC:AC:21 type BR/EDR rssi -59 flags 0x0000
name u
hci0 dev_found: 01:AA:A3:26:D9:92 type LE Random rssi -61 flags 0x0004
AD flags 0x00

Revision history for this message
Dilyn (dilyn-corner) wrote (last edit ):
Download full text (6.9 KiB)

dilyn-corner@ubuntu:~$ sudo bluez.btmgmt
[mgmt]# info
Index list with 1 item
hci0: Primary controller
    addr A0:80:69:60:CB:E6 version 12 manufacturer 2 class 0x000000
    supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr hs le secure-conn debug-keys privacy configuration static-addr phy-configuration wide-band-speech
    current settings: ssp br/edr le secure-conn
    name BlueZ 5.64
    short name
hci0: Configuration options
    supported options: public-address
    missing options:
[mgmt]# advinfo
Reading adv features failed with status 0x0c (Not Supported)
[mgmt]# power on
hci0 class of device changed: 0x00010c
hci0 Set Powered complete, settings: powered ssp br/edr le secure-conn
[mgmt]# advinfo
Reading adv features failed with status 0x0c (Not Supported)
[mgmt]# power on
hci0 Set Powered complete, settings: powered ssp br/edr le secure-conn
[mgmt]# advinfo
Reading adv features failed with status 0x0c (Not Supported)
[mgmt]# find
Discovery started
hci0 type 7 discovering on
hci0 dev_found: 4F:80:48:7F:FD:5E type LE Random rssi -82 flags 0x0000
AD flags 0x1a
eir_len 19
*** SNIP ***
[mgmt]# advinfo
Reading adv features failed with status 0x0c (Not Supported)

The system has the following snaps:
dilyn-corner@ubuntu:~$ snap list
Name Version Rev Tracking Publisher Notes
core22 20230304 547 latest/stable canonical✓ base
pc 22-0.3 127 22/stable canonical✓ gadget
pc-kernel 5.15.0-66.73.1 1224 22/stable canonical✓ kernel
snapd 2.59 18745 latest/beta canonical✓ snapd

Some relevant other facts:

dilyn-corner@ubuntu:~$ sudo dmesg | grep Blue
[ 11.155665] Bluetooth: Core ver 2.22
[ 11.155681] Bluetooth: HCI device and connection manager initialized
[ 11.155683] Bluetooth: HCI socket layer initialized
[ 11.155684] Bluetooth: L2CAP socket layer initialized
[ 11.155686] Bluetooth: SCO socket layer initialized
[ 11.280913] Bluetooth: hci0: Device revision is 0
[ 11.280924] Bluetooth: hci0: Secure boot is enabled
[ 11.280925] Bluetooth: hci0: OTP lock is enabled
[ 11.280925] Bluetooth: hci0: API lock is enabled
[ 11.280926] Bluetooth: hci0: Debug lock is disabled
[ 11.280926] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[ 11.280927] Bluetooth: hci0: Bootloader timestamp 2019.40 buildtype 1 build 38
[ 12.537783] Bluetooth: hci0: Found device firmware: intel/ibt-0040-0041.sfi
[ 13.740678] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 13.740680] Bluetooth: BNEP filters: protocol multicast
[ 13.740683] Bluetooth: BNEP socket layer initialized
[ 14.100880] Bluetooth: hci0: Waiting for firmware download to complete
[ 14.101807] Bluetooth: hci0: Firmware loaded in 1527362 usecs
[ 14.101940] Bluetooth: hci0: Waiting for device to boot
[ 14.119926] Bluetooth: hci0: Device booted in 17676 usecs
[ 14.120575] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0040-0041.ddc
[ 14.123999] Bluetooth: hci0: Applying Intel DDC parameters completed
[ 14.128005] Bluetooth: hci0: Firmware timestamp 2022.5 buildtype 1 build 38020
dilyn-c...

Read more...

Revision history for this message
Dilyn (dilyn-corner) wrote :

Info run on Core

Revision history for this message
Dilyn (dilyn-corner) wrote :

Info run on Desktop

Revision history for this message
Dilyn (dilyn-corner) wrote :

Notably:

If you fetch the 5.19 package on Jammy using apt and do some magic to repack the relevant kernel EFI binary, modules, and firmware for THIS version of the kernel (instead of the 5.15 release which comes with UC22), you can successfully query advanced bluetooth features:

linux-image-5.19.0-35-generic/jammy-updates,jammy-security,now 5.19.0-35.36~22.04.1 amd64 [installed,automatic]

dilyn-corner@ubuntu:~$ sudo bluez.btmgmt
[mgmt]# info
Index list with 1 item
hci0: Primary controller
    addr A0:80:69:60:CB:E6 version 12 manufacturer 2 class 0x000000
    supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr hs le advertising secure-conn debug-keys privacy configuration static-addr phy-configuration wide-band-speech
    current settings: ssp br/edr le secure-conn
    name BlueZ 5.64
    short name
hci0: Configuration options
    supported options: public-address
    missing options:
[mgmt]# advinfo
Supported flags: connectable general-discoverable limited-discoverable managed-flags tx-power scan-rsp-appearance scan-rsp-local-name Secondary-channel-1M Secondary-channel-2M Secondary-channel-CODED
Max advertising data len: 31
Max scan response data len: 31
Max instances: 8
Instances list with 0 items

Revision history for this message
Dilyn (dilyn-corner) wrote (last edit ):

> Ignore me <

Revision history for this message
Dilyn (dilyn-corner) wrote (last edit ):

Attached is a tarball of the output of several commands:

lspci -vvv -k
lsusb -v
curl https://raw.githubusercontent.com/snapcore/snapd/master/debug-tools/snap-debug-info.sh | sudo sh

I've included an additional test, one with bluez installed in devmode; the apparmor denials still appear, but in either case I still receive the same message from btmgmt:

dilyn-corner@ubuntu:~$ sudo bluez.btmgmt advinfo
Reading adv features failed with status 0x0c (Not Supported)

If you enter the btmgmt shell first, you receive the AppArmor messages. You do not receive these messages when entering the advinfo command in the btmgmt prompt.

Revision history for this message
Rex Tsai (chihchun) wrote :

- Dell Precision 5570[1] has the CNVi wireless module on an Alder Lake-S platform. The wireless module needs the correct firmware[2] for bluetooth to work. Based on Dilyn's comment #18[3], it's unclear if the firmware has been loaded on Core. Please check dmesg and see if it loads the intel/ibt-0040-0041.* firmwares.

- Plase include the following information in the following tests, which will help the team identify the root cause quicker
$ sudo grep '' /sys/class/dmi/id/product_* /sys/class/dmi/id/*_serial
$ sudo cat /etc/cpuinfo
$ snap info bluez && snap connections bluez # version of bluez (even
it's not been updated for a while, but we may not remember what it is
after a while)
$ snap info pc-kernel
$ sudo lspci -nn -vvv -k
$ sudo lsusb -vvv

[1] Dell Precision 5570 (RTX A2000 ) certified on Ubuntu 20.04 LTS -
https://ubuntu.com/certified/202112-29758/20.04%20LTS
[2] [Bug #1933938 “Missing CNVi firmware for Intel
AX211/AX201/9560/9...” : Bugs : linux-firmware package : Ubuntu -
https://bugs.launchpad.net/bugs/1933938
[3] https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/2006517/comments/18

Revision history for this message
Dilyn (dilyn-corner) wrote :

Find new requested info in the attachment.

Note that

$ snap info bluez && snap connections bluez # version of bluez (even
it's not been updated for a while, but we may not remember what it is
after a while)
$ snap info pc-kernel
$ sudo lspci -nn -vvv -k
$ sudo lsusb -vvv

Are all provided in the previous attachment.

Revision history for this message
AceLan Kao (acelankao) wrote :
Revision history for this message
AceLan Kao (acelankao) wrote :
Revision history for this message
AceLan Kao (acelankao) wrote :
Revision history for this message
AceLan Kao (acelankao) wrote :
Download full text (3.6 KiB)

From Dilyn's steps, he install the beta version of the bluez, and here is what I found.

1. power cycle the machine
2. install beta bluez, the advinfo doesn't work
acelankao@ubuntu:~$ uname -a
Linux ubuntu 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
acelankao@ubuntu:~$ snap list
Name Version Rev Tracking Publisher Notes
checkbox20 2.1 1152 latest/stable ce-certification-qa -
core 16-2.58.3 14946 latest/stable canonical✓ core
core20 20230308 1852 latest/stable canonical✓ base
core22 20230304 547 latest/stable canonical✓ base
pc 22-0.3 127 22/stable canonical✓ gadget
pc-kernel 5.15.0-66.73.1 x1 - - kernel
snapd 2.59 18745 latest/beta canonical✓ snapd
toolbox 0.8.4 2811 20/stable ondra -
acelankao@ubuntu:~$ snap install --channel=22/beta bluez
bluez (22/beta) 5.64-3 from Canonical✓ installed
acelankao@ubuntu:~$ sudo snap connect bluez:bluetooth-control
acelankao@ubuntu:~$ sudo bluez.btmgmt advinfo
Reading adv features failed with status 0x0c (Not Supported)

1. removed the beta bluez, and install stable bluez
acelankao@ubuntu:~$ sudo snap remove bluez
bluez removed
acelankao@ubuntu:~$ sudo snap install bluez
bluez (20/stable) 5.53-7 from Canonical✓ installed

2. power cycle the machine, and then advinfo works
acelankao@ubuntu:~$ uname -a
Linux ubuntu 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
acelankao@ubuntu:~$ snap list
Name Version Rev Tracking Publisher Notes
bluez 5.53-7 334 20/stable canonical✓ -
checkbox20 2.1 1152 latest/stable ce-certification-qa -
core 16-2.58.3 14946 latest/stable canonical✓ core
core20 20230308 1852 latest/stable canonical✓ base
core22 20230304 547 latest/stable canonical✓ base
pc 22-0.3 127 22/stable canonical✓ gadget
pc-kernel 5.15.0-66.73.1 x1 - - kernel
snapd 2.59 18745 latest/beta canonical✓ snapd
toolbox 0.8.4 2811 20/stable ondra -
acelankao@ubuntu:~$ sudo snap connect bluez:bluetooth-control
acelankao@ubuntu:~$ sudo bluez.btmgmt advinfo
Supported flags: connectable general-discoverable limited-discoverable managed-flags tx-power scan-rsp-appearance scan-rsp-local-name Secondary-channel-1M Secondary-channel-2M Secondary-channel-CODED
Max advertising data len: 31
Max scan response data len: 31
Max instances: 8
Instances list with 0 items

BTW, the BT firmware is intel/ibt-0040-0041.sfi
[ 15.452255] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[ 15.452260] Bluetooth: hci0: Bootloader timestamp 2019.40 buildtype 1 build 38
[ 15.453014] Bluetooth: hci0: Found device firmware: intel/ibt-0040-0041.sfi
[ 16.965744] Bluetooth: hci0: Waiting f...

Read more...

Revision history for this message
Dilyn (dilyn-corner) wrote (last edit ):

I assume that because you're using an x1 revision of the pc-kernel snap you're using the 5.15 image I produced?

Note that I tested both 22/stable and 22/beta of the bluez snap and saw identical results for both revisions after multiple reboot cycles on both of them. In every case, it appears that all of the relevant firmware files are loaded.

Can you post the logs the bluez daemon produces on your system?

Mine:

dilyn-corner@ubuntu:~$ snap logs -f bluez
2023-03-23T14:19:04Z systemd[1]: Starting Service for snap application bluez.bluez...
2023-03-23T14:19:05Z bluetoothd[1283]: Bluetooth daemon 5.64
2023-03-23T14:19:05Z systemd[1]: Started Service for snap application bluez.bluez.
2023-03-23T14:19:05Z bluetoothd[1283]: Starting SDP server
2023-03-23T14:19:05Z bluetoothd[1283]: Bluetooth management interface 1.21 initialized
2023-03-23T14:19:05Z bluetoothd[1283]: Battery Provider Manager created
2023-03-23T14:19:05Z bluetoothd[1283]: src/advertising.c:read_adv_features_callback() Failed to read advertising features: Not Supported (0x0c)
2023-03-23T14:19:05Z bluetoothd[1283]: Adv Monitor Manager created with supported features:0x00000001, enabled features:0x00000001, max number of supported monitors:32, max number of supported patterns:16

I believe we have several of these laptops in the lab for testing; is it possible for you to also test the other three to see if you get equivalent results?

Revision history for this message
Dilyn (dilyn-corner) wrote (last edit ):

Is it possible that we can get a release of the OEM kernel this laptop is certified for as a snap?

Revision history for this message
Wendell Duncan (wduncan) wrote :

I tested on my Dell 5570 using the 5.19 kernel that Dilyn hacked into place on a Dell 5570.
I also tested using the normal ubuntu Core 5.15 kernel.

With the 5.15 kernel the bluetooth advanced features did not work.

With the 5.19 kernel from Dilyn, the bluetooth advanced features do work.
I installed our bluetooth gatt server software stack, and was running
successfully!

Ubuntu Core system with the following:

bluez 22/beta rev 341
core22 latest/stable rev 547
snapd latest/beta rev 18745
pc-kernel snap was the custom one built by Dilyn including kernel 5.19

Revision history for this message
Alex Kaluzhny (alex-kaluzhny) wrote :

@AceLan,
In the comment #32 you were saying: "removed the beta bluez, and install stable bluez"
It looks like you removed bluez that was from 22/beta track (bluez (22/beta) 5.64-3),
and then installed one from 20/stable track (bluez 5.53-7 334 20/stable).
You wrote that with that revision of bluez snap "power cycle the machine, and then advinfo works".
Can you please confirm that?

Revision history for this message
AceLan Kao (acelankao) wrote :

The BT adv feature
1. works with 5.15 + bluez (20/stable) 5.53-7
2. doesn't work with 5.15 + bluez (22/beta) 5.64-3
3. (from Dilyn and Wendell) works with 5.19 + bluez (22/beta)

It's still unclear why bluez requires specific version of kernel.
Do we have a bluez expert to consult what kind of features the 5.15 kernel are missing?
Or could our customer stick with bluez (20/stable)?

Revision history for this message
AceLan Kao (acelankao) wrote :

1. Fresh installed ubuntu-22.04.2-desktop
2. Installed 5.15 kernel
ii bluez 5.64-0ubuntu1 amd64 Bluetooth tools and daemons

Linux u-Precision-5570 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

3. Installed customer's 2 snaps and run the setup and connect the bt device from my phone
4. The move command works, I can see cursor on my phone.

Revision history for this message
AceLan Kao (acelankao) wrote :

1. Downgraded bluez from 5.64-0ubuntu1 to 5.53-0ubuntu3.6
2. forgot the bt device on my phone and power cycle the machine
ii bluez 5.53-0ubuntu3.6 amd64 Bluetooth tools and daemons

Linux u-Precision-5570 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

3. Ran setup again, and then ran demo, the move command still works, I can see cursor move.

BTW, the commit Dilyn found shoule not be relavent, I see the same warning message with 5.15 kernel + 5.64 bluez
09572fca7223 Bluetooth: hci_sock: Add support for BT_{SND,RCV}BUF

2023-03-31T05:00:02.985301Z WARN ble::sys::mgmt: Failed to set BT_SNDMTU: Protocol not available (os error 92)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.