直到昨天,蓝牙在 Ubuntu 22.04.4 中工作正常,但现在不行了

直到昨天,蓝牙在 Ubuntu 22.04.4 中工作正常,但现在不行了

我通过重启、检查蓝牙状态、移除并重新安装蓝牙等方式进行了一些故障排除。但无论我做了什么,我能做的最好的事情就是我的耳机连接上了,但声音来自笔记本电脑扬声器,而不是耳机。

● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor pre>
     Active: active (running) since Mon 2024-02-26 07:06:42 IST; 3s ago
       Docs: man:bluetoothd(8)
   Main PID: 4623 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 8702)
     Memory: 768.0K
        CPU: 55ms
     CGroup: /system.slice/bluetooth.service
             └─4623 /usr/lib/bluetooth/bluetoothd

Feb 26 07:06:42 asus systemd[1]: Starting Bluetooth service...
Feb 26 07:06:42 asus bluetoothd[4623]: Bluetooth daemon 5.64
Feb 26 07:06:42 asus systemd[1]: Started Bluetooth service.
Feb 26 07:06:42 asus bluetoothd[4623]: Starting SDP server
Feb 26 07:06:42 asus bluetoothd[4623]: Bluetooth management interface 1.22 init>
Feb 26 07:06:42 asus bluetoothd[4623]: src/adapter.c:reset_adv_monitors_complet>
Feb 26 07:06:42 asus bluetoothd[4623]: Failed to clear UUIDs: Failed (0x03)
Feb 26 07:06:42 asus bluetoothd[4623]: Failed to add UUID: Failed (0x03)
Feb 26 07:06:42 asus bluetoothd[4623]: Failed to add UUID: Failed (0x03)
Feb 26 07:06:42 asus bluetoothd[4623]: Failed to add UUID: Failed (0x03)

这是当前状态。有人能帮我解决这个问题吗?我是 Ubuntu 的新用户。 谢谢

嗨 Daniel,谢谢你回答这个问题。按照你的回答后,有一件事是正确的,那就是我在状态检查中没有收到任何错误

[sudo] password for raghu: 
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor pre>
     Active: active (running) since Mon 2024-02-26 20:17:45 IST; 4min 46s ago
       Docs: man:bluetoothd(8)
   Main PID: 762 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 8702)
     Memory: 2.2M
        CPU: 119ms
     CGroup: /system.slice/bluetooth.service
             └─762 /usr/lib/bluetooth/bluetoothd -d

Feb 26 20:22:26 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout()
Feb 26 20:22:26 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout() a>
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:discovering_callback() hci0>
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:trigger_start_discovery()
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:cancel_passive_scanning()
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout()
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout() a>
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout() s>
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:start_discovery_complete() >
Feb 26 20:22:27 asus bluetoothd[762]: src/adapter.c:discovering_callback() hci0>
lines 1-22/22 (END)

这是完整的日志,journalctl -r -b -0 -u bluetooth 你可以看看

Feb 26 20:19:56 asus bluetoothd[762]: src/device.c:device_set_legacy() legacy 0
Feb 26 20:19:56 asus bluetoothd[762]: src/adapter.c:device_found_callback() hci>
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:discovering_callback() hci0>
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:start_discovery_complete() >
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout() s>
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout() a>
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:start_discovery_timeout()
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:cancel_passive_scanning()
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:trigger_start_discovery()
Feb 26 20:19:51 asus bluetoothd[762]: src/adapter.c:discovering_callback() hci0>
Feb 26 20:19:50 asus bluetoothd[762]: src/adapter.c:cancel_passive_scanning()
Feb 26 20:19:50 asus bluetoothd[762]: src/adapter.c:trigger_start_discovery()
Feb 26 20:19:50 asus bluetoothd[762]: src/adapter.c:resume_discovery()
Feb 26 20:19:50 asus bluetoothd[762]: src/device.c:device_bonding_failed() stat>
Feb 26 20:19:50 asus bluetoothd[762]: src/device.c:device_bonding_complete() bo>
Feb 26 20:19:50 asus bluetoothd[762]: src/adapter.c:bonding_attempt_complete() >
Feb 26 20:19:50 asus bluetoothd[762]: plugins/policy.c:disconnect_cb() reason 1
Feb 26 20:19:50 asus bluetoothd[762]: src/adapter.c:adapter_remove_connection()
Feb 26 20:19:50 asus bluetoothd[762]: src/adapter.c:dev_disconnected() Device 4>
Feb 26 20:19:49 asus bluetoothd[762]: src/device.c:device_set_rssi_with_delta()>
Feb 26 20:19:49 asus bluetoothd[762]: src/device.c:device_set_legacy() legacy 0
Feb 26 20:19:49 asus bluetoothd[762]: src/adapter.c:device_found_callback() hci>

再次感谢。

答案1

这是造成蓝牙已被禁用。请先检查是否有任何硬件开关。然后运行以下命令来启用它:

rfkill unblock all
reboot

如果仍然看到错误,我们可以重新安装 BlueZ:

sudo rm -rf /var/lib/bluetooth /etc/bluetooth
apt download bluez
sudo dpkg -P --force-all bluez
sudo dpkg -i ./bluez*.deb

这应该会重新安装 BlueZ。如果 BlueZ 仍然损坏,请将标志添加-dExecStart中的行/lib/systemd/system/bluetooth.service,重新启动,并附加 的完整日志journalctl -r -b -0 -u bluetooth

相关内容