我在使用我的 Sony WH-1000MX3 蓝牙耳机和我心爱的 Ubuntu 18.04 时遇到问题。 Ubuntu 似乎无法使用耳机作为免提设备(这对于所有正在进行的视频通话很有用)。问题已部分解决,因为我可以通过使用以下命令将蓝牙配置文件更改为 A2DP,使用耳机进行音频输出蓝人。但是,我仍然没有找到使用耳机进行音频输入的解决方案(我认为这需要 HSP/HFP 配置文件?)。
最初我以为笔记本电脑的蓝牙可能不兼容,但是,在我的双启动 Windows 中,耳机可以正常工作。所以我认为问题不应该出在硬件上?
更重要的是,Ubuntu 设置和 Pulseaudio 似乎将耳机识别为音频输入 - 但是,没有从耳机接收到任何音频。
在研究问题时,我发现了以下几行cat /var/log/syslog
:
Apr 23 09:46:31 mande-Lenovo-Y50-70 /usr/lib/gdm3/gdm-x-session[2754]: (II) event19 - CC:98:8B:80:DC:C3: is tagged by udev as: Keyboard
Apr 23 09:46:31 mande-Lenovo-Y50-70 /usr/lib/gdm3/gdm-x-session[2754]: (II) event19 - CC:98:8B:80:DC:C3: device is a keyboard
其中CC:98:8B:80:DC:C3对应耳机的Mac地址。
我的朋友建议查看 udev 输出,但我们找不到任何可疑的东西。以下是耳机连接的 udevadm 输出:
mande@mande-Lenovo-Y50-70:~$ udevadm monitor -e
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[1830.957404] add /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7:1.0/bluetooth/hci0/hci0:4 (bluetooth)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7:1.0/bluetooth/hci0/hci0:4
DEVTYPE=link
SEQNUM=6495
SUBSYSTEM=bluetooth
UDEV [1830.960384] add /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7:1.0/bluetooth/hci0/hci0:4 (bluetooth)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7:1.0/bluetooth/hci0/hci0:4
DEVTYPE=link
SEQNUM=6495
SUBSYSTEM=bluetooth
SYSTEMD_ALIAS=/sys/subsystem/bluetooth/devices/hci0:4
SYSTEMD_WANTS=bluetooth.target
TAGS=:systemd:
USEC_INITIALIZED=1830960145
KERNEL[1831.825857] add /devices/virtual/input/input23 (input)
ACTION=add
DEVPATH=/devices/virtual/input/input23
EV=100007
KEY=2fc800 145200000000 0 10300 49e800000c00 e16800000000f f810000010000ffc
MODALIAS=input:b0005v0000p0000e0000-e0,1,2,14,k71,72,73,8A,8B,A3,A5,A6,A7,A8,AB,AE,C8,C9,D0,161,164,166,16A,16C,18B,18E,18F,190,191,192,193,195,ramlsfw
NAME="CC:98:8B:80:DC:C3"
PRODUCT=5/0/0/0
PROP=0
REL=0
SEQNUM=6496
SUBSYSTEM=input
KERNEL[1831.825980] add /devices/virtual/input/input23/event19 (input)
ACTION=add
DEVNAME=/dev/input/event19
DEVPATH=/devices/virtual/input/input23/event19
MAJOR=13
MINOR=83
SEQNUM=6497
SUBSYSTEM=input
UDEV [1831.828331] add /devices/virtual/input/input23 (input)
ACTION=add
DEVPATH=/devices/virtual/input/input23
EV=100007
ID_BUS=bluetooth
ID_INPUT=1
ID_INPUT_KEY=1
KEY=2fc800 145200000000 0 10300 49e800000c00 e16800000000f f810000010000ffc
MODALIAS=input:b0005v0000p0000e0000-e0,1,2,14,k71,72,73,8A,8B,A3,A5,A6,A7,A8,AB,AE,C8,C9,D0,161,164,166,16A,16C,18B,18E,18F,190,191,192,193,195,ramlsfw
NAME="CC:98:8B:80:DC:C3"
PRODUCT=5/0/0/0
PROP=0
REL=0
SEQNUM=6496
SUBSYSTEM=input
TAGS=
答案1
您关于音频输入需要 HSP/HFP 的说法是正确的。蓝牙可能非常挑剔,请务必尝试忘记耳机并修复它。
/usr/bin/pacmd list-sources
为了帮助排除故障,以下是我的蓝耳机在 HSP/HSF 模式下的输出。
* index: 23
name: <bluez_source.00_16_94_1E_CC_05.headset_head_unit>
driver: <module-bluez5-device.c>
flags: HARDWARE HW_VOLUME_CTRL LATENCY
state: RUNNING
suspend cause: (none)
priority: 9050
volume: mono: 61166 / 93%
balance 0.00
base volume: 65536 / 100%
volume steps: 16
muted: no
current latency: 34.37 ms
max rewind: 0 KiB
sample spec: s16le 1ch 8000Hz
channel map: mono
Mono
used by: 1
linked by: 1
fixed latency: 28.00 ms
card: 9 <bluez_card.00_16_94_1E_CC_05>
module: 34
properties:
bluetooth.protocol = "headset_head_unit"
device.intended_roles = "phone"
device.description = "HD 4.40BT"
device.string = "00:16:94:1E:CC:05"
device.api = "bluez"
device.class = "sound"
device.bus = "bluetooth"
device.form_factor = "headset"
bluez.path = "/org/bluez/hci0/dev_00_16_94_1E_CC_05"
bluez.class = "0x240404"
bluez.alias = "HD 4.40BT"
device.icon_name = "audio-headset-bluetooth"
ports:
headset-input: Headset (priority 0, latency offset 0 usec, available: yes)
properties:
active port: <headset-input>
我确实看到我suspend cause: (none)
和你都有,suspend cause:
但这是我能注意到的唯一区别。
仅供参考,当使用蓝牙时,有时仅重新启动蓝牙服务是不够的。我发现这样效果更好:
sudo rfkill block bluetooth && sleep 0.1 && sudo rfkill unblock bluetooth;