From 63da1dd9720533990842f1e0aa94bf8269c86ae4 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Fri, 6 Feb 2015 19:44:21 +0000 Subject: [PATCH] audio_processing: Now records mic volume level also when using new AGC Previously only mic level calculated by the legacy agc was logged in aecdebug dumps. Now we log it for any agc. In addition, it is now possible to turn on and off debug recording in the test tool voe_cmd_test. BUG=4274 TESTED=verified using voe_cmd_test R=andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/39839004 Cr-Commit-Position: refs/heads/master@{#8274} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8274 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../audio_processing/audio_processing_impl.cc | 2 +- .../voice_engine/test/cmd_test/voe_cmd_test.cc | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc index 7eeda111a1..1319e16962 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc @@ -591,7 +591,7 @@ int AudioProcessingImpl::ProcessStreamLocked() { audioproc::Stream* msg = event_msg_->mutable_stream(); msg->set_delay(stream_delay_ms_); msg->set_drift(echo_cancellation_->stream_drift_samples()); - msg->set_level(gain_control_->stream_analog_level()); + msg->set_level(gain_control()->stream_analog_level()); msg->set_keypress(key_pressed_); } #endif diff --git a/webrtc/voice_engine/test/cmd_test/voe_cmd_test.cc b/webrtc/voice_engine/test/cmd_test/voe_cmd_test.cc index 1155234b7b..454baffd28 100644 --- a/webrtc/voice_engine/test/cmd_test/voe_cmd_test.cc +++ b/webrtc/voice_engine/test/cmd_test/voe_cmd_test.cc @@ -233,6 +233,7 @@ void RunTest(std::string out_path) { bool muted = false; bool opus_stereo = false; bool experimental_ns_enabled = false; + bool debug_recording_started = false; #if defined(WEBRTC_ANDROID) std::string resource_path = "/sdcard/"; @@ -448,6 +449,7 @@ void RunTest(std::string out_path) { printf("%i. Set Opus maximum playback rate \n", option_index++); printf("%i. Set bit rate (only take effect on codecs that allow the " "change) \n", option_index++); + printf("%i. Toggle debug recording \n", option_index++); printf("Select action or %i to stop the call: ", option_index); int option_selection; @@ -778,11 +780,25 @@ void RunTest(std::string out_path) { ASSERT_EQ(1, scanf("%i", &cinst.rate)); res = codec->SetSendCodec(chan, cinst); VALIDATE; + } else if (option_selection == option_index++) { + const char* kDebugFileName = "audio.aecdump"; + if (debug_recording_started) { + apm->StopDebugRecording(); + printf("Debug recording named %s stopped\n", kDebugFileName); + } else { + apm->StartDebugRecording(kDebugFileName); + printf("Debug recording named %s started\n", kDebugFileName); + } + debug_recording_started = !debug_recording_started; } else { break; } } + if (debug_recording_started) { + apm->StopDebugRecording(); + } + if (send) { printf("Stop Send \n"); res = base1->StopSend(chan);