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

Issue 99033003: Enable platform echo cancellation through the AudioRecord path. (Closed)

Created:
7 years ago by ajm
Modified:
6 years, 11 months ago
CC:
xians, henrike, wjia(left Chromium), chromium-reviews, fischman+watch_chromium.org, jam, mcasas+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Enable platform echo cancellation through the AudioRecord path. Add a platform effects mask member to AudioParameters. This allows the availability of platform effects (currently AEC) to be plumbed up to MediaStreamDependencyFactory, where they can be reconciled with the media constraints to determine if the effects should be enabled. When this is the case, the constraints will be modified to disable the corresponding software effect in PeerConnection. The availability is controlled by a whitelist of device models in AudioManagerAndroid, which for AEC, currently consists of Nexus 5 and Nexus 7. AudioManagerAndroid will use the AudioRecord path iff the platform AEC is enabled. TESTED=Using apprtc on a N5 and N7 (whitelisted): - The AudioRecord input path is used. - The platform AEC is enabled and the software AEC (in PeerConnection) is disabled. - Calls have good echo cancellation quality. Using apprtc with ?audio=googEchoCancellation=false on a N5 and N7: - The OpenSLES input path is used. - Both the platform and software AEC are disabled. Using apprtc on Nexus 4 (non-whitelisted): - The OpenSLES input path is used. - The platform AEC is disabled and the software AEC is enabled. Using apprtc on Galaxy S2 (running ICS): - The OpenSLES input path is used. audio_android_unittest.cc passes on N5, N7 and Galaxy S2 TBR=jschuh Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=240548

Patch Set 1 : . #

Total comments: 1

Patch Set 2 : Rebase. #

Total comments: 63

Patch Set 3 : Remove getEnabled() logging. #

Total comments: 4

Patch Set 4 : Add PlatformEffects, unittests and clean up. #

Total comments: 13

Patch Set 5 : Set effects through constructors. #

Total comments: 10

Patch Set 6 : Switch to bitmask. #

Patch Set 7 : Java fixes. #

Total comments: 1

Patch Set 8 : Comment updates. #

Total comments: 4

Patch Set 9 : Comment for const members. #

Patch Set 10 : Fix tests and remove SetDiscreteChannels. #

Total comments: 5

Patch Set 11 : Fix ChannelMixerTest and audio_manager_{win,mac} (and rebase...) #

Patch Set 12 : Java import ordering. #

Patch Set 13 : Rebase. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+366 lines, -151 lines) Patch
M content/browser/renderer_host/media/audio_input_device_manager.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M content/common/media/media_param_traits.cc View 1 2 3 4 5 2 chunks +9 lines, -5 lines 0 comments Download
M content/common/media/media_stream_messages.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/media_stream_request.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -3 lines 0 comments Download
M content/renderer/media/media_stream_dependency_factory.cc View 1 2 3 4 5 6 7 4 chunks +42 lines, -3 lines 5 comments Download
M content/renderer/media/webrtc_audio_capturer.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -3 lines 0 comments Download
M content/renderer/media/webrtc_audio_capturer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +19 lines, -15 lines 0 comments Download
M content/renderer/media/webrtc_audio_capturer_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -2 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/media/webrtc_local_audio_track_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +9 lines, -5 lines 0 comments Download
M content/renderer/renderer_webkitplatformsupport_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M media/audio/alsa/audio_manager_alsa.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M media/audio/android/audio_android_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 19 chunks +106 lines, -58 lines 0 comments Download
M media/audio/android/audio_manager_android.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M media/audio/android/audio_manager_android.cc View 1 2 3 4 5 4 chunks +25 lines, -6 lines 0 comments Download
M media/audio/android/audio_record_input.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M media/audio/android/audio_record_input.cc View 1 2 3 4 5 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 5 chunks +19 lines, -5 lines 0 comments Download
M media/audio/audio_parameters.cc View 1 2 3 4 5 6 7 8 9 3 chunks +23 lines, -9 lines 0 comments Download
M media/audio/fake_audio_manager.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M media/audio/mac/audio_manager_mac.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -4 lines 0 comments Download
M media/audio/pulse/audio_manager_pulse.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M media/audio/win/audio_manager_win.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +15 lines, -3 lines 0 comments Download
M media/base/android/java/src/org/chromium/media/AudioRecordInput.java View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +44 lines, -15 lines 0 comments Download
M media/base/channel_mixer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -6 lines 0 comments Download

