Microphone and bluetooth headset: two problems and one solution (for now)

Hello! I wish to share my audio configuration on my Lenovo legion 5 since I had/have some problems, some of them are now solved, but other not yet :slight_smile:

The main issue I encountered was with the input signal. I think microphones are extremely sensitive and the driver is not much capable of cleaning the signal. So I paste here the modifications I made to the configuration files to overcome the issue. Many thanks to the Arch wiki from which I found those improvemets for my situation.

In the file ‘/etc/pulse/daemon.conf’

avoid-resampling = yes
default-sample-rate = 48000

In the file ‘/etc/pulse/default.pa’

load-module module-udev-detect ignore_dB=1

### Enable Echo/Noise-Cancellation
load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0 digital_gain_control=1" source_name=echoCancel_source sink_name=echoCancel_sink
set-default-source echoCancel_source
set-default-sink echoCancel_sink

A few remarks:

  1. I ran before a test to see which is the sample rate and it is 48 kHz, so from that comes the first part

  2. I guess “ignore_dB=1” (that I added to the load-module line already there) it’s high-pass filter with 1dB of threshold

  3. The last lines create some new virtual audio devices (microphone and speakers) in which the microphone signal is cleaned from echoes and noises

What I would like to improve is an option the Echo/Noise cancellation module. In particular, I was unable to correctly set the following

load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0 digital_gain_control=1 beamforming=1 mic_geometry=-0.025,0,0,0.025,0,0 target_direction=1.57,0,0.5" source_name=exp_echoCancel_source sink_name=exp_echoCancel_sink

in the 1st line. What is added here are the arguments

"beamforming=1 mic_geometry=-0.025,0,0,0.025,0,0 target_direction=1.57,0,0.5"

that should improve the input post-processing by adding the reciprocal positions of the two microphones and the position of the speaker with respect to them.

Well, I will not add more infos, since if you’re reading this you probably know the subject and I would not like to be boring :slight_smile: If you don’t know and you have my same issues, you can find more infos on the Arch wiki where I found all the references.

As I said, this first problem have been “tamed”. The final result is good but still the recording quality in Windows is better and that’s why I hope to implement that extra arguments in the Echo/Noise cancellation module.

The second problem appears when I use my bluetooth headset. It’s probably irrelevant, however I would like to add that I use it as output only (stereo) and I use the laptop’s microphones as input. The problem is that occasionally it disconnects (I hear nothing) and after like 10 to 30 seconds I see on the screen the notification that audio signal is passing trough the laptop’s speakers. About 1 or 2 seconds later the headset connects again and it continues to work as output. During there 1 or 2 seconds, if something is playing, it plays trough the laptop’s speakers, unlike in the previous time interval, when I hear nothing from any device.

I have no idea if this is connected to audio settings/driver or to bluetooth drivers. I never had problems of this kind with those headphones with any device. To be specific, I had another laptop with Manjaro (and Windows) and the headphones worked correctly, and on this laptop I dual boot with Windows where they work fine. Never had problems also with Android devices. So my guess is that there’s a problem with this specific installation of Manjaro on my computer.

Furthermore, I would conclude saying that this problem is unrelated to the 1st one (and my solution to it) since it was there before and after my modifications.

If you have suggestions let me know, and if you have my same problem I invite you to try my setup even though it can be improved :slight_smile:

The PulseAudio option ignore_dB=1 is not a high pass filter
It is to make PulseAudio use only percentage audio levels for ALSA instead of decibels

PulseAudio/Documentation - module-alsa-sink
ignore_dB
A boolean. If “true”, any decibel information given by the ALSA drivers will be ignored (useful if that information is wrong).

One of the PulseAudio developers posted a blog article about beamforming that may have some additional information
Beamforming in PulseAudio – Arun Raghavan

Hi, many thanks for your answer (and clarification). I will check those links and do some experiments in the next days :slight_smile: If they’re successful I’ll update the first message