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

Issue 2051323002: Optimize the repeated calls to AudioEffect.queryEffects() on Android (Closed)

Created:
4 years, 6 months ago by skvlad
Modified:
4 years, 6 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, audio-team_agora.io, sdk-team_agora.io, peah-webrtc, Henrik Grunell WebRTC
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Optimize the repeated calls to AudioEffect.queryEffects() on Android This CL eliminates repeated calls to AudioEffect.queryEffects() on Android when configuring the audio device. Each of these calls was taking 5-10 milliseconds on the devices I was testing (Nexus 4, Nexus 5), and setting up the audio device involved around 10 of these calls. This change adds a method that checks the cached list of effects before calling the underlying operating system API; this eliminated about half of these calls. The other half happened inside static methods such as NoiseSuppressor.isAvailable(), which are just convenience wrappers for searching through the list of effects. These calls have been replaced with searching through the cached list of effects, reducing the time to configure audio processing effects from 60-80 ms to 5-10. This results in a similar improvement in call setup time. BUG= Committed: https://crrev.com/880ffeb6c00ab5898d06c7ff93af3fe3cf3f790c Cr-Commit-Position: refs/heads/master@{#13115}

Patch Set 1 : #

Total comments: 12

Patch Set 2 : Code review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -6 lines) Patch
M webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java View 1 7 chunks +68 lines, -6 lines 0 comments Download

Messages

Total messages: 19 (9 generated)
skvlad
Please take a look, this is a very small change that makes a noticeable improvement ...
4 years, 6 months ago (2016-06-09 22:59:49 UTC) #2
henrika_webrtc
Nice work Vladimir. Like how you figured out that isAvailable() was a wrapper that looped ...
4 years, 6 months ago (2016-06-10 07:33:20 UTC) #5
henrika_webrtc
LGTM with some comments. https://codereview.webrtc.org/2051323002/diff/40001/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java File webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java (right): https://codereview.webrtc.org/2051323002/diff/40001/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java#newcode47 webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java:47: // slow (~10ms) OS call ...
4 years, 6 months ago (2016-06-10 07:39:17 UTC) #6
henrika_webrtc
Moved grunell to CC list since he does not work in this area.
4 years, 6 months ago (2016-06-10 07:40:31 UTC) #9
skvlad
https://codereview.webrtc.org/2051323002/diff/40001/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java File webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java (right): https://codereview.webrtc.org/2051323002/diff/40001/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java#newcode47 webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java:47: // slow (~10ms) OS call multiple times. On 2016/06/10 ...
4 years, 6 months ago (2016-06-10 22:13:02 UTC) #10
henrika_webrtc
I think you can land this change as is without further review of pthatcher@.
4 years, 6 months ago (2016-06-13 07:42:07 UTC) #11
henrika_webrtc
https://codereview.webrtc.org/2051323002/diff/40001/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java File webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java (right): https://codereview.webrtc.org/2051323002/diff/40001/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java#newcode406 webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java:406: // queries the operating system for the list of ...
4 years, 6 months ago (2016-06-13 07:42:18 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051323002/60001
4 years, 6 months ago (2016-06-13 18:02:50 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:60001)
4 years, 6 months ago (2016-06-13 19:05:31 UTC) #17
commit-bot: I haz the power
4 years, 6 months ago (2016-06-13 19:05:39 UTC) #19
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/880ffeb6c00ab5898d06c7ff93af3fe3cf3f790c
Cr-Commit-Position: refs/heads/master@{#13115}

Powered by Google App Engine
This is Rietveld 408576698