Ubuntu – Bluetooth headset Sony WH-1000XM3 not working as audio input

audiobluetoothpulseaudioUbuntuudev

I'm having issues using my Sony WH-1000MX3 Bluetooth headset with my beloved Ubuntu 18.04. Ubuntu does not seem to be able to use the headset as a handsfree (which would be useful with all the video-calls going on). The problem is partially solved, as I'm able to use the headset for audio output, by changing the Bluetooth profile to A2DP using blueman. However, I still haven't found a solution for using the headset for audio input (which I believe would require HSP/HFP profile?).

Originally I thought the Bluetooth of the laptop might be incompatible, however, with my dual-boot Windows the headset works without issues. So I believe the issue should not be on the hardware?

More so, the Ubuntu settings and Pulseaudio seem to recognize the headset as an audio input – however, no audio is received from the headset.

While looking into the problem, I found out the following lines from 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

Where the Mac address of CC:98:8B:80:DC:C3 corresponds to the headset.

My friend suggested looking into udev output, but we could not find anything suspicious. Here's the udevadm output for headset connecting:

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=

We further tried our luck with /usr/bin/pacmd list-sources while having the headset connected as 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>

This is where we ran out of ideas on how to proceed. Any pointers on where what to look into would be highly valued. Thanks in advance 🙂


Update 18.5:

I tried connecting another headset Bose QC35 II, but again I'm only able to use the headset as audio sink (A2DP sink). When trying to connect the headset as input device, the headset says: "a call from" and gives static noise after that.

Again from cat /var/log/syslog it seems that the headset is recognized as keyboard:

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"

Best Answer

You are right about HSP/HFP being required for audio input. Bluetooth can be quite finicky, make sure to try forgetting the headset and repairing it.

For helping with troubleshooting, here is the output of /usr/bin/pacmd list-sources for my blueheadset in HSP/HSF mode.

* 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>

I do see that I have suspend cause: (none) and you have suspend cause: but that is the only difference I can notice.

FYI, when working with bluetooth sometime restarting the bluetooth service alone isn't enough. I found this works better: sudo rfkill block bluetooth && sleep 0.1 && sudo rfkill unblock bluetooth;

Related Question