Ubuntu 22.10连接蓝牙耳机报错br-connection-profile-unavailable解决方法

今天新版Ubuntu 22.10发布,高高兴兴升级完成后,发现:1.Flameshot异常;2.没法连接AirPods Pro2 耳机了;3.定制ibus的gnome 插件不兼容(预料之中)。

蓝牙耳机连不上的的时候,症状为 Failed to connect: org.bluez.Error.Failed br-connection-profile-unavailable

[bluetooth]# connect C0:95:6D:C0:A3:92
Attempting to connect to C0:95:6D:C0:A3:92
Failed to connect: org.bluez.Error.Failed br-connection-profile-unavailable

bluetooth 服务提示: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available

➜  systemctl status bluetooth.service
● bluetooth.service - Bluetooth service
    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; preset: enabled)
    Active: active (running) since Fri 2022-10-21 14:21:09 CST; 4min 56s ago
    Docs: man:bluetoothd(8)
Main PID: 2973 (bluetoothd)
    Status: "Running"
    Tasks: 1 (limit: 18897)
    Memory: 1.6M
        CPU: 451ms
    CGroup: /system.slice/bluetooth.service
            └─2973 /usr/lib/bluetooth/bluetoothd

Oct 21 14:21:09 workpc systemd[1]: Started Bluetooth service.
Oct 21 14:21:09 workpc bluetoothd[2973]: Bluetooth management interface 1.22 initialized
Oct 21 14:22:13 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available
Oct 21 14:22:14 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available
Oct 21 14:23:24 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available
Oct 21 14:23:26 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available
Oct 21 14:23:39 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available
Oct 21 14:24:23 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available
Oct 21 14:24:34 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available
Oct 21 14:24:36 workpc bluetoothd[2973]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not available

这就是linux用户的日常,搜索后确定大致原因为,Ubuntu 22.10桌面版本音频服务从PulseAudio切换到PipeWire, 导致的服务异常。

解决方法

    1. 安装依赖包

      sudo apt install wireplumber libspa-0.2-bluetooth wireplumber-doc

    依赖包解释说明

    • WirePlumber is a modular session / policy manager for PipeWire
    • libspa-0.2-bluetooth: libraries for the PipeWire multimedia server - bluetooth plugins
    1. 重启 wireplumber

      systemctl --user restart wireplumber

    1. 重新连接AirPods耳机, 看最后返回successful

      ➜ work bluetoothctl Agent registered [bluetooth]# connect C0:95:6D:C0:A3:92 Attempting to connect to C0:95:6D:C0:A3:92 [CHG] Device C0:95:6D:C0:A3:92 Connected: yes [NEW] Endpoint /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep1 [NEW] Endpoint /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep2 [NEW] Endpoint /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep3 [NEW] Transport /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep1/fd0 [CHG] Transport /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep1/fd0 Delay: 0x05dc (1500) Connection successful

如果你还有其它疑问,比如不知道获取你的设备mac地址,可以以查看我以前写了另外一个文章

相关文章:

翻译: