蓝牙耳机索尼 WH-1000XM3 无法用作音频输入

Man*_*zki 5 ubuntu udev audio bluetooth pulseaudio

我在使用我的 Sony WH-1000MX3 蓝牙耳机和我心爱的 Ubuntu 18.04 时遇到问题。Ubuntu 似乎无法使用耳机作为免提设备(这对于所有正在进行的视频通话很有用)。问题已部分解决,因为我可以通过使用blueman将蓝牙配置文件更改为 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
Run Code Online (Sandbox Code Playgroud)

其中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=
USEC_INITIALIZED=1831827982

UDEV  [1831.852895] add      /devices/virtual/input/input23/event19 (input)
ACTION=add
BACKSPACE=guess
DEVNAME=/dev/input/event19
DEVPATH=/devices/virtual/input/input23/event19
ID_BUS=bluetooth
ID_INPUT=1
ID_INPUT_KEY=1
MAJOR=13
MINOR=83
SEQNUM=6497
SUBSYSTEM=input
TAGS=:power-switch:
USEC_INITIALIZED=1831852732
XKBLAYOUT=fi
XKBMODEL=pc105
XKBOPTIONS=
XKBVARIANT=
Run Code Online (Sandbox Code Playgroud)

/usr/bin/pacmd list-sources我们在将耳机连接为 HSP/HFP 时进一步尝试了运气:

mande@mande-Lenovo-Y50-70:~$ /usr/bin/pacmd list-sources
4 source(s) available.
    index: 1
 name: <alsa_input.pci-0000_00_1b.0.analog-stereo>
 driver: <module-alsa-card.c>
 flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
 state: SUSPENDED
 suspend cause: IDLE 
 priority: 9039
 volume: front-left: 12236 /  19% / -43,73 dB,   front-right: 12236 /  19% / -43,73 dB
         balance 0,00
 base volume: 5206 /   8% / -66,00 dB
 volume steps: 65537
 muted: no
 current latency: 0,00 ms
 max rewind: 0 KiB
 sample spec: s16le 2ch 44100Hz
 channel map: front-left,front-right
              Stereo
 used by: 0
 linked by: 0
 configured latency: 0,00 ms; range is 0,50 .. 371,52 ms
 card: 1 <alsa_card.pci-0000_00_1b.0>
 module: 8
 properties:
  alsa.resolution_bits = "16"
  device.api = "alsa"
  device.class = "sound"
  alsa.class = "generic"
  alsa.subclass = "generic-mix"
  alsa.name = "ALC3239 Analog"
  alsa.id = "ALC3239 Analog"
  alsa.subdevice = "0"
  alsa.subdevice_name = "subdevice #0"
  alsa.device = "0"
  alsa.card = "1"
  alsa.card_name = "HDA Intel PCH"
  alsa.long_card_name = "HDA Intel PCH at 0xd1714000 irq 32"
  alsa.driver_name = "snd_hda_intel"
  device.bus_path = "pci-0000:00:1b.0"
  sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
  device.bus = "pci"
  device.vendor.id = "8086"
  device.vendor.name = "Intel Corporation"
  device.product.id = "8c20"
  device.product.name = "8 Series/C220 Series Chipset High Definition Audio Controller"
  device.form_factor = "internal"
  device.string = "front:1"
  device.buffering.buffer_size = "65536"
  device.buffering.fragment_size = "32768"
  device.access_mode = "mmap+timer"
  device.profile.name = "analog-stereo"
  device.profile.description = "Analog Stereo"
  device.description = "Built-in Audio Analog Stereo"
  alsa.mixer_name = "Realtek ALC3239"
  alsa.components = "HDA:10ec0283,17aa3807,00100003"
  module-udev-detect.discovered = "1"
  device.icon_name = "audio-card-pci"
 ports:
  analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
   properties:
    device.icon_name = "audio-input-microphone"
  analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
   properties:
    device.icon_name = "audio-input-microphone"
 active port: <analog-input-internal-mic>
    index: 4
 name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
 driver: <module-alsa-card.c>
 flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
 state: SUSPENDED
 suspend cause: IDLE 
 priority: 1030
 volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
         balance 0,00
 base volume: 65536 / 100% / 0,00 dB
 volume steps: 65537
 muted: yes
 current latency: 0,00 ms
 max rewind: 0 KiB
 sample spec: s16le 2ch 44100Hz
 channel map: front-left,front-right
              Stereo
 used by: 0
 linked by: 0
 configured latency: 0,00 ms; range is 0,50 .. 371,52 ms
 monitor_of: 3
 card: 1 <alsa_card.pci-0000_00_1b.0>
 module: 8
 properties:
  device.description = "Monitor of Built-in Audio Analog Stereo"
  device.class = "monitor"
  alsa.card = "1"
  alsa.card_name = "HDA Intel PCH"
  alsa.long_card_name = "HDA Intel PCH at 0xd1714000 irq 32"
  alsa.driver_name = "snd_hda_intel"
  device.bus_path = "pci-0000:00:1b.0"
  sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
  device.bus = "pci"
  device.vendor.id = "8086"
  device.vendor.name = "Intel Corporation"
  device.product.id = "8c20"
  device.product.name = "8 Series/C220 Series Chipset High Definition Audio Controller"
  device.form_factor = "internal"
  device.string = "1"
  module-udev-detect.discovered = "1"
  device.icon_name = "audio-card-pci"
