Revisiting this once again with a couple of updates…
-
I do feel there is notable improvement in outgoing call audio to be gained by disabling the top internal mic. For me, disabling the top internal mic reduces or resolves the issues I have been experiencing to the extent that I feel I am now able to have a call conversation. Using the “i2ctransfer
” method as previously noted in this thread to disable the top mic works but something resets/re-enables the mic from time to time and it does not survive across reboots. I have found that using pavucontrol
provides an easier and more user friendly way of disabling the top mic and it appears to stick.
-
With use of a small USB C external DAC I am able to get the Librem 5 to recognise my wired headset, with a little bit of additional hoop jumping I am able to use the external mic of the headset for outgoing audio from Calls.
To disable the top internal mic, install pavucontrol from a terminal…
sudo apt install pavucontrol
Once installed the app will be available from the main app view (after selecting to show all apps) under the name “PulseAudio Volume Control”. After launching the app, it’s quite straight forward…
- Choose the “Input Devices” tab
- Unlink the Left/Right gain controls to give independent control of each
- Disable top internal mic by setting “Front Left” gain to 0%
See below image for visual guide…
Setting the “Front Right” (bottom internal mic) to around 65~75% works well for me.
With a wired headset connected via a USB DAC, Calls
threw up two problems…
-
As soon as a call is connected, the mic volume dropped to a very low level, individuals on the other end of the call could barely hear anything if at all.
-
Raising the volume manually to overcome issue 1, apart from being inconvenient and impractical, triggers automatic gain control which increases the volume over a short period to max or close to it resulting in outgoing call audio being heavily distorted at the receiving end.
I have two different DACs both exhibiting the same issues which leads to me to conclude the issues are more likely down to the behaviour of Calls
rather than anything to do with the DACs themselves.
Although I see no need for any echo cancellation or automatic volume control when using a headset, it seems the echo cancellation module needs to be loaded and configured for the headset in order for Calls
to leave it alone, my guess is by loading and configuring the module it overrides anything Calls
trying to do in that regard.
With USB audio sources (Mics, DACs (and in this case ADCs) etc,.) the echo-cancellation module has to be reloaded each time the device is connected, the module appears to get unloaded each time the USB source is disconnected.
I was unsuccessful when loading the module and applying echo cancellation to the device directly (via filter.apply.echo-cancel.parameters
), the filtered registered but seemed to be still getting overridden, so I’m currently just loading and configuring the module in a more global sense.
After attaching the headset and DAC, the module configuration that I am using at the moment can be entered from a terminal…
pactl load-module \
module-echo-cancel \
use_volume_sharing=1 \
use_master_format=1 \
aec_args=" \
analog_gain_control=0\ \
voice_detection=0\ \
high_pass_filter=0\ \
noise_suppression=0"
use_volume_sharing=1
appears to be the magic that stops the mic volume dropping to low levels when a call connects. Although this module creates a virtual echo cancelled source, I am using the standard headset mic source and outgoing call audio is pretty good.
If the module needs to be unloaded for any reason and you do want to detach the device, the module can be simply unloaded from the terminal with…
pactl unload-module module-echo-cancel
As it is a little cumbersome to be manually loading and configuring the module each time the headset is connected, I have set up a udev rule that loads and configures the echo cancellation module whenever it sees either of the two DACs I have connecting which makes calls via a headset quite usable now.
And, just as an aside for @dos, while working through these bits I took a couple of waveform captures (both locally on the Librem 5 and at the receiving end), I do not see any sign of a DC offset on either of the internal mics as described in Issue #348: Built-in microphone feed off-center (DC offset). Where in the signal path did you see the offset?