You are not logged in.

#1 2022-10-25 15:12:06

millus
Member
Registered: 2019-07-21
Posts: 220

Bluetooth A2DP has microphone not working

When I switch to the hi-fi profile A2DP the mic on my bt headset will no longer work.
Only way it works is to switch to lo-fi HFP profile, which has ridiculously bad audio quality (think radio transmission in 2nd world war or sth, dunno).
The worst part though is that in HFP mode all my headsets (I have 3) apparently cannot run in ANC mode but just in some noisy hear-through mode which is super annoying.
How to fix this? The same headset works perfectly fine on my OnePlus mobile phone.
Thanks!

Last edited by millus (2022-10-25 15:15:54)

Offline

#2 2022-10-25 15:44:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

You can't, your Android device does this via proprietary code that does have no free implementation.

There's a slight chance that if you have the adapter support and codec support that you are simply selecting a supobtimal HFP codec, what's your output of

pactl list cards
pactl list sinks

in this situation.

Offline

#3 2022-10-25 17:11:24

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

hmm

$ pactl list cards
Card #0
	Name: alsa_card.pci-0000_01_00.1
	Driver: module-alsa-card.c
	Owner Module: 6
	Properties:
		alsa.card = "0"
		alsa.card_name = "HDA NVidia"
		alsa.long_card_name = "HDA NVidia at 0xde080000 irq 17"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:01:00.1"
		sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0"
		device.bus = "pci"
		device.vendor.id = "10de"
		device.vendor.name = "NVIDIA Corporation"
		device.product.id = "10ef"
		device.product.name = "GP102 HDMI Audio Controller"
		device.string = "0"
		device.description = "GP102 HDMI Audio Controller"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Profiles:
		output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: no)
		output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (sinks: 1, sources: 0, priority: 38468, available: yes)
		output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-stereo-extra5: Digital Stereo (HDMI 6) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-surround-extra5: Digital Surround 5.1 (HDMI 6) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra5: Digital Surround 7.1 (HDMI 6) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-stereo-extra6: Digital Stereo (HDMI 7) Output (sinks: 1, sources: 0, priority: 5700, available: no)
		output:hdmi-surround-extra6: Digital Surround 5.1 (HDMI 7) Output (sinks: 1, sources: 0, priority: 600, available: no)
		output:hdmi-surround71-extra6: Digital Surround 7.1 (HDMI 7) Output (sinks: 1, sources: 0, priority: 600, available: no)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: off
	Ports:
		hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo, output:hdmi-surround, output:hdmi-surround71
		hdmi-output-1: HDMI / DisplayPort 2 (type: HDMI, priority: 5800, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra1, output:hdmi-surround-extra1, output:hdmi-surround71-extra1
		hdmi-output-2: HDMI / DisplayPort 3 (type: HDMI, priority: 5700, latency offset: 0 usec, available)
			Properties:
				device.icon_name = "video-display"
				device.product.name = "ROG PG279Q
  "
			Part of profile(s): output:hdmi-stereo-extra2
		hdmi-output-3: HDMI / DisplayPort 4 (type: HDMI, priority: 5600, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra3, output:hdmi-surround-extra3, output:hdmi-surround71-extra3
		hdmi-output-4: HDMI / DisplayPort 5 (type: HDMI, priority: 5500, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra4, output:hdmi-surround-extra4, output:hdmi-surround71-extra4
		hdmi-output-5: HDMI / DisplayPort 6 (type: HDMI, priority: 5400, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra5, output:hdmi-surround-extra5, output:hdmi-surround71-extra5
		hdmi-output-6: HDMI / DisplayPort 7 (type: HDMI, priority: 5300, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "video-display"
			Part of profile(s): output:hdmi-stereo-extra6, output:hdmi-surround-extra6, output:hdmi-surround71-extra6

Card #1
	Name: alsa_card.usb-046d_HD_Pro_Webcam_C920_265CFA6F-02
	Driver: module-alsa-card.c
	Owner Module: 7
	Properties:
		alsa.card = "3"
		alsa.card_name = "HD Pro Webcam C920"
		alsa.long_card_name = "HD Pro Webcam C920 at usb-0000:00:14.0-4.1, high speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:14.0-usb-0:4.1:1.2"
		sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.1/1-4.1:1.2/sound/card3"
		udev.id = "usb-046d_HD_Pro_Webcam_C920_265CFA6F-02"
		device.bus = "usb"
		device.vendor.id = "046d"
		device.vendor.name = "Logitech, Inc."
		device.product.id = "082d"
		device.product.name = "HD Pro Webcam C920"
		device.serial = "046d_HD_Pro_Webcam_C920_265CFA6F"
		device.form_factor = "webcam"
		device.string = "3"
		device.description = "HD Pro Webcam C920"
		module-udev-detect.discovered = "1"
		device.icon_name = "camera-web-usb"
	Profiles:
		input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
		input:iec958-stereo: Digital Stereo (IEC958) Input (sinks: 0, sources: 1, priority: 55, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: input:analog-stereo
	Ports:
		analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, availability unknown)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo
		iec958-stereo-input: Digital Input (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
			Part of profile(s): input:iec958-stereo

Card #2
	Name: alsa_card.usb-BLUE_MICROPHONE_Blue_Snowball_AYM_2018_07_04_92251-00
	Driver: module-alsa-card.c
	Owner Module: 8
	Properties:
		alsa.card = "2"
		alsa.card_name = "Blue Snowball"
		alsa.long_card_name = "BLUE MICROPHONE Blue Snowball at usb-0000:00:14.0-5.2, full speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:14.0-usb-0:5.2:1.0"
		sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.2/1-5.2:1.0/sound/card2"
		udev.id = "usb-BLUE_MICROPHONE_Blue_Snowball_AYM_2018_07_04_92251-00"
		device.bus = "usb"
		device.vendor.id = "0d8c"
		device.vendor.name = "C-Media Electronics, Inc."
		device.product.id = "0005"
		device.product.name = "Blue Snowball"
		device.serial = "BLUE_MICROPHONE_Blue_Snowball_AYM_2018_07_04_92251"
		device.string = "2"
		device.description = "Blue Snowball"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	Profiles:
		input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: input:analog-stereo
	Ports:
		analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, availability unknown)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo

Card #3
	Name: alsa_card.pci-0000_00_1f.3
	Driver: module-alsa-card.c
	Owner Module: 9
	Properties:
		alsa.card = "1"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xde140000 irq 179"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a2f0"
		device.product.name = "200 Series PCH HD Audio"
		device.form_factor = "internal"
		device.string = "1"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Profiles:
		input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 32833, available: yes)
		output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 39268, available: yes)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 39333, available: yes)
		output:analog-surround-21: Analog Surround 2.1 Output (sinks: 1, sources: 0, priority: 34068, available: yes)
		output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 34133, available: yes)
		output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 33968, available: yes)
		output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 34033, available: yes)
		output:analog-surround-41: Analog Surround 4.1 Output (sinks: 1, sources: 0, priority: 34068, available: yes)
		output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 34133, available: yes)
		output:analog-surround-50: Analog Surround 5.0 Output (sinks: 1, sources: 0, priority: 33968, available: yes)
		output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 34033, available: yes)
		output:analog-surround-51: Analog Surround 5.1 Output (sinks: 1, sources: 0, priority: 34068, available: yes)
		output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 34133, available: yes)
		output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 38268, available: yes)
		output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 38333, available: yes)
		output:iec958-ac3-surround-51: Digital Surround 5.1 (IEC958/AC3) Output (sinks: 1, sources: 0, priority: 300, available: yes)
		output:iec958-ac3-surround-51+input:analog-stereo: Digital Surround 5.1 (IEC958/AC3) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 33133, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: output:analog-stereo+input:analog-stereo
	Ports:
		analog-input-front-mic: Front Microphone (type: Mic, priority: 8500, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-ac3-surround-51+input:analog-stereo
		analog-input-rear-mic: Rear Microphone (type: Mic, priority: 8200, latency offset: 0 usec, available)
			Properties:
				device.icon_name = "audio-input-microphone"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-ac3-surround-51+input:analog-stereo
		analog-input-linein: Line In (type: Line, priority: 8100, latency offset: 0 usec, not available)
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-ac3-surround-51+input:analog-stereo
		analog-output-lineout: Line Out (type: Line, priority: 9000, latency offset: 0 usec, available)
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21, output:analog-surround-21+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo, output:analog-surround-41, output:analog-surround-41+input:analog-stereo, output:analog-surround-50, output:analog-surround-50+input:analog-stereo, output:analog-surround-51, output:analog-surround-51+input:analog-stereo
		analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, not available)
			Properties:
				device.icon_name = "audio-headphones"
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
		iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, latency offset: 0 usec, availability unknown)
			Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:analog-stereo

