Arch Linux蓝牙连接后立刻断开

蓝牙耳机无法连接

就在今天早上,我用我的蓝牙耳机连接上我的电脑打算开始学习,没想到我的耳机一连接到电脑就会断开
起初我以为是我的蓝牙耳机出现了问题,所以我尝试用手机连接发现没有问题,于是我就猜测肯定是电脑蓝牙驱动出现了问题
在这里先感谢论坛 archlinuxcn 的大佬们

查看日志

出现了问题先看日志,判断是出现在哪里

1
journalctl -l -f -u bluetooth.service                                                       

执行命令后,再连接一次蓝牙耳机,在又一次连接失败后,看到了如下日志

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/aptx
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/aptx
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc_xq_453
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc_xq_453
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc_xq_512
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc_xq_512
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc_xq_552
Jul 01 09:56:36 Nero bluetoothd[4337]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc_xq_552
Jul 01 09:56:44 Nero bluetoothd[4337]: profiles/audio/avctp.c:avctp_control_confirm() Control: Refusing unexpected connect
Jul 01 09:56:44 Nero systemd[1]: bluetooth.service: Main process exited, code=dumped, status=11/SEGV
Jul 01 09:56:44 Nero systemd[1]: bluetooth.service: Failed with result 'core-dump'.
Jul 01 09:56:44 Nero systemd[1]: Starting Bluetooth service...
Jul 01 09:56:44 Nero bluetoothd[4356]: Bluetooth daemon 5.67
Jul 01 09:56:44 Nero systemd[1]: Started Bluetooth service.
Jul 01 09:56:44 Nero bluetoothd[4356]: Starting SDP server
Jul 01 09:56:44 Nero bluetoothd[4356]: src/plugin.c:plugin_init() System does not support csip plugin
Jul 01 09:56:44 Nero bluetoothd[4356]: src/plugin.c:plugin_init() System does not support vcp plugin
Jul 01 09:56:44 Nero bluetoothd[4356]: src/plugin.c:plugin_init() System does not support mcp plugin
Jul 01 09:56:44 Nero bluetoothd[4356]: src/plugin.c:plugin_init() System does not support bass plugin
Jul 01 09:56:44 Nero bluetoothd[4356]: src/plugin.c:plugin_init() System does not support bap plugin
Jul 01 09:56:44 Nero bluetoothd[4356]: Bluetooth management interface 1.22 initialized
Jul 01 09:56:44 Nero bluetoothd[4356]: Failed to set privacy: Rejected (0x0b)
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/ldac_hq
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/ldac_sq
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/ldac_mq
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/aptx_hd
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/aptx_hd
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/aptx
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/aptx
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc_xq_453
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc_xq_453
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc_xq_512
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc_xq_512
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSink/sbc_xq_552
Jul 01 09:56:44 Nero bluetoothd[4356]: Endpoint registered: sender=:1.58 path=/MediaEndpoint/A2DPSource/sbc_xq_552

可以看到中间有连接失败的日志,可能是缺失了某个模块
于是我就通过这些报错信息尝试进行解决,无果
最后是在 Arch Linux中文论坛 中询问了大佬后,在 Arch Linux论坛中找到了解决方法
这就是 bluezbluez-libsbluez-utils 5.67版本的 Bug,我没有能力去修复这个 Bug(因为我菜),于是就先回退到上一个版本,等这个 Bug 修复了再更新

回退版本

回退版本只需要在 Arch Linux Archive 找到旧版本的包,也就是5.66版本,安装即可
所以执行如下命令降级这三个包

1
2
3
sudo pacman -U https://archive.archlinux.org/packages/b/bluez/bluez-5.66-1-x86_64.pkg.tar.zst
sudo pacman -U https://archive.archlinux.org/packages/b/bluez-libs/bluez-libs-5.66-1-x86_64.pkg.tar.zst
sudo pacman -U https://archive.archlinux.org/packages/b/bluez-utils/bluez-utils-5.66-1-x86_64.pkg.tar.zst

安装完旧包后,编辑 /etc/pacman.conf 文件,将这三个包添加到不更新的列表中,待下个版本更新后再移出即可

1
IgnorePkg   = bluez bluez-libs bluez-utils

完成后重启蓝牙服务

1
sudo systemctl restart bluetooth.service 

这样就可以继续愉快的 -Syu了 ヾ(*´▽‘*)ノ


刚开始无法连接的时候我还以为我的耳机坏了呢,还好没坏,不然又是一笔开销呢 ( 。ớ ₃ờ)ھ
这次确实要感谢论坛里面的大佬,不然我肯定不会这么快的解决这个问题 ε٩(๑> ₃ <)۶з