![Ubuntu 22.04LTS,蓝牙适配器不工作 D-Bus 连接失败](https://linux22.com/image/951138/Ubuntu%2022.04LTS%EF%BC%8C%E8%93%9D%E7%89%99%E9%80%82%E9%85%8D%E5%99%A8%E4%B8%8D%E5%B7%A5%E4%BD%9C%20D-Bus%20%E8%BF%9E%E6%8E%A5%E5%A4%B1%E8%B4%A5.png)
我想将我的蓝牙耳机连接到我的 Ubuntu 22.04 LTS 系统。我购买了一个 Edimax usb 蓝牙适配器(带有 rtl8761b 芯片组的 BT8500),它有一个支持内核版本 2.6.32 – 5.3 的 ubuntu 驱动程序。
到目前为止一切顺利。下载的驱动程序按照说明在 /lib/firmware/ 目录中创建文件。重新启动并运行hciconfig-a
蓝牙出现在设置中,但无法连接任何东西……深入研究故障排除后,我发现蓝牙无法接入 D-Bus。并且 /usr/bin/snap 运行 bluez
D-Bus 设置失败:无法连接到套接字 /var/run/dbus/system_bus_socket:权限被拒绝
系统的一些摘录(如果有其他命令乐意获取)
neale@Edward:~$ **hciconfig -a**
hci0: Type: Primary Bus: USB
BD Address: 08:BE:AC:2F:A7:C7 ACL MTU: 1021:6 SCO MTU: 255:12
UP RUNNING
RX bytes:810 acl:0 sco:0 events:64 errors:0
TX bytes:5338 acl:0 sco:0 commands:64 errors:0
Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: PERIPHERAL ACCEPT
Name: 'Edward'
Class: 0x7c0104
Service Classes: Rendering, Capturing, Object Transfer, Audio, Telephony
Device Class: Computer, Desktop workstation
HCI Version: 5.1 (0xa) Revision: 0x9a9
LMP Version: 5.1 (0xa) Subversion: 0x8a6b
Manufacturer: Realtek Semiconductor Corporation (93)
**systemctl status snap.bluez.bluez.service**
× snap.bluez.bluez.service - Service for snap application bluez.bluez
Loaded: loaded (/etc/systemd/system/snap.bluez.bluez.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2023-02-08 19:28:26 NZDT; 20min ago
Main PID: 1541 (code=exited, status=1/FAILURE)
CPU: 32ms
Feb 08 19:28:26 Edward systemd[1]: snap.bluez.bluez.service: Failed with result 'exit-code'.
Feb 08 19:28:26 Edward bluetoothd[1541]: Unable to get on D-Bus
Feb 08 19:28:26 Edward systemd[1]: snap.bluez.bluez.service: Scheduled restart job, restart counter is at 5.
Feb 08 19:28:26 Edward systemd[1]: Stopped Service for snap application bluez.bluez.
Feb 08 19:28:26 Edward systemd[1]: snap.bluez.bluez.service: Start request repeated too quickly.
Feb 08 19:28:26 Edward systemd[1]: snap.bluez.bluez.service: Failed with result 'exit-code'.
Feb 08 19:28:26 Edward systemd[1]: Failed to start Service for snap application bluez.bluez.
neale@Edward:~$
neale@Edward:~$ **sudo /usr/bin/snap run bluez**
D-Bus setup failed: Failed to connect to socket /var/run/dbus/system_bus_socket: Permission denied
neale@Edward:~$ **ls -la /var/run/dbus/**
total 0
drwxr-xr-x 2 root root 60 Feb 7 22:06 .
drwxr-xr-x 37 root root 960 Feb 8 16:29 ..
srw-rw-rw- 1 root root 0 Feb 7 22:06 system_bus_socket
neale@Edward:~$ ps ax|grep dbus
1020 ? Ss 0:10 @dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
2207 ? Ss 0:01 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
2428 ? S 0:00 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 11 --address=unix:path=/run/user/1000/at-spi/bus
11785 ? S 0:00 /usr/lib/cups/notifier/dbus dbus://
11786 ? S 0:00 /usr/lib/cups/notifier/dbus dbus://
85726 pts/0 S+ 0:00 grep --color=auto dbus
lspci -knn | grep Net -A3; lsusb; dmesg | grep -i blue
00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection (Lewisville) [8086:1502] (rev 06)
DeviceName: Onboard LAN
Subsystem: Gigabyte Technology Co., Ltd 82579LM Gigabit Network Connection (Lewisville) [1458:e000]
Kernel driver in use: e1000e
Kernel modules: e1000e
00:1a.0 USB controller [0c03]: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #2 [8086:1d2d] (rev 06)
--
04:00.0 Network controller [0280]: Qualcomm Atheros AR9462 Wireless Network Adapter [168c:0034] (rev 01)
Subsystem: Lite-On Communications Inc AR9462 Wireless Network Adapter [11ad:6621]
Kernel driver in use: ath9k
Kernel modules: ath9k
05:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
--
06:00.0 Ethernet controller [0200]: Intel Corporation 82575EB Gigabit Network Connection [8086:10a7] (rev 02)
Subsystem: Intel Corporation 82575EB Gigabit Network Connection [8086:0000]
Kernel driver in use: igb
Kernel modules: igb
06:00.1 Ethernet controller [0200]: Intel Corporation 82575EB Gigabit Network Connection [8086:10a7] (rev 02)
Subsystem: Intel Corporation 82575EB Gigabit Network Connection [8086:0000]
Kernel driver in use: igb
Kernel modules: igb
08:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 06)
Bus 002 Device 004: ID 1b1c:0c04 Corsair Link Cooling Node
Bus 002 Device 003: ID 7392:c611 Edimax Technology Co., Ltd Edimax Bluetooth Adapter
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 002: ID 2109:0811 VIA Labs, Inc. Hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 003: ID 125f:a83a A-DATA Technology Co., Ltd. HD330
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
dmesg: read kernel buffer failed: Operation not permitted
2023-02-15 更新 彻底移除 bluez
`● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-02-15 18:35:44 NZDT; 1 day 2h ago
Docs: man:bluetoothd(8)
Main PID: 1034 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 38335)
Memory: 2.2M
CPU: 211ms
CGroup: /system.slice/bluetooth.service
└─1034 /usr/lib/bluetooth/bluetoothd
Feb 16 20:33:23 Edward bluetoothd[1034]: Failed to set mode: Not Supported (0x0c)
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSink/sbc
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSource/sbc
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSink/sbc_xq_453
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSource/sbc_xq_453
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSink/sbc_xq_512
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSource/sbc_xq_512
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSink/sbc_xq_552
Feb 16 20:33:23 Edward bluetoothd[1034]: Endpoint registered: sender=:1.84 path=/MediaEndpoint/A2DPSource/sbc_xq_552
Feb 16 20:33:23 Edward bluetoothd[1034]: src/adv_monitor.c:btd_adv_monitor_power_down() Unexpected NULL btd_adv_monitor_manager object upon power down`
不确定为什么代码环绕它在预览窗口中看起来正常。
答案1
7392:c611 Edimax Technology Co., Ltd Edimax Bluetooth Adapter
已安装的内核(5.15)当前不支持此设备,下一个 5.19 Ubuntu 内核也不支持它。
已添加对此设备的支持此补丁到 Linux 主线。
如果您安装了最新的主线内核,该设备应该可以工作。
也可以为 Ubuntu 内核构建 dkms 驱动程序。
ubuntu-bug linux
通过运行请求反向移植该补丁来向 Launchpad 报告错误是有意义的。