Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Issue 9702019: Adds Analog Gain Control (AGC) to the WebRTC client. (Closed)

Created:
8 years, 9 months ago by henrika (OOO until Aug 14)
Modified:
8 years, 9 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org, no longer working on chromium
Visibility:
Public.

Description

Adds Analog Gain Control (AGC) to the WebRTC client. The AGC functionality is as follows. It aims at maintaining the same speech loudness level from the microphone. This is done by both controlling the analog microphone gain and applying a digital gain. The microphone gain on the sound card is slowly increased/decreased during speech only. By observing the microphone control slider you can see it move when you speak. If you scream, the slider moves downwards and then upwards again when you return to normal. It is not uncommon that the slider hits the maximum. This means that the maximum analog gain is not large enough to give the desired loudness. Nevertheless, we can in general still attain the desired loudness. If the microphone control slider is moved manually, the analog adaptation restarts and returns to roughly the same position as before the change if the circumstances are still the same. When the input microphone signal causes saturation, the level is decreased dramatically and has to re-adapt towards the old level. The adaptation is a slowly varying process and at the beginning of a call this is noticed by a slow increase in volume. Smaller changes in microphone input level is leveled out by the built-in digital control. For larger differences we need to rely on the slow adaptation. BUG=115265 TEST=content_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=129400

Patch Set 1 #

Patch Set 2 : Contains several improvements tested on Windows #

Patch Set 3 : Addedlogging and improved performance on Windows #

Patch Set 4 : Fixed EOLs #

Patch Set 5 : Fixed EOLs #

Patch Set 6 : Added support for change of AGC state during run-time #

Patch Set 7 : Fixed EOL:s #

Patch Set 8 : Fixed building errors on Mac #

Patch Set 9 : Improved volume updating on Mac #

Total comments: 41

Patch Set 10 : Changes based on review from Tommmi and Andrew #

Patch Set 11 : Added new AudioStreamImpl class and improved thread protection #

Patch Set 12 : Added media.gyp #

Patch Set 13 : Added audio_input_stream_impl.h/.cc #

Total comments: 3

Patch Set 14 : Fixed buidling errors after rebase #

Patch Set 15 : Added AGC support for Linux as well #

Patch Set 16 : Rebased #

Patch Set 17 : Contains latest fixes for Mac OSX #

Patch Set 18 : Improved AGC comments #

Total comments: 30

Patch Set 19 : Changes based on review by Andrew and Tommi #

Patch Set 20 : Added comment about AGC not supported on Windows XP #

Patch Set 21 : Finalized the AGC comments and did minor changes in the ADM #

