Improvements to AEC3 logging to simplify debugging

Adds log messages for
- AEC3 creation
- Transparent mode implementation selection
- Config parameter changes via RetrieveFieldTrialValue

Bug: webrtc:8671
Change-Id: Ibb1e76d66975a3a3c1227e31b9916a17b76e6c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219468
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34056}
This commit is contained in:
Gustaf Ullberg 2021-05-19 15:25:18 +02:00 committed by WebRTC LUCI CQ
parent aeb8ce882f
commit 398def6828
2 changed files with 18 additions and 2 deletions

View File

@ -49,7 +49,11 @@ void RetrieveFieldTrialValue(const char* trial_name,
ParseFieldTrial({&field_trial_param}, field_trial_str); ParseFieldTrial({&field_trial_param}, field_trial_str);
float field_trial_value = static_cast<float>(field_trial_param.Get()); float field_trial_value = static_cast<float>(field_trial_param.Get());
if (field_trial_value >= min && field_trial_value <= max) { if (field_trial_value >= min && field_trial_value <= max &&
field_trial_value != *value_to_update) {
RTC_LOG(LS_INFO) << "Key " << trial_name
<< " changing AEC3 parameter value from "
<< *value_to_update << " to " << field_trial_value;
*value_to_update = field_trial_value; *value_to_update = field_trial_value;
} }
} }
@ -65,7 +69,11 @@ void RetrieveFieldTrialValue(const char* trial_name,
ParseFieldTrial({&field_trial_param}, field_trial_str); ParseFieldTrial({&field_trial_param}, field_trial_str);
float field_trial_value = field_trial_param.Get(); float field_trial_value = field_trial_param.Get();
if (field_trial_value >= min && field_trial_value <= max) { if (field_trial_value >= min && field_trial_value <= max &&
field_trial_value != *value_to_update) {
RTC_LOG(LS_INFO) << "Key " << trial_name
<< " changing AEC3 parameter value from "
<< *value_to_update << " to " << field_trial_value;
*value_to_update = field_trial_value; *value_to_update = field_trial_value;
} }
} }
@ -737,6 +745,10 @@ EchoCanceller3::EchoCanceller3(const EchoCanceller3Config& config,
std::vector<std::vector<rtc::ArrayView<float>>>( std::vector<std::vector<rtc::ArrayView<float>>>(
1, std::vector<rtc::ArrayView<float>>(num_capture_channels_)); 1, std::vector<rtc::ArrayView<float>>(num_capture_channels_));
} }
RTC_LOG(LS_INFO) << "AEC3 created with sample rate: " << sample_rate_hz_
<< " Hz, num render channels: " << num_render_channels_
<< ", num capture channels: " << num_capture_channels_;
} }
EchoCanceller3::~EchoCanceller3() = default; EchoCanceller3::~EchoCanceller3() = default;

View File

@ -11,6 +11,7 @@
#include "modules/audio_processing/aec3/transparent_mode.h" #include "modules/audio_processing/aec3/transparent_mode.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/field_trial.h" #include "system_wrappers/include/field_trial.h"
namespace webrtc { namespace webrtc {
@ -228,11 +229,14 @@ class LegacyTransparentModeImpl : public TransparentMode {
std::unique_ptr<TransparentMode> TransparentMode::Create( std::unique_ptr<TransparentMode> TransparentMode::Create(
const EchoCanceller3Config& config) { const EchoCanceller3Config& config) {
if (config.ep_strength.bounded_erl || DeactivateTransparentMode()) { if (config.ep_strength.bounded_erl || DeactivateTransparentMode()) {
RTC_LOG(LS_INFO) << "AEC3 Transparent Mode: Disabled";
return nullptr; return nullptr;
} }
if (ActivateTransparentModeHmm()) { if (ActivateTransparentModeHmm()) {
RTC_LOG(LS_INFO) << "AEC3 Transparent Mode: HMM";
return std::make_unique<TransparentModeImpl>(); return std::make_unique<TransparentModeImpl>();
} }
RTC_LOG(LS_INFO) << "AEC3 Transparent Mode: Legacy";
return std::make_unique<LegacyTransparentModeImpl>(config); return std::make_unique<LegacyTransparentModeImpl>(config);
} }