Card #4
	Name: bluez_card.30_50_75_5F_56_FD
	Driver: module-bluez5-device.c
	Owner Module: 28
	Properties:
		device.description = "Jabra Elite 85t"
		device.string = "30:50:75:5F:56:FD"
		device.api = "bluez"
		device.class = "sound"
		device.bus = "bluetooth"
		device.form_factor = "headset"
		bluez.path = "/org/bluez/hci0/dev_30_50_75_5F_56_FD"
		bluez.class = "0x240404"
		bluez.alias = "Jabra Elite 85t"
		bluetooth.battery = "20%"
		device.icon_name = "audio-headset-bluetooth"
		device.intended_roles = "phone"
		bluetooth.codec = "sbc"
	Profiles:
		handsfree_head_unit: Handsfree Head Unit (HFP) (sinks: 1, sources: 1, priority: 30, available: yes)
		a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: a2dp_sink
	Ports:
		headset-output: Headset (type: Headset, priority: 0, latency offset: 0 usec, available)
			Part of profile(s): handsfree_head_unit, a2dp_sink
		headset-input: Headset (type: Headset, priority: 0, latency offset: 0 usec, availability unknown)
			Part of profile(s): handsfree_head_unit
$ pactl list sinks
Sink #0
	State: IDLE
	Name: alsa_output.pci-0000_00_1f.3.analog-stereo
	Description: Built-in Audio Analog Stereo
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 9
	Mute: no
	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
	Monitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
	Latency: 39855 usec, configured 40000 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC1220 Analog"
		alsa.id = "ALC1220 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 0xde140000 irq 179"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a2f0"
		device.product.name = "200 Series PCH HD Audio"
		device.form_factor = "internal"
		device.string = "front:1"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Built-in Audio Analog Stereo"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		analog-output-lineout: Line Out (type: Line, priority: 9000, available)
		analog-output-headphones: Headphones (type: Headphones, priority: 9900, not available)
	Active Port: analog-output-lineout
	Formats:
		pcm