Messages

Total messages: 56 (0 generated)
ajm
Ami: *.java changes Tommi, Henrik A: everything Shijing, Henrik E, Wei: added you to CC ...
7 years ago (2013-12-06 04:29:22 UTC) #1
ajm
https://codereview.chromium.org/99033003/diff/40001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/40001/media/audio/audio_parameters.h#newcode62 media/audio/audio_parameters.h:62: int frames_per_buffer, bool use_platform_aec); If we agree on this ...
7 years ago (2013-12-06 04:30:49 UTC) #2
henrika (OOO until Aug 14)
Looks like great stuff Andrew; but first: how does the EC performance differ for the ...
7 years ago (2013-12-06 06:56:54 UTC) #3
ajm
On 2013/12/06 06:56:54, henrika wrote: > Looks like great stuff Andrew; but first: how does ...
7 years ago (2013-12-06 06:59:09 UTC) #4
henrika (OOO until Aug 14)
Can you quantify it? Clipping, double-talk etc. Better in all areas perhaps. Sounds great in ...
7 years ago (2013-12-06 07:02:26 UTC) #5
ajm
On 2013/12/06 07:02:26, henrika wrote: > Can you quantify it? Clipping, double-talk etc. Better in ...
7 years ago (2013-12-06 07:15:23 UTC) #6
tommi (sloooow) - chröme
Exciting stuff! https://codereview.chromium.org/99033003/diff/60001/content/renderer/media/media_stream_dependency_factory.cc File content/renderer/media/media_stream_dependency_factory.cc (right): https://codereview.chromium.org/99033003/diff/60001/content/renderer/media/media_stream_dependency_factory.cc#newcode99 content/renderer/media/media_stream_dependency_factory.cc:99: void TransferConstraintToPlatformEffect(RTCMediaConstraints* constraints, Please document all the ...
7 years ago (2013-12-06 12:11:33 UTC) #7
henrika (OOO until Aug 14)
Cool, but is rather amazing how many files that must be affected for simply turning ...
7 years ago (2013-12-06 12:52:21 UTC) #8
ajm
Responses to Java comments. https://codereview.chromium.org/99033003/diff/60001/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java File media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java (right): https://codereview.chromium.org/99033003/diff/60001/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java#newcode391 media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java:391: public static boolean isPlatformAECSupported() { ...
7 years ago (2013-12-06 19:06:43 UTC) #9
Ami GONE FROM CHROMIUM
Agree w/ other reviewer comments where not commented on them. To avoid piling on will ...
7 years ago (2013-12-06 19:22:52 UTC) #10
Ami GONE FROM CHROMIUM
On Fri, Dec 6, 2013 at 11:06 AM, <ajm@chromium.org> wrote: > https://codereview.chromium.org/99033003/diff/60001/media/ > base/android/java/src/org/chromium/media/AudioRecordInput.java#newcode188 > ...
7 years ago (2013-12-06 19:24:47 UTC) #11
ajm
https://codereview.chromium.org/99033003/diff/60001/content/renderer/media/webrtc_audio_capturer.h File content/renderer/media/webrtc_audio_capturer.h (right): https://codereview.chromium.org/99033003/diff/60001/content/renderer/media/webrtc_audio_capturer.h#newcode59 content/renderer/media/webrtc_audio_capturer.h:59: bool use_platform_aec); On 2013/12/06 19:22:53, Ami Fischman wrote: > ...
7 years ago (2013-12-06 19:31:23 UTC) #12
ajm
On 2013/12/06 19:24:47, Ami Fischman wrote: > On Fri, Dec 6, 2013 at 11:06 AM, ...
7 years ago (2013-12-06 19:32:02 UTC) #13
henrika (OOO until Aug 14)
I can't wait to try it out. Great description, clean code and nice structure. The ...
7 years ago (2013-12-06 22:51:57 UTC) #14
ajm
Dale, could you have a look at the new PlatformEffects member in AudioParameters? Tommi thought ...
7 years ago (2013-12-10 06:37:15 UTC) #15
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, On 2013/12/10 06:37:16, ajm ...
7 years ago (2013-12-10 19:31:42 UTC) #16
ajm
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, On 2013/12/10 19:31:43, Ami ...
7 years ago (2013-12-10 20:13:04 UTC) #17
Ami GONE FROM CHROMIUM
Yes. On Tue, Dec 10, 2013 at 12:13 PM, <ajm@chromium.org> wrote: > > https://codereview.chromium.org/99033003/diff/60001/media/ > ...
7 years ago (2013-12-10 20:19:43 UTC) #18
tommi (sloooow) - chröme
OK with me too. I've got some minor comments on the way but won't be ...
7 years ago (2013-12-10 20:24:10 UTC) #19
DaleCurtis
Ah, AudioParameters is well on its way to becoming a generic data transport :-/ At ...
7 years ago (2013-12-11 00:08:47 UTC) #20
ajm
On 2013/12/11 00:08:47, DaleCurtis wrote: > Ah, AudioParameters is well on its way to becoming ...
7 years ago (2013-12-11 01:15:16 UTC) #21
Ami GONE FROM CHROMIUM
Are you really that sure that you won't want effects that take parameters? On Tue, ...
7 years ago (2013-12-11 01:21:15 UTC) #22
ajm
On 2013/12/11 01:21:15, Ami Fischman wrote: > Are you really that sure that you won't ...
7 years ago (2013-12-11 01:39:54 UTC) #23
DaleCurtis
I think it's already kind of iffy to add effects to AudioParameters, if you're going ...
7 years ago (2013-12-11 01:49:08 UTC) #24
ajm
On 2013/12/11 01:49:08, DaleCurtis wrote: > I think it's already kind of iffy to add ...
7 years ago (2013-12-11 02:10:52 UTC) #25
Ami GONE FROM CHROMIUM
On Tue, Dec 10, 2013 at 6:10 PM, <ajm@chromium.org> wrote: > Other reviewers: what do ...
7 years ago (2013-12-11 02:20:08 UTC) #26
ajm
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, Moved to setting through ...
7 years ago (2013-12-11 02:48:03 UTC) #27
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, On 2013/12/11 02:48:04, ajm ...
7 years ago (2013-12-11 05:25:07 UTC) #28
henrika (OOO until Aug 14)
> Other reviewers: what do you think? > Defer to Dale. Andrew, forgot to ask: ...
7 years ago (2013-12-11 08:24:22 UTC) #29
tommi (sloooow) - chröme
lgtm. sorry for the delay yesterday. I've got one request for the "reconcile" methods since ...
7 years ago (2013-12-11 12:14:36 UTC) #30
ajm
On 2013/12/11 08:24:22, henrika wrote: > > Other reviewers: what do you think? > > ...
7 years ago (2013-12-11 17:00:40 UTC) #31
ajm
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, On 2013/12/11 05:25:08, Ami ...
7 years ago (2013-12-11 17:46:48 UTC) #32
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, On 2013/12/11 17:46:49, ajm ...
7 years ago (2013-12-11 22:11:37 UTC) #33
Ami GONE FROM CHROMIUM
LGTM % nits (only did a pass on .java files since I realized that's what ...
7 years ago (2013-12-11 22:20:33 UTC) #34
ajm
Please take a look at... James: OWNER approval for minor change to renderer_webkitplatformsupport_impl.cc Jói: OWNER ...
7 years ago (2013-12-12 01:51:26 UTC) #35
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, On 2013/12/12 01:51:27, ajm ...
7 years ago (2013-12-12 02:01:19 UTC) #36
Ami GONE FROM CHROMIUM
LGTM for the java bits stands. https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ...
7 years ago (2013-12-12 02:29:32 UTC) #37
ajm
https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h File media/audio/audio_parameters.h (right): https://codereview.chromium.org/99033003/diff/60001/media/audio/audio_parameters.h#newcode59 media/audio/audio_parameters.h:59: void Reset(Format format, ChannelLayout channel_layout, On 2013/12/12 02:29:33, Ami ...
7 years ago (2013-12-12 03:36:02 UTC) #38
Jói
//content/public LGTM.
7 years ago (2013-12-12 11:05:20 UTC) #39
tommi (sloooow) - chröme
lgtm https://codereview.chromium.org/99033003/diff/240001/media/audio/android/audio_android_unittest.cc File media/audio/android/audio_android_unittest.cc (right): https://codereview.chromium.org/99033003/diff/240001/media/audio/android/audio_android_unittest.cc#newcode101 media/audio/android/audio_android_unittest.cc:101: AudioParameters::ECHO_CANCELLER); nit: it's not clear to me what ...
7 years ago (2013-12-12 12:05:31 UTC) #40
tommi (sloooow) - chröme
fwiw - I think it's OK to TBR the owners review for renderer_webkitplatformsupport_impl.cc.
7 years ago (2013-12-12 12:07:07 UTC) #41
ajm
Sorry about the rebase in patch set 11. I've modified: audio_android_unittest.cc audio_manager_mac.cc audio_manager_win.cc AudioManagerAndroid.java AudioRecordInput.java ...
7 years ago (2013-12-12 17:35:04 UTC) #42
tommi (sloooow) - chröme
Lgtm. Looking forward to hearing this is action! On Dec 12, 2013 6:35 PM, <ajm@chromium.org> ...
7 years ago (2013-12-12 17:46:00 UTC) #43
ajm
Justin, could you have a look at media_stream_messages.h for owner security approval?
7 years ago (2013-12-12 17:46:12 UTC) #44
jamesr
lgtm
7 years ago (2013-12-12 17:56:28 UTC) #45
DaleCurtis
AudioParameters lgtm
7 years ago (2013-12-12 20:30:15 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajm@chromium.org/99033003/320001
7 years ago (2013-12-12 22:44:28 UTC) #47
ajm
Justin, I TBR'd this to you as the change is trivial, but please let me ...
7 years ago (2013-12-12 22:50:54 UTC) #48
jschuh
ipc security lgtm: simple bitmask
7 years ago (2013-12-12 23:10:47 UTC) #49
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=235365
7 years ago (2013-12-13 05:12:05 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajm@chromium.org/99033003/320001
7 years ago (2013-12-13 05:46:01 UTC) #51
commit-bot: I haz the power
Change committed as 240548
7 years ago (2013-12-13 08:39:43 UTC) #52
no longer working on chromium
driven-by, I know this CL works with the use cases that you specified in the ...
6 years, 11 months ago (2013-12-30 14:55:55 UTC) #53
ajm
Thanks for having a look Shijing. https://codereview.chromium.org/99033003/diff/320001/content/renderer/media/media_stream_dependency_factory.cc File content/renderer/media/media_stream_dependency_factory.cc (right): https://codereview.chromium.org/99033003/diff/320001/content/renderer/media/media_stream_dependency_factory.cc#newcode382 content/renderer/media/media_stream_dependency_factory.cc:382: CreateLocalAudioSource(&constraints).get()); On 2013/12/30 ...
6 years, 11 months ago (2014-01-08 01:35:01 UTC) #54
henrika (OOO until Aug 14)
> Agreed, I believe we should update the constraints here as well. Tommi, Henrik, > ...
6 years, 11 months ago (2014-01-08 08:11:08 UTC) #55
tommi (sloooow) - chröme
6 years, 11 months ago (2014-01-09 15:33:15 UTC) #56
Message was sent while issue was closed.
https://codereview.chromium.org/99033003/diff/320001/content/renderer/media/m...
File content/renderer/media/media_stream_dependency_factory.cc (right):

https://codereview.chromium.org/99033003/diff/320001/content/renderer/media/m...
content/renderer/media/media_stream_dependency_factory.cc:745:
source_data->SetLocalAudioSource(CreateLocalAudioSource(constraints).get());
On 2014/01/08 01:35:02, ajm wrote:
> On 2013/12/30 14:55:56, xians1 wrote:
> > shouldn't you do the same thing for the case when using webaudio ?
> 
> Agreed, I believe we should update the constraints here as well. Tommi,
Henrik,
> can you confirm? 

Yes.  Ideally the constraints should be consistent all the way up to blink.  At
the moment though this is pretty broken but "harmless" since the constraints are
currently only checked at construction.  This will change though in the near
future, so good to be aware of.

Powered by Google App Engine
This is Rietveld 408576698