今天我的蓝牙耳机停止工作了。我最近没有修改任何东西(虽然几天前我试图让蓝牙耳机自动以 a2dp 模式连接,这涉及安装 blueman 并重新与其配对,但自从进行这一更改后,我已经连接并重新启动了几次,一切正常)。
现在,当我尝试连接耳机时,我得到:
Connection Failed: blueman.bluez.errors.DBusFailedError: Protocol Not available
根据这里的一些内容(蓝牙 - 连接失败:blueman.bluez.errors.DBusFailedError:协议不可用)和其他互联网搜索,我尝试过:
$ sudo apt-get install pulseaudio-module-bluetooth
$ pactl load-module module-bluetooth-discover
我尝试过重新安装一些东西:
$ sudo apt-get --purge --reinstall install bluetooth bluez blueman pulseaudio pulseaudio-module-bluetooth
$ sudo /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.
$ sudo /etc/init.d/bluetooth restart
[ ok ] Restarting bluetooth (via systemctl): bluetooth.service.
当然还要重新启动,但似乎没有任何帮助,而且我不明白它在谈论什么协议,因为我可以看到耳机并与它配对,但无法建立音频连接。
我正在运行 Ubuntu 18.04.1。其他一些详细信息:
$ dpkg -l | grep blue
blueman 2.0.5-1ubuntu1
bluetooth 5.48-0ubuntu3.1
bluez 5.48-0ubuntu3.1
bluez-cups 5.48-0ubuntu3.1
bluez-obexd 5.48-0ubuntu3.1
gir1.2-gnomebluetooth-1.0:amd64 3.28.0-2ubuntu0.1
gnome-bluetooth 3.28.0-2ubuntu0.1
indicator-bluetooth 0.0.6+17.10.20170605-0ubuntu3
libbluetooth3:amd64 5.48-0ubuntu3.1
libgnome-bluetooth13:amd64 3.28.0-2ubuntu0.1
pulseaudio-module-bluetooth 1:11.1-1ubuntu7.1
$ sudo service bluetooth status
* bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset Active: active (running) since Mon 2019-02-04 14:36:47 PST; 1min 13s ago
Docs: man:bluetoothd(8) Main PID: 6912 (bluetoothd) Status: "Running"
Tasks: 1 (limit: 4915) CGroup: /system.slice/bluetooth.service
└─6912 /usr/lib/bluetooth/bluetoothd
Feb 04 14:36:47 AVB systemd[1]: Starting Bluetooth service... Feb 04 14:36:47 AVB bluetoothd[6912]: Bluetooth daemon 5.48 Feb 04 14:36:47 AVB systemd[1]: Started Bluetooth service. Feb 04 14:36:47 AVB bluetoothd[6912]: Starting SDP server Feb 04 14:36:47 AVB bluetoothd[6912]: Bluetooth management interface 1.14 initialized
$ dmesg | grep Bluetooth
[ 5.197632] Bluetooth: Core ver 2.22
[ 5.197654] Bluetooth: HCI device and connection manager initialized
[ 5.197657] Bluetooth: HCI socket layer initialized
[ 5.197660] Bluetooth: L2CAP socket layer initialized
[ 5.197664] Bluetooth: SCO socket layer initialized
[ 5.349217] Bluetooth: hci0: Firmware revision 0.1 build 185 week 49 2017
[ 5.492623] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 5.492625] Bluetooth: BNEP filters: protocol multicast
[ 5.492628] Bluetooth: BNEP socket layer initialized
[ 16.972106] Bluetooth: RFCOMM TTY layer initialized
[ 16.972113] Bluetooth: RFCOMM socket layer initialized
[ 16.972117] Bluetooth: RFCOMM ver 1.11
[ 84.672241] Bluetooth: hci0: last event is not cmd complete (0x0f)
$ hciconfig
hci0: Type: Primary Bus: USB
BD Address: 74:70:FD:B6:73:0C ACL MTU: 1021:4 SCO MTU: 96:6
UP RUNNING PSCAN ISCAN INQUIRY
RX bytes:18753 acl:61 sco:0 events:738 errors:0
TX bytes:14257 acl:60 sco:0 commands:267 errors:0
$ lspci -knn | grep Net -A3
02:00.0 Network controller [0280]: Intel Corporation Wireless 8265 / 8275 [8086:24fd] (rev 78)
Subsystem: Intel Corporation Dual Band Wireless-AC 8265 [8086:0010]
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 002: ID 13d3:5a07 IMC Networks
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ ps aux | grep blue
me 2032 0.0 0.6 694048 54240 tty2 Sl+ 14:19 0:01 /usr/bin/python3 /usr/bin/blueman-applet
me 2091 0.0 0.0 82728 6832 ? Ss 14:19 0:00 /usr/lib/bluetooth/obexd
root 6912 0.0 0.0 37992 6096 ? Ss 14:36 0:02 /usr/lib/bluetooth/bluetoothd
关于下一步该去哪里,您有什么建议吗?谢谢。
答案1
对于我来说,只需通过执行以下操作即可重新加载模块:
pactl unload-module module-bluetooth-discover
pactl load-module module-bluetooth-discover
帮助解决了这个问题。
答案2
对我有用的是:(正如 Luca Mattia Ferrari 上面指出的那样)
$ sudo apt-get purge pulseaudio
$ rm ~/.config/pulse && sudo killall pulseaudio
$ sudo apt-get install pulseaudio
$ pulseaudio --start
上面的命令首先确保脉冲正常工作。
然后,这个有点奇怪,pulseaudio 本身默认没有这个命令:
$ sudo apt-get install pulseaudio-module-bluetooth
$ pactl load-module module-bluetooth-discover
我知道这有点多余,但这些步骤 10 分钟前对我来说确实有效。
但好吧,至少现在有效了 :)
答案3
只需在蓝牙管理器上删除该设备并重新配对即可。对我来说很管用。
答案4
在 Ubuntu Server 20.04 上,上述解决方案都不适用于我。这最终做到了:
# remove pulseaudio bluetooth module
sudo apt-get purge pulseaudio-module-bluetooth
# install bluetooth plugins for PipeWire multimedia server
sudo apt-get install libspa-0.2-bluetooth
# stop or restart the service
systemctl --user stop pipewire-pulse.service pipewire.service
此后,重新连接设备即可。