Sink #20
	State: RUNNING
	Name: bluez_sink.30_50_75_5F_56_FD.a2dp_sink
	Description: Jabra Elite 85t
	Driver: module-bluez5-device.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 28
	Mute: no
	Volume: front-left: 30446 /  46%,   front-right: 30446 /  46%
	        balance 0.00
	Base Volume: 65536 / 100%
	Monitor Source: bluez_sink.30_50_75_5F_56_FD.a2dp_sink.monitor
	Latency: 45688 usec, configured 45317 usec
	Flags: HARDWARE HW_VOLUME_CTRL LATENCY 
	Properties:
		bluetooth.protocol = "a2dp_sink"
		bluetooth.codec = "sbc"
		device.description = "Jabra Elite 85t"
		device.string = "30:50:75:5F:56:FD"
		device.api = "bluez"
		device.class = "sound"
		device.bus = "bluetooth"
		device.form_factor = "headset"
		bluez.path = "/org/bluez/hci0/dev_30_50_75_5F_56_FD"
		bluez.class = "0x240404"
		bluez.alias = "Jabra Elite 85t"
		bluetooth.battery = "50%"
		device.icon_name = "audio-headset-bluetooth"
		device.intended_roles = "phone"
	Ports:
		headset-output: Headset (type: Headset, priority: 0, available)
	Active Port: headset-output
	Formats:
		pcm

