蓝牙设备连接成功后,蓝牙接收器未显示在 pulseaudio 中

蓝牙设备连接成功后,蓝牙接收器未显示在 pulseaudio 中

蓝牙设备连接成功后,pavucontrol 的“播放”选项卡中不再显示蓝牙输出,因此不会向蓝牙设备输出任何声音。

$ bluetoothctl 
[NEW] Controller 00:1A:7D:DA:71:04 sebastien-B206 [default]
[NEW] Device 97:40:B1:EF:BD:54 PROZOR RX5.0
[bluetooth]# connect 97:40:B1:EF:BD:54
Attempting to connect to 97:40:B1:EF:BD:54
[CHG] Device 97:40:B1:EF:BD:54 Connected: yes
Connection successful

脉冲音频蓝牙接收器:

$ pactl list sinks short | grep bluez_sink
$

脉冲音频蓝牙模块:

$ pactl list modules short | grep module-blue
8   module-bluetooth-policy     
9   module-bluetooth-discover       
10  module-bluez5-discover      
$

你能帮我么 ?

答案1

pulseaudio一个解决方案是在 GDM 中 禁用它,因为pulseaudioGDM 实例正在“窃取”蓝牙接收器$USER

所以我做了以下事情,感谢带有 GDM 的 Gnome

$ ps -fC pulseaudio
UID        PID  PPID  C STIME TTY          TIME CMD
gdm       1858     1  0 14:27 ?        00:00:00 /usr/bin/pulseaudio --start --log-target=syslog
sebasti+  3263     1  2 14:28 ?        00:00:00 /usr/bin/pulseaudio --start --log-target=syslog
$ gdm_home=$(grep gdm /etc/passwd | cut -d: -f6)
$ sudo -u gdm mkdir -pv $gdm_home/.config/pulse/ $gdm_home/.config/systemd/user/
$ sudo test ! -s $gdm_home/.config/pulse/client.conf && printf "autospawn = no\ndaemon-binary = /bin/true\n" | sudo -u gdm tee $gdm_home/.config/pulse/client.conf
autospawn = no
daemon-binary = /bin/true
$ sudo -u gdm ln -vs /dev/null $gdm_home/.config/systemd/user/pulseaudio.socket
'/var/lib/gdm3/.config/systemd/user/pulseaudio.socket' -> '/dev/null'
$ sudo reboot
$ ps -fC pulseaudio
UID        PID  PPID  C STIME TTY          TIME CMD
sebasti+  3024     1  0 15:03 ?        Sl     0:00 /usr/bin/pulseaudio --start --log-target=syslog
$ pactl list modules short | grep blue
8   module-bluetooth-policy
9   module-bluetooth-discover
10  module-bluez5-discover
31  module-bluez5-device    path=/org/bluez/hci0/dev_97_40_B1_EF_BD_54
$ { echo disconnect 97:40:B1:EF:BD:54;sleep 2;echo connect 97:40:B1:EF:BD:54;sleep 2; } | bluetoothctl 2>/dev/null | egrep -i "(dis)?connect(ion|ed)?|successful"
[bluetooth]# disconnect 97:40:B1:EF:BD:54
Attempting to disconnect from 97:40:B1:EF:BD:54
Successful disconnected
[bluetooth]# connect 97:40:B1:EF:BD:54
Attempting to connect to 97:40:B1:EF:BD:54
[CHG] Device 97:40:B1:EF:BD:54 Connected: yes
Connection successful
$ pactl list sinks short | grep bluez_sink
4   bluez_sink.97_40_B1_EF_BD_54    module-bluez5-device.c  s16le 2ch 48000Hz   SUSPENDED
$ pactl list sink-inputs short
0   0   8   protocol-native.c   float32le 2ch 44100Hz
$ pactl move-sink-input 0 4
$

答案2

快速修复:您也可以简单地关闭其他用户的 pulseaudio:

ssh otheruser@localhost
systemctl --user stop pulseaudio.service

相关内容