index: 8
 name: <bluez_sink.CC_98_8B_80_DC_C3.headset_head_unit.monitor>
 driver: <module-bluez5-device.c>
 flags: DECIBEL_VOLUME LATENCY 
 state: IDLE
 suspend cause: 
 priority: 1050
 volume: mono: 66020 / 101% / 0,19 dB
         balance 0,00
 base volume: 65536 / 100% / 0,00 dB
 volume steps: 65537
 muted: yes
 current latency: 0,00 ms
 max rewind: 0 KiB
 sample spec: s16le 1ch 8000Hz
 channel map: mono
              Mono
 used by: 0
 linked by: 0
 fixed latency: 28,00 ms
 monitor_of: 7
 card: 5 <bluez_card.CC_98_8B_80_DC_C3>
 module: 32
 properties:
  device.description = "Monitor of WH-1000XM3"
  device.class = "monitor"
  device.string = "CC:98:8B:80:DC:C3"
  device.api = "bluez"
  device.bus = "bluetooth"
  device.form_factor = "headset"
  bluez.path = "/org/bluez/hci0/dev_CC_98_8B_80_DC_C3"
  bluez.class = "0x240404"
  bluez.alias = "WH-1000XM3"
  device.icon_name = "audio-headset-bluetooth"
  device.intended_roles = "phone"
  * index: 9
 name: <bluez_source.CC_98_8B_80_DC_C3.headset_head_unit>
 driver: <module-bluez5-device.c>
 flags: HARDWARE HW_VOLUME_CTRL LATENCY 
 state: RUNNING
 suspend cause: 
 priority: 9050
 volume: mono: 13265 / 20%
         balance 0,00
 base volume: 65536 / 100%
 volume steps: 16
 muted: no
 current latency: 28,00 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: 5 <bluez_card.CC_98_8B_80_DC_C3>
 module: 32
 properties:
  bluetooth.protocol = "headset_head_unit"
  device.intended_roles = "phone"
  device.description = "WH-1000XM3"
  device.string = "CC:98:8B:80:DC:C3"
  device.api = "bluez"
  device.class = "sound"
  device.bus = "bluetooth"
  device.form_factor = "headset"
  bluez.path = "/org/bluez/hci0/dev_CC_98_8B_80_DC_C3"
  bluez.class = "0x240404"
  bluez.alias = "WH-1000XM3"
  device.icon_name = "audio-headset-bluetooth"
 ports:
  headset-input: Headset (priority 0, latency offset 0 usec, available: unknown)
   properties:

 active port: <headset-input>
Run Code Online (Sandbox Code Playgroud)

这是我们对如何继续进行的想法已经耗尽的地方。任何关于在哪里调查什么的指示都将受到高度重视。提前致谢 :)


更新18.5:

我尝试连接另一个耳机 Bose QC35 II,但我再次只能将耳机用作音频接收器(A2DP 接收器)。当尝试将耳机连接为输入设备时,耳机会说:“有电话打来”,然后发出静电噪音。

再次cat /var/log/syslog看来,耳机被识别为键盘:

May 18 11:38:44 mande-Lenovo-Y50-70 /usr/lib/gdm3/gdm-x-session[3021]: (II) config/udev: Adding input device 2C:41:A1:04:B8:94 (/dev/input/event19)
May 18 11:38:44 mande-Lenovo-Y50-70 /usr/lib/gdm3/gdm-x-session[3021]: (**) 2C:41:A1:04:B8:94: Applying InputClass "libinput keyboard catchall"
Run Code Online (Sandbox Code Playgroud)

小智 1

您关于音频输入需要 HSP/HFP 的说法是正确的。蓝牙可能非常挑剔,请务必尝试忘记耳机并修复它。

为了帮助排除故障,以下是我的蓝耳机在 HSP/HSF 模式下的输出/usr/bin/pacmd list-sources

* 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>
Run Code Online (Sandbox Code Playgroud)

我确实看到我suspend cause: (none)和你都有suspend cause:,但这是我能注意到的唯一区别。

仅供参考,当使用蓝牙时,有时仅重新启动蓝牙服务是不够的。我发现这样效果更好: sudo rfkill block bluetooth && sleep 0.1 && sudo rfkill unblock bluetooth;