Edit: I guess that means there aren't any binary blobs either like for NVidia gpus or sth?
And does this mean that basically Bluetooth exists for 24 years and there was no driver ever created so the mic works on Linux in hq mode? lol. That seems kinda bizarre. Would've thought something important as this some ppl who know about intrinsics of this stuff would've accomplished something sad That's really pretty hard to believe. I mean there is even coreboot and TPM decoding and crazy stuff but there is no way to use a headset's mic in hq bt? Just...HOW...? I can't mentally cope with this, lmao. If aliens landed tomorrow and we're like, yeah we're an advancing civilisation, we already have lasers, rockets, are thinking of asteroid mining, have 3nm tech their leader be like "ok, hand me that bluetooth headset for a moment" and we're like oh sh.....!!

Last edited by millus (2022-10-25 19:06:47)

Offline

#4 2022-10-25 20:04:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

How old is your PC/bluetooth adpater? There are quite a few more modern codecs, but they can only be used if the device and the adapter support them, which at least from this excerpt doesn't appear to be the case here. But generally yes, bluetooth has stagnated as an open standard for quite a while and all the high quality audio extensions have been proprietary implementations. This has/will hopefully improve properly with BT 5 but there's not much HW for that currently.

However what I'm also seeing is that you aren't using pipewire and while I consider that there are a few cases where pulseaudio still works better especially in bluetooth integration pipewire has some much newer/more needed developments especially on the bluetooth front .  So you might want to test that out and install pipewire-audio, pipewire-pulse, pipewire-alsa, wireplumber and reboot. All of the pulse tools should still work but use pipewire as the backend.

Last edited by V1del (2022-10-25 20:06:38)

Offline

#5 2022-10-25 20:33:06

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

It's an "Intel 802.11ac WiFi + BT 4.2" chipset from a 2017 mainboard.

I have actually tried pipewire a year or two ago and it caused more bt problems, like no connection at all. When I looked on the web other ppl reported these kinds of problems with pipewire too, so I switched back to pulse only.
I could give it another go I guess, except if with my 4.2 bt it's useless anyway since I'd need bt 5.x ?

Last edited by millus (2022-10-25 20:33:37)

Offline

#6 2022-10-25 20:42:39

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

some of the newer codecs should still work on BT 4.2, but to be frank I'm not hopeful since pulse would support at least mSBC as well, which also doesn't appear as an option, so if none of these are present then you might be out of luck. Another thing you might try is re-pairing the device fully, sometimes the BT cache under /var/lib/bluetooth can be broken, initialized with wrong settings or so, in which case you could try removing that and re-pairing.

Offline

#7 2022-10-25 21:06:58

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

So do I understand it right that SBC is the normal codec I got and mSBC is the hq-codec which I need to get somehow? Some random site that listed "specs" of mSBC said "16kHz" which seemed quite a low sampling rate?

Last edited by millus (2022-10-25 22:06:16)

Offline

#8 2022-10-25 22:37:58

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

Ok, I installed those packages and have pipewire service running (and rtkit too).
First problem right away:

$ wireplumber 
C 00:33:28.240991               GLib (null):(null):(null): Failed to set scheduler settings: Operation not permitted
... and hangs

which according to https://www.reddit.com/r/pipewire/comme … _settings/
is "a bug in wireplumber", with the final "solution:

If only wireplumber is printing that message, then it's actually coming from glib and can be ignored. As was discussed in previous replies here (so, please, read those for context, if you insist on knowing why).

...great start, lol. I will trust that it's right and can really be ignored, can't do much else really.

But how do I control this pipewire actually? Like, add bluetooth devices and change mixer settings etc? I installed a GUI (qpwgraph) specified in the wiki but it seems to be some rather useless system level stuff rather than the actual audio mixer where I can set volume, profiles, devices etc like in pavucontrol.
I clicked the volume icon in xfce, choose "audio mixer", and it just hangs with an empty window saying just "establishing connection to pulseaudio. please wait"?

