Commit 2be76be2 authored by Per Åhgren's avatar Per Åhgren Committed by Commit Bot

Activating 48 kHz processing support in the audio processing module for ARM

On ARM devices, WebRTC always performs the audio processing at a maximum
of 32 kHz. The reason for this is that previously the 48 kHz splitting
filters used caused issues related to CPU-performance on ARM. This has
now been addressed and this CL activates 48 kHz processing at 32 kHz.

The CL also adds a kill-switch that can be used to turn off this support
for ARM devices, in case it would turn out to be an issue.

Bug: webrtc:6181
Change-Id: I3c31d6d1724a784e56391def673a3d7140ece457
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404921
Commit-Queue: Olga Sharonova <olka@chromium.org>
Reviewed-by: default avatarOlga Sharonova <olka@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806193}
parent 479b1030
......@@ -26,6 +26,12 @@ namespace features {
const base::Feature kWebRtcEnableCaptureMultiChannelApm{
"WebRtcEnableCaptureMultiChannelApm", base::FEATURE_DISABLED_BY_DEFAULT};
// Kill-switch allowing deactivation of the support for 48 kHz internal
// processing in the WebRTC audio processing module when running on an ARM
// platform.
const base::Feature kWebRtcAllow48kHzProcessingOnArm{
"WebRtcAllow48kHzProcessingOnArm", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables the WebRTC Agc2 digital adaptation with WebRTC Agc1 analog
// adaptation. Feature for http://crbug.com/873650. Is sent to WebRTC.
const base::Feature kWebRtcHybridAgc{"WebRtcHybridAgc",
......
......@@ -21,6 +21,9 @@ namespace features {
COMPONENT_EXPORT(MEDIA_WEBRTC)
extern const base::Feature kWebRtcEnableCaptureMultiChannelApm;
COMPONENT_EXPORT(MEDIA_WEBRTC)
extern const base::Feature kWebRtcAllow48kHzProcessingOnArm;
COMPONENT_EXPORT(MEDIA_WEBRTC)
extern const base::Feature kWebRtcHybridAgc;
......
......@@ -67,6 +67,11 @@ bool UseMultiChannelCaptureProcessing() {
features::kWebRtcEnableCaptureMultiChannelApm);
}
bool Allow48kHzApmProcessing() {
return base::FeatureList::IsEnabled(
features::kWebRtcAllow48kHzProcessingOnArm);
}
constexpr int kAudioProcessingNumberOfChannels = 1;
constexpr int kBuffersPerSecond = 100; // 10 ms per buffer.
......@@ -603,6 +608,12 @@ void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
blink::EnableTypingDetection(&apm_config, typing_detector_.get());
}
// Ensure that 48 kHz APM processing is always active. This overrules the
// default setting in WebRTC of 32 kHz for ARM platforms.
if (Allow48kHzApmProcessing()) {
apm_config.pipeline.maximum_internal_processing_rate = 48000;
}
apm_config.residual_echo_detector.enabled = false;
audio_processing_->ApplyConfig(apm_config);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment