Ubuntu – How to disable microphone from auto adjusting its input volume

pulseaudio

I want to disable the way the microphone lowers itself depending on the input. Here is an image:

enter image description here

The microphone started at 100% and slowly started to drop to where the image is showing. This is because of either a background noise or the user raising their voice. In any case, I would like to prohibit this behavior because when it gets too low, the need to raise the voice will be actually needed.

So is there an option or configuration file where one can edit and change this behavior?

This is not related to only one app but several, ranging from Skype to Google Hangouts, Empathy to Teamspeak and more. So please no answers mentioning only one app if the solution does not solve the problem for others.

the pulseaudio app (gui and terminal) was already used. Alsamixer was also used. In both cases, adjusting the microphone level did not help. The auto adjust always happens when anyone speaks, does not even need to be someone speaking loud, they just need to speak and after a couple of seconds the mic level will start auto adjusting. I repeat, this is not a 1 app problem but several, so a common solution is better than a 1 for each app (Which we are talking about more than 50 apps).

Best Answer

Not sure if this applies to everyone, but if you use any kind of web conference / video chat service in Chrome / Chromium such as Google Hangouts, there's a good chance it uses the WebRTC protocol. Unfortunately the WebRTC implementation in Chromium comes with a handy “feature” called Automatic Gain Control that tends to screw with your microphone volume. Unless the web app itself gives you an option to disable it, there is otherwise no way turn it off, and Chrome developers don't want to add a global “off switch” for it.

What I ended up doing was to use @lelandbatey's solution. Since I was using PulseAudio, I used pacmd instead of amixer:

while sleep 0.1; do pacmd set-source-volume alsa_input.???-?????.analog-stereo 90000; done

Note that 65535 corresponds to 100%, so 90000 is about 135%. The name of the device (alsa_input.???-?????.analog-stereo) should be substituted with whatever you find by running pacmd list-sources | grep name::

name: <alsa_input.???-?????.analog-stereo>