Also, I'm opening the blueman-applet now and clicking on the connected headset and then in context menu "audio and input profiles" will do absolutely nothing, not even a context menu pop up?
I'm surprised the "pactl" command wasn't uninstalled, I thought I just replaced pulseaudio with pipewire? However, trying to use pactl to switch audio output from speakers to bt headset just hangs. In fact any "pactl" call hangs.
This is the worst user experience I had in some time lol. Who makes things this halfway broken? Better not make them at all if it's like this, no?

The wiki says nothing, it's written as if the person who wrote it has totally forgotten what he actually went through to make all of it really WORK and just sort of posts the end tweaks he did, with no regard to ppl trying to install it from zero, lol. You can easily see this when it tells you to use "pavucontrol" to set configs, when calling pavucontrol actually just gives the exact same empty hanging screen than clicking the volume mixer icon. Next it mentions that you "can" install pipewire-pulse without actually saying WHY I would want to do that. Is it required for anything? Is it better? Is it worse? Will I not get the pipewire bt advantage then and be send on a wild goose google chase for hours or will it be fine, please JUST TELL ME.

Please, just what should I do now to actually make pipewire change audio output to the bt headset or to even just get a simple volume mixer up? Feels like testing developer-only access alpha software or sth, any help appreciated.

Last edited by millus (2022-10-26 10:02:09)

Offline

#9 2022-10-25 23:48:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

mSBC is still not massively high quality but a step up. Did you reboot as I've mentioned? it's not strictly required but the easiest way to resolve all wireplumber/pulseaudio conflicts without interference. You need to stop the pulseaudio daemon before wireplumber can take over and provide pulse integration itself, after which you should be able to use it with normal pulse tools like you are used to.

Alternatively do a

systemctl --user stop pulseaudio
systemctl --user start pipewire wireplumber pipewire-pulse

Last edited by V1del (2022-10-25 23:50:59)

Offline

#10 2022-10-26 09:39:13

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

Thanks for your patience, yes I rebooted as it was in the wiki instructions too.
But.. I just started the PC once more and now I can actually access the audio mixer fine, no idea why it suddenly works. But that's good. I strike-throu'ed my now invalid rant accordingly.

I do indeed have an mSBC profile now! It works, and it sounds not bad. Only one problem still:
The headset switches into hear-through mode and ANC mode is no longer accessible sad
I wonder if this is a driver thing or if headsets perhaps automatically switch into this mode while using HFP protocol or sth, according to some bt specs..

Last edited by millus (2022-10-26 10:23:26)

Offline

#11 2022-10-26 10:08:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

If you recheck with the two pactl commands now, did the situation change? As mentioned since pulse also doesn't show mSBC I'm less than confident you will be able to have any improvement here. I'd say the most promising is trying a re-pair and check whether other/different protocols are exposed. Might also be an implementation detail of the headset.

Edit: Ah yeah that's what I was looking for, I doubt you can do much about the ANC situation.

Last edited by V1del (2022-10-26 10:24:24)

Offline

#12 2022-10-26 10:40:28

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

Would be nice to have colours in this code blocks

$ systemctl --user stop pulseaudio
Failed to stop pulseaudio.service: Unit pulseaudio.service not loaded.
$ systemctl status pulseaudio
Unit pulseaudio.service could not be found.

and the others are already running

$ systemctl --user status pipewire wireplumber pipewire-pulse
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; disabled; preset: >
     Active: active (running) since Wed 2022-10-26 11:20:23 CEST; 1h 19min ago
TriggeredBy: ● pipewire.socket
   Main PID: 997 (pipewire)
      Tasks: 2 (limit: 77058)
     Memory: 67.3M
        CPU: 1min 38.346s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewi>
             └─997 /usr/bin/pipewire

