我正在使用 Ubuntu 16.04.6 LTS。
连接到蓝牙设备后没有创建脉冲音频接收器:
这是我的做法:
$ bluetoothctl
[NEW] Controller 00:1A:7D:DA:71:04 sebastien-B206 [default]
[NEW] Device 97:40:B1:EF:BD:54 PROZOR RX5.0
[bluetooth]# pair 97:40:B1:EF:BD:54
Attempting to pair with 97:40:B1:EF:BD:54
[CHG] Device 97:40:B1:EF:BD:54 Connected: yes
[CHG] Device 97:40:B1:EF:BD:54 Modalias: bluetooth:v05D6p000Ad0240
[CHG] Device 97:40:B1:EF:BD:54 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 97:40:B1:EF:BD:54 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 97:40:B1:EF:BD:54 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 97:40:B1:EF:BD:54 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 97:40:B1:EF:BD:54 Paired: yes
Pairing successful
[CHG] Device 97:40:B1:EF:BD:54 Connected: no
[bluetooth]# trust 97:40:B1:EF:BD:54
[CHG] Device 97:40:B1:EF:BD:54 Trusted: yes
Changing 97:40:B1:EF:BD:54 trust succeeded
[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
[PROZOR RX5.0]# info
Device 97:40:B1:EF:BD:54
Name: PROZOR RX5.0
Alias: PROZOR RX5.0
Class: 0x340404
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
Modalias: bluetooth:v05D6p000Ad0240
正如您在下面看到的,没有创建新的脉冲音频接收器:
$ pactl list sinks short
0 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_output.pci-0000_03_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
$ pactl list sinks short | grep bluez_sink
$
我重新启动了bluetooth.service
,也重新启动了pulseaudio
,但还是没有解决 pb。
为什么没有创建脉冲音频接收器?
答案1
pulseaudio
一个解决方案是在 GDM 中 禁用它,因为pulseaudio
GDM 实例正在“窃取”蓝牙接收器$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
$