我已经重新安装了 pulsaudio、pavucontrol 以及 pulseaudio-module-bluetooth。但这些解决方案似乎都不起作用。每当我输入命令时,我都会收到错误 pa_context_connect() failed: Connection denied
sudo pactl unload-module module-bluetooth-discover
sudo pactl load-module module-bluez5-discover
我通过 bluetoothctl 将蓝牙的 MAC 地址添加到受信任的设备。但是它不起作用。持续的连接和断开让我很沮丧。耳机与 Android 设备和 Windows 10 配合良好(在同一台 PC 上)。当我执行时,我没有看到输出有任何变化
journalctl -f
(有/无 sudo 均可)。
journalctl -f 的输出
Jun 08 19:50:01 adonis CRON[155600]: (CRON) info (No MTA installed, discarding output)
Jun 08 19:50:01 adonis CRON[155600]: pam_unix(cron:session): session closed for user root
Jun 08 19:50:06 adonis dbus-daemon[4361]: [system] Rejected send message, 0 matched rules; type="method_return", sender=":1.208" (uid=1000 pid=128755 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo" label="unconfined") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.4" (uid=0 pid=4358 comm="/usr/lib/bluetooth/bluetoothd " label="unconfined")
Jun 08 19:50:06 adonis gsd-media-keys[19578]: Unable to get default sink
Jun 08 19:50:06 adonis acpid[4354]: input device has been disconnected, fd 20
Jun 08 19:50:06 adonis /usr/lib/gdm3/gdm-x-session[17606]: (II) config/udev: removing device OPPO Enco M31 (AVRCP)
Jun 08 19:50:06 adonis /usr/lib/gdm3/gdm-x-session[17606]: (**) Option "fd" "91"
Jun 08 19:50:06 adonis /usr/lib/gdm3/gdm-x-session[17606]: (II) event18 - OPPO Enco M31 (AVRCP): device removed
Jun 08 19:50:06 adonis /usr/lib/gdm3/gdm-x-session[17606]: (II) UnloadModule: "libinput"
Jun 08 19:50:06 adonis /usr/lib/gdm3/gdm-x-session[17606]: (II) systemd-logind: releasing fd for 13:82
Jun 08 19:50:13 adonis gnome-shell[17887]: ../clutter/clutter/clutter-actor.c:10548: The clutter_actor_set_allocation() function can only be called from within the implementation of the ClutterActor::allocate() virtual function.
顺便说一句,Oppo Enco M31 是蓝牙耳机。
执行 bluetoothctl 时,输出如下:
[CHG] Device MACADDRESS Connected: yes
[CHG] Device MACADDRESS Connected: no
[CHG] Device MACADDRESS Connected: yes
[CHG] Device MACADDRESS Connected: no
[CHG] Device MACADDRESS Connected: yes
[CHG] Device MACADDRESS Connected: no
这种情况会一直持续,直到耳机连接到附近的另一台设备。
但是如果我进入蓝牙设置并明确选择“连接”,我将能够连接到耳机。
你知道配对后如何自动连接到 PC 吗?
操作系统:Ubuntu 20.04 内核:5.4.0-33-generic