Oct 26 11:20:23 archlinux systemd[867]: Started PipeWire Multimedia Service.
Oct 26 11:20:23 archlinux pipewire[997]: mod.rt: Can't find xdg-portal: (null)
Oct 26 11:20:23 archlinux pipewire[997]: mod.rt: found session bus but no portal
Oct 26 11:20:31 archlinux pipewire[997]: pw.node: (bluez_output.30_50_75_5F_56_>
Oct 26 11:34:37 archlinux pipewire[997]: pw.node: (bluez_output.30_50_75_5F_56_>
Oct 26 12:15:45 archlinux pipewire[997]: pw.link: 0x55b11bde0710: port 0x55b11b>

● wireplumber.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/wireplumber.service; enabled; preset>
     Active: active (running) since Wed 2022-10-26 11:20:23 CEST; 1h 19min ago
   Main PID: 1029 (wireplumber)
      Tasks: 4 (limit: 77058)
lines 1-23...skipping...
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; disabled; preset: enabled)
     Active: active (running) since Wed 2022-10-26 11:20:23 CEST; 1h 19min ago
TriggeredBy: ● pipewire.socket
   Main PID: 997 (pipewire)
      Tasks: 2 (limit: 77058)
     Memory: 67.3M
        CPU: 1min 38.346s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─997 /usr/bin/pipewire

Oct 26 11:20:23 archlinux systemd[867]: Started PipeWire Multimedia Service.
Oct 26 11:20:23 archlinux pipewire[997]: mod.rt: Can't find xdg-portal: (null)
Oct 26 11:20:23 archlinux pipewire[997]: mod.rt: found session bus but no portal
Oct 26 11:20:31 archlinux pipewire[997]: pw.node: (bluez_output.30_50_75_5F_56_FD.1-108) running -> error (Received error event)
Oct 26 11:34:37 archlinux pipewire[997]: pw.node: (bluez_output.30_50_75_5F_56_FD.1-108) running -> error (Received error event)
Oct 26 12:15:45 archlinux pipewire[997]: pw.link: 0x55b11bde0710: port 0x55b11be55e00 can't set io:1 (Spa:Enum:IO:Buffers): Invalid argument

● wireplumber.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/wireplumber.service; enabled; preset: enabled)
     Active: active (running) since Wed 2022-10-26 11:20:23 CEST; 1h 19min ago
   Main PID: 1029 (wireplumber)
      Tasks: 4 (limit: 77058)
     Memory: 52.8M
        CPU: 39.053s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/wireplumber.service
             └─1029 /usr/bin/wireplumber

Oct 26 12:35:14 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:15 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:16 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:16 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:17 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:18 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:27 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:47 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:35:48 archlinux wireplumber[1029]: sbc_decode failed: -3
Oct 26 12:38:08 archlinux wireplumber[1029]: sbc_decode failed: -3

● pipewire-pulse.service - PipeWire PulseAudio
     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service; disabled; preset: enabled)
     Active: active (running) since Wed 2022-10-26 11:20:23 CEST; 1h 19min ago
TriggeredBy: ● pipewire-pulse.socket
   Main PID: 1030 (pipewire-pulse)
      Tasks: 2 (limit: 77058)
     Memory: 239.4M
        CPU: 2min 6.981s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service
             └─1030 /usr/bin/pipewire-pulse

Oct 26 11:20:23 archlinux systemd[867]: Started PipeWire PulseAudio.
Oct 26 11:20:23 archlinux pipewire-pulse[1030]: mod.rt: Can't find xdg-portal: (null)
Oct 26 11:20:23 archlinux pipewire-pulse[1030]: mod.rt: found session bus but no portal
Oct 26 11:20:23 archlinux pipewire-pulse[1048]: 536870912
Oct 26 12:10:25 archlinux pipewire-pulse[1030]: mod.protocol-pulse: client 0x5629d9491060 [PulseAudio Volume Control]: ERROR command:104 (SEND_OBJECT_MESSAGE) tag:658 error:3 (Invalid argument)
Oct 26 12:10:25 archlinux pipewire-pulse[1030]: mod.protocol-pulse: client 0x5629d9491060 [PulseAudio Volume Control]: ERROR command:104 (SEND_OBJECT_MESSAGE) tag:659 error:3 (Invalid argument)
~

