Commit 740b70c7 authored by Sylvain Berfini's avatar Sylvain Berfini

Added more logs to enable hardware aec for Android

parent 4d8d2e4f
......@@ -343,8 +343,11 @@ static void android_snd_read_activate_hardware_aec(MSFilter *obj){
AndroidSndReadData *ad=(AndroidSndReadData*)obj->data;
JNIEnv *env=ms_get_jni_env();
int sessionId=ad->rec->getSessionId();
ms_message("AudioRecord.getAudioSessionId() returned %i", sessionId);
if (sessionId==-1) return;
if (sessionId==-1) {
return;
}
ad->aec = enable_hardware_echo_canceller(env, sessionId);
}
......
......@@ -451,7 +451,10 @@ static void sound_read_preprocess(MSFilter *f){
return;
}
sessionId = env->CallIntMethod(d->audio_record,getsession_id);
if (sessionId==-1) return;
ms_message("AudioRecord.getAudioSessionId() returned %i", sessionId);
if (sessionId==-1) {
return;
}
d->aec = enable_hardware_echo_canceller(env, sessionId);
}
}
......
......@@ -24,6 +24,7 @@ jobject enable_hardware_echo_canceller(JNIEnv *env, int sessionId) {
jobject aec = NULL;
jclass aecClass = env->FindClass("android/media/audiofx/AcousticEchoCanceler");
if (aecClass==NULL){
ms_error("Couldn't find android/media/audiofx/AcousticEchoCanceler class !");
env->ExceptionClear(); //very important.
return NULL;
}
......@@ -53,17 +54,25 @@ jobject enable_hardware_echo_canceller(JNIEnv *env, int sessionId) {
} else {
ms_message("AcousticEchoCanceler enabled");
}
} else {
ms_warning("AcousticEchoCanceler already enabled");
}
} else {
ms_error("Couldn't find either getEnabled or setEnabled method in AudioEffect class for AcousticEchoCanceler !");
}
env->DeleteLocalRef(effectClass);
} else {
ms_error("Couldn't find android/media/audiofx/AudioEffect class !");
}
}else{
ms_error("Failed to create AcousticEchoCanceler.");
ms_error("Failed to create AcousticEchoCanceler !");
}
}else{
ms_error("create() not found in class AcousticEchoCanceler !");
env->ExceptionClear(); //very important.
}
} else {
ms_error("AcousticEchoCanceler isn't available !");
}
}else{
ms_error("isAvailable() not found in class AcousticEchoCanceler !");
......
......@@ -32,7 +32,7 @@
#ifdef ANDROID
static SoundDeviceDescription devices[]={
{ "HTC", "Nexus One", "qsd8k", 0, 300 },
{ "HTC", "HTC One X", "tegra", 0, 150 }, /*has a very good acoustic isolation, which result in calibration saying no echo. */
{ "HTC", "HTC One X", "tegra", 1, 0 }, /*has a very good acoustic isolation, which result in calibration saying no echo. */
/*/But with speaker mode there is a strong echo if software ec is disabled.*/
{ "HTC", "HTC One SV", "msm8960", 0, 200 },
{ "HTC", "HTC Desire", "", 0, 250 },
......
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