diff --git a/sdk/android/api/org/webrtc/audio/JavaAudioDeviceModule.java b/sdk/android/api/org/webrtc/audio/JavaAudioDeviceModule.java index 9f644c337c..93e8ba550e 100644 --- a/sdk/android/api/org/webrtc/audio/JavaAudioDeviceModule.java +++ b/sdk/android/api/org/webrtc/audio/JavaAudioDeviceModule.java @@ -53,6 +53,7 @@ public class JavaAudioDeviceModule implements AudioDeviceModule { * return invalid results. */ public Builder setSampleRate(int sampleRate) { + Logging.d(TAG, "Sample rate overridden to: " + sampleRate); this.sampleRate = sampleRate; return this; } @@ -96,7 +97,7 @@ public class JavaAudioDeviceModule implements AudioDeviceModule { */ public Builder setUseHardwareNoiseSuppressor(boolean useHardwareNoiseSuppressor) { if (useHardwareNoiseSuppressor && !isBuiltInNoiseSuppressorSupported()) { - Logging.e(TAG, "HW noise suppressor not supported"); + Logging.e(TAG, "HW NS not supported"); useHardwareNoiseSuppressor = false; } this.useHardwareNoiseSuppressor = useHardwareNoiseSuppressor; @@ -110,7 +111,7 @@ public class JavaAudioDeviceModule implements AudioDeviceModule { */ public Builder setUseHardwareAcousticEchoCanceler(boolean useHardwareAcousticEchoCanceler) { if (useHardwareAcousticEchoCanceler && !isBuiltInAcousticEchoCancelerSupported()) { - Logging.e(TAG, "HW acoustic echo canceler not supported"); + Logging.e(TAG, "HW AEC not supported"); useHardwareAcousticEchoCanceler = false; } this.useHardwareAcousticEchoCanceler = useHardwareAcousticEchoCanceler; @@ -138,6 +139,23 @@ public class JavaAudioDeviceModule implements AudioDeviceModule { * and is responsible for calling release(). */ public AudioDeviceModule createAudioDeviceModule() { + Logging.d(TAG, "createAudioDeviceModule"); + if (useHardwareNoiseSuppressor) { + Logging.d(TAG, "HW NS will be used."); + } else { + if (isBuiltInNoiseSuppressorSupported()) { + Logging.d(TAG, "Overriding default behavior; now using WebRTC NS!"); + } + Logging.d(TAG, "HW NS will not be used."); + } + if (useHardwareAcousticEchoCanceler) { + Logging.d(TAG, "HW AEC will be used."); + } else { + if (isBuiltInAcousticEchoCancelerSupported()) { + Logging.d(TAG, "Overriding default behavior; now using WebRTC AEC!"); + } + Logging.d(TAG, "HW AEC will not be used."); + } final WebRtcAudioRecord audioInput = new WebRtcAudioRecord(context, audioManager, audioSource, audioRecordErrorCallback, samplesReadyCallback, useHardwareAcousticEchoCanceler, useHardwareNoiseSuppressor); @@ -278,11 +296,13 @@ public class JavaAudioDeviceModule implements AudioDeviceModule { @Override public void setSpeakerMute(boolean mute) { + Logging.d(TAG, "setSpeakerMute: " + mute); audioOutput.setSpeakerMute(mute); } @Override public void setMicrophoneMute(boolean mute) { + Logging.d(TAG, "setMicrophoneMute: " + mute); audioInput.setMicrophoneMute(mute); } diff --git a/sdk/android/native_api/audio_device_module/audio_device_android.cc b/sdk/android/native_api/audio_device_module/audio_device_android.cc index e3602779cd..cf738d01ee 100644 --- a/sdk/android/native_api/audio_device_module/audio_device_android.cc +++ b/sdk/android/native_api/audio_device_module/audio_device_android.cc @@ -51,6 +51,7 @@ void GetDefaultAudioParameters(JNIEnv* env, rtc::scoped_refptr CreateAAudioAudioDeviceModule( JNIEnv* env, jobject application_context) { + RTC_LOG(INFO) << __FUNCTION__; // Get default audio input/output parameters. AudioParameters input_parameters; AudioParameters output_parameters; @@ -69,6 +70,7 @@ rtc::scoped_refptr CreateAAudioAudioDeviceModule( rtc::scoped_refptr CreateJavaAudioDeviceModule( JNIEnv* env, jobject application_context) { + RTC_LOG(INFO) << __FUNCTION__; // Get default audio input/output parameters. const JavaParamRef j_context(application_context); const ScopedJavaLocalRef j_audio_manager = @@ -97,6 +99,7 @@ rtc::scoped_refptr CreateJavaAudioDeviceModule( rtc::scoped_refptr CreateOpenSLESAudioDeviceModule( JNIEnv* env, jobject application_context) { + RTC_LOG(INFO) << __FUNCTION__; // Get default audio input/output parameters. AudioParameters input_parameters; AudioParameters output_parameters; @@ -118,6 +121,7 @@ rtc::scoped_refptr CreateOpenSLESAudioDeviceModule( rtc::scoped_refptr CreateJavaInputAndOpenSLESOutputAudioDeviceModule(JNIEnv* env, jobject application_context) { + RTC_LOG(INFO) << __FUNCTION__; // Get default audio input/output parameters. const JavaParamRef j_context(application_context); const ScopedJavaLocalRef j_audio_manager = diff --git a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java index b7c750c528..77aec83bcc 100644 --- a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java +++ b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioEffects.java @@ -51,8 +51,6 @@ class WebRtcAudioEffects { // Affects the final state given to the setEnabled() method on each effect. // The default state is set to "disabled" but each effect can also be enabled // by calling setAEC() and setNS(). - // To enable an effect, both the shouldEnableXXX member and the static - // canUseXXX() must be true. private boolean shouldEnableAec = false; private boolean shouldEnableNs = false; diff --git a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java index 06be99f72b..3bf51df310 100644 --- a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java +++ b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java @@ -188,13 +188,13 @@ class WebRtcAudioRecord { @CalledByNative private boolean enableBuiltInAEC(boolean enable) { - Logging.d(TAG, "enableBuiltInAEC(" + enable + ')'); + Logging.d(TAG, "enableBuiltInAEC(" + enable + ")"); return effects.setAEC(enable); } @CalledByNative private boolean enableBuiltInNS(boolean enable) { - Logging.d(TAG, "enableBuiltInNS(" + enable + ')'); + Logging.d(TAG, "enableBuiltInNS(" + enable + ")"); return effects.setNS(enable); } diff --git a/sdk/android/src/jni/audio_device/audio_device_module.cc b/sdk/android/src/jni/audio_device/audio_device_module.cc index 0176dcdb02..5c10c33883 100644 --- a/sdk/android/src/jni/audio_device/audio_device_module.cc +++ b/sdk/android/src/jni/audio_device/audio_device_module.cc @@ -626,6 +626,7 @@ rtc::scoped_refptr CreateAudioDeviceModuleFromInputAndOutput( uint16_t playout_delay_ms, std::unique_ptr audio_input, std::unique_ptr audio_output) { + RTC_LOG(INFO) << __FUNCTION__; return new rtc::RefCountedObject( audio_layer, is_stereo_playout_supported, is_stereo_record_supported, playout_delay_ms, std::move(audio_input), std::move(audio_output));