Last edited by millus (2022-10-26 10:42:29)

Offline

#13 2022-10-26 12:25:31

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

yeah all/most of those are expected, I initially saw your post before the edit, and wanted to check in pactl whether the mSBC profile would be available, but you seem to have found that.

Offline

#14 2022-10-26 13:12:52

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

Well thanks this is pretty good now.

Just wondering about these things..
- I read that pipewire has better latency than pulseaudio. But now this is pipewire-pulse right? So does it have worse latency or better latency than either of those?
- Headset in mSBC mode only allows toggling between hear-through or off, the ANC-mode suddenly disappears from its button functionality. Is this a bt protocol thing that is set in stone or a hardware manufacturer quirk or a linux driver thing that could be changed in software?

Also based on this I made a script to switch between A2DP and SBC/mSBC mode (depending on whether your system is pure pulseaudio or pipewire-pulse instead) when I go afk or when I'm back, for my Discord usage if anyone else using Discord is interested. You might just need to adjust the hex address and hardware names of your devices accordingly.
I switch between a2dp+snowball mic for streaming or normal usage and bt headset with internal mic when I'm just afk but still stalking to ppl on Discord^^:

#!/bin/bash

# called from .xbindkeysrc
# switch bt headset between a2dp + snowball mic when at the machine and hfp mode and internal mic when afk

# auto-determine system: pure pulseaudio vs pipewire-pulse
PIPEPULSE=`pacman -Ss pipewire-pulse | grep -o installed`
# for pure pulseaudio system
if [ "$PIPEPULSE" == "" ]; then
    #BTCARDIDX=`pacmd list cards | grep -o card:.*bluez_card | head -n 1 | grep -oE "[0-9]+"`
    BTCARDIDX=`pactl list cards short | grep "bluez" | grep -oE "^[0-9]+"`
    HSPHFP=handsfree_head_unit
# for pipewire-pulse system
else
    BTCARDIDX=`pactl list cards | awk -v RS='' '/bluez/' | awk -F' = ' '/object.serial/ { print $2 }' | grep -oE "[0-9]+"`
    HSPHFP=headset-head-unit-msbc
fi
# get currently active profile: A2DP or (m)SBC
BTPROFILE=`pactl list cards | awk -v RS='' '/bluez/' | awk -F': ' '/Active Profile/ { print $2 }'`

# get Discord mixer ID
#DISCORDID=`pactl list clients | awk -v RS='' '/WEBRTC VoiceEngine/' | awk -F': ' '/Owner Module:/ { print $2 }'`
DISCORDID=`pactl list source-outputs | awk -v RS='' '/WEBRTC VoiceEngine/' | grep -oE "Source Output #[0-9]+" | grep -o "[0-9]*"`

#debug stuff -_-
#echo "$BTCARDIDX"
#echo "$HSPHFP"
#echo "$BTPROFILE"
#echo "$BTDISCORDID"
#exit

# switch between both profiles, A2DP and (m)SBC
if [ "$BTPROFILE" == "$HSPHFP" ]; then
    # for pure pulseaudio system
    if [ "$PIPEPULSE" == "" ]; then
        # switch profile
        pacmd set-card-profile $BTCARDIDX a2dp_sink
        # that switching resets all active audio connections to switch back to main speakers, so redirect them all back to bt again:
        pacmd set-default-sink bluez_sink.30_50_75_5F_56_FD.a2dp_sink
        # and set system's default mic to external aka blue snowball
        pacmd set-default-source alsa_input.usb-BLUE_MICROPHONE_Blue_Snowball_AYM_2018_07_04_92251-00.analog-stereo
    # for pipewire-pulse system
    else
        # switch profile
        #a2dp-sink         a2dp-sink-aac     a2dp-sink-sbc     a2dp-sink-sbc_xq
        pactl set-card-profile $BTCARDIDX a2dp-sink-sbc
        # that switching resets all active audio connections to switch back to main speakers, so redirect them all back to bt again:
        pactl set-default-sink bluez_output.30_50_75_5F_56_FD.1
        # and set system's default mic to external aka blue snowball
        pactl set-default-source alsa_input.usb-BLUE_MICROPHONE_Blue_Snowball_AYM_2018_07_04_92251-00.analog-stereo.3 
    fi
    # aaand even though discord audio config realizes that the default input device was switched it will still keep using the wrong one, so we hard-force it via the app's pulseaudio setting
    pactl move-source-output $DISCORDID alsa_input.usb-BLUE_MICROPHONE_Blue_Snowball_AYM_2018_07_04_92251-00.analog-stereo