Patch Set 22 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+662 lines, -136 lines) Patch
M content/browser/renderer_host/media/audio_input_renderer_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_renderer_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +9 lines, -18 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_sync_writer.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_input_sync_writer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +10 lines, -5 lines 0 comments Download
M content/common/media/audio_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -7 lines 0 comments Download
M content/renderer/media/audio_input_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +14 lines, -2 lines 0 comments Download
M content/renderer/media/audio_input_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +44 lines, -8 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 5 chunks +125 lines, -11 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 13 chunks +82 lines, -35 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +16 lines, -6 lines 0 comments Download
M content/renderer/pepper/pepper_platform_audio_input_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M media/audio/audio_input_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +14 lines, -2 lines 0 comments Download
M media/audio/audio_input_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +49 lines, -3 lines 0 comments Download
M media/audio/audio_input_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
A media/audio/audio_input_stream_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +67 lines, -0 lines 0 comments Download
A media/audio/audio_input_stream_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +68 lines, -0 lines 0 comments Download
M media/audio/audio_input_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_io.h View 2 chunks +8 lines, -1 line 0 comments Download
M media/audio/audio_low_latency_input_output_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M media/audio/audio_parameters.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +13 lines, -0 lines 0 comments Download
M media/audio/fake_audio_input_stream.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M media/audio/fake_audio_input_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +7 lines, -1 line 0 comments Download
M media/audio/linux/alsa_input.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -1 line 0 comments Download
M media/audio/linux/alsa_input.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +15 lines, -1 line 0 comments Download
M media/audio/mac/audio_input_mac.h View 1 chunk +2 lines, -0 lines 0 comments Download
M media/audio/mac/audio_input_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +11 lines, -1 line 0 comments Download
M media/audio/mac/audio_low_latency_input_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +4 lines, -1 line 0 comments Download
M media/audio/mac/audio_low_latency_input_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +24 lines, -2 lines 0 comments Download
M media/audio/mac/audio_low_latency_input_mac_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +5 lines, -5 lines 0 comments Download
M media/audio/win/audio_low_latency_input_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M media/audio/win/audio_low_latency_input_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +21 lines, -5 lines 0 comments Download
M media/audio/win/audio_low_latency_input_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +8 lines, -6 lines 0 comments Download
M media/audio/win/audio_low_latency_output_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -0 lines 0 comments Download
M media/audio/win/wavein_input_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -0 lines 0 comments Download
M media/audio/win/wavein_input_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +16 lines, -4 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
henrika (OOO until Aug 14)
Tommi and Shijing, please take a look at this CL. It has grown quite a ...
8 years, 9 months ago (2012-03-15 17:25:08 UTC) #1
tommi (sloooow) - chröme
http://codereview.chromium.org/9702019/diff/2002/content/browser/renderer_host/media/audio_input_renderer_host.cc File content/browser/renderer_host/media/audio_input_renderer_host.cc (right): http://codereview.chromium.org/9702019/diff/2002/content/browser/renderer_host/media/audio_input_renderer_host.cc#newcode220 content/browser/renderer_host/media/audio_input_renderer_host.cc:220: uint32 mem_size = AudioInputBuffer::kSizeOfStructMinusArr + packet_size; nit: change kSizeOfStructMinusArr ...
8 years, 9 months ago (2012-03-16 13:31:05 UTC) #2
scherkus (not reviewing)
few drive by things https://chromiumcodereview.appspot.com/9702019/diff/2002/content/browser/renderer_host/media/audio_input_renderer_host.cc File content/browser/renderer_host/media/audio_input_renderer_host.cc (right): https://chromiumcodereview.appspot.com/9702019/diff/2002/content/browser/renderer_host/media/audio_input_renderer_host.cc#newcode305 content/browser/renderer_host/media/audio_input_renderer_host.cc:305: NOTIMPLEMENTED(); On 2012/03/16 13:31:05, tommi ...
8 years, 9 months ago (2012-03-20 13:49:41 UTC) #3
scherkus (not reviewing)
http://codereview.chromium.org/9702019/diff/2002/content/renderer/media/webrtc_audio_device_impl.cc File content/renderer/media/webrtc_audio_device_impl.cc (right): http://codereview.chromium.org/9702019/diff/2002/content/renderer/media/webrtc_audio_device_impl.cc#newcode699 content/renderer/media/webrtc_audio_device_impl.cc:699: // active. when you say "most common usage" do ...
8 years, 9 months ago (2012-03-21 09:21:21 UTC) #4
henrika (OOO until Aug 14)
Great input; thanks. I'll come back with a new version soon taking the following things ...
8 years, 9 months ago (2012-03-21 10:16:03 UTC) #5
henrika (OOO until Aug 14)
Hi guys, added a new version where I broke out platform-independent AGC-related parts from the ...
8 years, 9 months ago (2012-03-22 12:51:59 UTC) #6
henrika (OOO until Aug 14)
Seems this CL needs some serious rebasing first as well. Please hold off your comments ...
8 years, 9 months ago (2012-03-22 13:34:09 UTC) #7
henrika (OOO until Aug 14)
Should be ready for a final? round now. Added support for Linux and Mac as ...
8 years, 9 months ago (2012-03-26 11:10:41 UTC) #8
tommi (sloooow) - chröme
lgtm with a few comments. http://codereview.chromium.org/9702019/diff/17032/content/renderer/media/audio_input_device.cc File content/renderer/media/audio_input_device.cc (right): http://codereview.chromium.org/9702019/diff/17032/content/renderer/media/audio_input_device.cc#newcode52 content/renderer/media/audio_input_device.cc:52: agc_is_enabled_(false) { indent http://codereview.chromium.org/9702019/diff/17032/content/renderer/media/audio_input_device.cc#newcode102 ...
8 years, 9 months ago (2012-03-26 15:26:38 UTC) #9
henrika (OOO until Aug 14)
Thanks Tommi, will fix the final issues tomorrow. Andrew: it would be great if you ...
8 years, 9 months ago (2012-03-26 15:52:30 UTC) #10
piman
LGTM on the pepper part. Would AGC be a good feature to expose to Pepper ...
8 years, 9 months ago (2012-03-26 16:44:38 UTC) #11
henrika (OOO until Aug 14)
The AGC is currently only available through the WebRTC client since the core part of ...
8 years, 9 months ago (2012-03-26 19:08:51 UTC) #12
scherkus (not reviewing)
LGTM w/ nits http://codereview.chromium.org/9702019/diff/25002/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): http://codereview.chromium.org/9702019/diff/25002/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode24 content/browser/renderer_host/media/audio_input_sync_writer.cc:24: double volume) { nit: indent to ...
8 years, 9 months ago (2012-03-26 22:41:04 UTC) #13
henrika (OOO until Aug 14)
Great input. Modified accordingly. http://codereview.chromium.org/9702019/diff/25002/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): http://codereview.chromium.org/9702019/diff/25002/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode24 content/browser/renderer_host/media/audio_input_sync_writer.cc:24: double volume) { On 2012/03/26 ...
8 years, 9 months ago (2012-03-27 09:20:38 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/henrika@chromium.org/9702019/33011
8 years, 9 months ago (2012-03-27 10:56:22 UTC) #15
commit-bot: I haz the power
8 years, 9 months ago (2012-03-27 13:38:58 UTC) #16
Try job failure for 9702019-33011 (retry) on win_rel for step "browser_tests".
It's a second try, previously, steps "browser_tests, installer_util_unittests"
failed.
http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&nu...

Powered by Google App Engine
This is Rietveld 408576698