17

In pre-WebRTC googletalkplugin days, one could disable AGC (automatic gain control for the microphone) by adding audio-flags: 1 to the config file. However, since Google Hangouts now use WebRTC, it often happens that while I'm chatting with someone, my microphone level shoots all the way down so that I'm more or less silent on the other side. I've also had correspondents whose mic volume was boosted all the way up, repeatedly.

I've reproduced this behaviour on http://opentokrtc.com/ which also uses WebRTC. By making loud popping sounds into my microphone, I can get the level to go all the way down in a few steps. I can do this both on Chrome 38 and FireFox 34 beta.

However, when I use a local application, such as Audacity, on my Ubuntu 14.04.1 machine, I am not able to affect the microphone level by making loud popping noises. In other words, it really looks like WebRTC is the culprit here.

It seems that on Chrome's implementation, one can configure WebRTC AGC by passing the googAutoGainControl to the getUserMedia() call. On FireFox I have not been able to find the equivalent.

My question is: As a WebRTC end-user, how can I configure my browser (Chrome or FireFox) to disable AGC, as AGC does not work correctly on my setup?

Charl Botha
  • 4,373
  • 34
  • 53
  • Hopefully [@jesup](http://stackoverflow.com/users/105687/jesup) sees this question and can answer for FireFox :) – Benjamin Trent Oct 21 '14 at 12:13
  • Have you made any progress here? I have stopped using Chrome as a result of this. – Aaron J Spetner Dec 01 '14 at 20:55
  • I'm afraid not, I'm also still stuck with the same problem. :( – Charl Botha Dec 02 '14 at 09:53
  • By the way, this question should probably not be on SO - I actually posted it on SuperUser yesterday. I found a paid (not super-expensive) solution that works: http://superuser.com/questions/847146/prevent-applications-from-changing-audio-input-gain/847327 – Aaron J Spetner Dec 02 '14 at 18:27
  • It is specified in https://tools.ietf.org/html/draft-ietf-rtcweb-audio-07 under audio level that the AGC for phone , communication webclients and softwares like mic recording etc if very different from one another . – Altanai Mar 03 '15 at 16:09
  • "If the client has control over the entire audio capture path, as is typically the case for a regular phone, then it is RECOMMENDED that the gain be adjusted in such a way that active speech have a level of 2600 (-19 dBm0) for an average speaker. If the client does not have control over the entire audio capture, as is typically the case for a software client, then the client SHOULD use automatic gain control (AGC) to dynamically adjust the level to 2600 (-19 dBm0) +/- 6 dB.For music, the level SHOULD NOT be automatically adjusted and the client SHOULD allow the user to set the gain manually" – Altanai Mar 03 '15 at 16:11

2 Answers2

6

The googAutoGainControl as MediaTrackConstraints is specific to Chrome (WebKit).

The WebRTC Working Group Charter still writing the standard and they will finish the next 30 June 2015.

Firefox not support right now.

Note: Use AGC is not recommended that you specify any browser-specific constraint as mandatory, as your call will fail in a browser that does not support the constraint. Instead, specify your constraints as optional. Your browser will do its best to satisfy as many optional constraints as possible.

BTW you can play with the GainNode interface in Firefox: https://developer.mozilla.org/en-US/docs/Web/API/GainNode

Example to disable the googAutoGainControl:

  var webrtc = new SimpleWebRTC({
    localVideoEl: 'localVideo',
    remoteVideosEl: '',
    autoRequestMedia: true,
    //detectSpeakingEvents: true,
    adjustPeerVolume: false,
    peerVolumeWhenSpeaking: 1,  
    media: {
      audio: {
        optional: [
          //{sourceId: audio_source},
          {googAutoGainControl: false}, 
          {googAutoGainControl2: false}, 
          {googEchoCancellation: false},
          {googEchoCancellation2: false},
          {googNoiseSuppression: false},
          {googNoiseSuppression2: false},
          {googHighpassFilter: false},
          {googTypingNoiseDetection: false},
          {googAudioMirroring: false}
        ]
     },
     video: {
        optional: [
          //{sourceId: video_source}
        ]
      }
    }
    //autoAdjustMic: false        
  });

The end-user cannot disable in the browser this functionality right now. The advanced user can edit preferences in the about:config in Firefox but in Chrome does not exist.

4

It looks like FireFox added some support for this in 46: https://wiki.mozilla.org/Media/WebRTC/ReleaseNotes/46

Implemented echoCancellation, mozAutoGainControl and mozNoiseSuppression gUM constraints. (See bug 987186.)

paleozogt
  • 6,393
  • 11
  • 51
  • 94