else
    # for pure pulseaudio system
    if [ "$PIPEPULSE" == "" ]; then
        # switch profile
        pacmd set-card-profile $BTCARDIDX handsfree_head_unit
        # that switching resets all active audio connections to switch back to main speakers, so redirect them all back to bt again:
        pacmd set-default-sink bluez_sink.30_50_75_5F_56_FD.handsfree_head_unit
        # and set system's default mic to internal ie headset's mic
        pacmd set-default-source bluez_source.30_50_75_5F_56_FD.handsfree_head_unit
    # for pipewire-pulse system
    else
        # switch profile
        pactl set-card-profile $BTCARDIDX $HSPHFP
        # that switching resets all active audio connections to switch back to main speakers, so redirect them all back to bt again:
        pactl set-default-sink bluez_output.30_50_75_5F_56_FD.1
        # and set system's default mic to internal ie headset's mic
        pactl set-default-source bluez_input.30_50_75_5F_56_FD.0
    fi
    # aaand even though discord audio config realizes that the default input device was switched it will still keep using the wrong one, so we hard-force it via the app's pulseaudio setting
    pactl move-source-output $DISCORDID bluez_source.30_50_75_5F_56_FD.handsfree_head_unit
fi

and I bound this script to my SCROLL LOCK key as that is not used for anything else. I guess PAUSE key would also work but that already toggles voice activation mode in Discord for me^^. To bind the script to the key I added this to my .xbindkeysrc file:

#switch bt headset between a2dp + snowball mic when at the machine and hfp mode and internal mic when afk
"toggle-bt-profile.sh"
    m:0x0 + c:78
    Scroll_Lock

Last but not least I noticed that calling xbindkeys from .xinitrc has a timing problem, so I call it delayed now, here's the .xinitrc part... this should probably come before starting the DE eg startxfce, I dunno how sync/async stuff is ran in there really hmm

(sleep 10; killall -9 xbindkeys; xbindkeys) &

Last edited by millus (2022-10-26 13:26:36)

Offline

#15 2022-10-26 13:26:24

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

You have a bluetooth device, all potential latency benefits evaporate on the wireless connection. pipewire-pulse is still pipewire but using code to be able to handle pulse clients. How good the latency can be here highly depends on which kind of software you are using and what it's latency requirements are, but BT has by definition latency that is far out of all normal considerations here, so the difference between the two will be imperceptible. "Generally" in order to be able to hold to the pulseaudio API contract, the latency should be more or less the same as on pulse.

Not sure, I'm assuming HW quirk with the HFP protocol (... to test this properly you could enable debug settings on your phone and enforce usage of the mSBC protocol in lieu of whatever is the current default and check whether you can reproduce)

Offline

#16 2022-10-26 13:29:35

millus
Member
Registered: 2019-07-21
Posts: 220

Re: Bluetooth A2DP has microphone not working

ok cool yikes
On phone calls the same thing happens actually, going into hear-through/off with ANC suddenly not accessible anymore. Will maybe try to find out about debug settings and stuff =_=

Offline

#17 2022-10-26 13:31:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,844

Re: Bluetooth A2DP has microphone not working

If the same happens on phone calls then you have exactly that. Your phone simply auto switches between HSP/A2DP when you're not in a call/not using a mic.

Offline

Board footer

Powered by FluxBB