Merge "Revert "Revert "Revert "hal: enable form factor based configuration"""" into nyc-dev
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index a4ea34c..ae65409 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -676,9 +676,36 @@
return 0;
}
- ALOGV("%s: out_snd_device(%d: %s) in_snd_device(%d: %s)", __func__,
- out_snd_device, platform_get_snd_device_name(out_snd_device),
- in_snd_device, platform_get_snd_device_name(in_snd_device));
+ if (out_snd_device != SND_DEVICE_NONE &&
+ out_snd_device != adev->last_logged_snd_device[uc_id][0]) {
+ ALOGD("%s: changing use case %s output device from(%d: %s, acdb %d) to (%d: %s, acdb %d)",
+ __func__,
+ use_case_table[uc_id],
+ adev->last_logged_snd_device[uc_id][0],
+ platform_get_snd_device_name(adev->last_logged_snd_device[uc_id][0]),
+ adev->last_logged_snd_device[uc_id][0] != SND_DEVICE_NONE ?
+ platform_get_snd_device_acdb_id(adev->last_logged_snd_device[uc_id][0]) :
+ -1,
+ out_snd_device,
+ platform_get_snd_device_name(out_snd_device),
+ platform_get_snd_device_acdb_id(out_snd_device));
+ adev->last_logged_snd_device[uc_id][0] = out_snd_device;
+ }
+ if (in_snd_device != SND_DEVICE_NONE &&
+ in_snd_device != adev->last_logged_snd_device[uc_id][1]) {
+ ALOGD("%s: changing use case %s input device from(%d: %s, acdb %d) to (%d: %s, acdb %d)",
+ __func__,
+ use_case_table[uc_id],
+ adev->last_logged_snd_device[uc_id][1],
+ platform_get_snd_device_name(adev->last_logged_snd_device[uc_id][1]),
+ adev->last_logged_snd_device[uc_id][1] != SND_DEVICE_NONE ?
+ platform_get_snd_device_acdb_id(adev->last_logged_snd_device[uc_id][1]) :
+ -1,
+ in_snd_device,
+ platform_get_snd_device_name(in_snd_device),
+ platform_get_snd_device_acdb_id(in_snd_device));
+ adev->last_logged_snd_device[uc_id][1] = in_snd_device;
+ }
/*
* Limitation: While in call, to do a device switch we need to disable
@@ -867,7 +894,7 @@
error_config:
adev->active_input = NULL;
- ALOGV("%s: exit: status(%d)", __func__, ret);
+ ALOGW("%s: exit: status(%d)", __func__, ret);
return ret;
}
@@ -2387,7 +2414,7 @@
error_open:
free(out);
*stream_out = NULL;
- ALOGV("%s: exit: ret %d", __func__, ret);
+ ALOGW("%s: exit: ret %d", __func__, ret);
return ret;
}
@@ -2554,7 +2581,7 @@
pthread_mutex_lock(&adev->lock);
if (adev->mode != mode) {
- ALOGV("%s: mode %d\n", __func__, mode);
+ ALOGD("%s: mode %d", __func__, (int)mode);
adev->mode = mode;
if ((mode == AUDIO_MODE_NORMAL || mode == AUDIO_MODE_IN_COMMUNICATION) &&
voice_is_in_call(adev)) {
@@ -2574,7 +2601,7 @@
int ret;
struct audio_device *adev = (struct audio_device *)dev;
- ALOGV("%s: state %d\n", __func__, state);
+ ALOGD("%s: state %d", __func__, (int)state);
pthread_mutex_lock(&adev->lock);
ret = voice_set_mic_mute(adev, state);
adev->mic_muted = state;
@@ -2908,7 +2935,7 @@
{
int i, ret;
- ALOGV("%s: enter", __func__);
+ ALOGD("%s: enter", __func__);
if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0) return -EINVAL;
pthread_mutex_lock(&adev_init_lock);
if (audio_device_ref_count != 0) {
@@ -3062,7 +3089,7 @@
audio_extn_perf_lock_init();
- ALOGV("%s: exit", __func__);
+ ALOGD("%s: exit", __func__);
return 0;
}
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 0fc26ff..261e547 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -281,6 +281,10 @@
adm_deregister_stream_t adm_deregister_stream;
adm_request_focus_t adm_request_focus;
adm_abandon_focus_t adm_abandon_focus;
+
+ /* logging */
+ snd_device_t last_logged_snd_device[AUDIO_USECASE_MAX][2]; /* [out, in] */
+
};
int select_devices(struct audio_device *adev,
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 49e6801..d0260f5 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -489,7 +489,7 @@
int mccmnc;
property_get("gsm.sim.operator.numeric",value,"0");
mccmnc = atoi(value);
- ALOGV("%s: tmus mccmnc %d", __func__, mccmnc);
+ ALOGD("%s: tmus mccmnc %d", __func__, mccmnc);
switch(mccmnc) {
/* TMUS MCC(310), MNC(490, 260, 026) */
case 310490:
@@ -832,7 +832,7 @@
goto done;
}
- ALOGV("%s: num_modems %d\n", __func__, modems);
+ ALOGD("%s: num_modems %d\n", __func__, modems);
if (modems > 0)
my_data->csd = open_csd_client(false /*is_i2s_ext_modem*/);
@@ -1017,7 +1017,7 @@
goto init_failed;
}
adev->snd_card = snd_card_num;
- ALOGV("%s: Opened sound card:%d", __func__, snd_card_num);
+ ALOGD("%s: Opened sound card:%d", __func__, snd_card_num);
break;
}
@@ -1359,7 +1359,7 @@
list_add_tail(operator_specific_device_table[snd_device], &device->list);
- ALOGV("%s : deivce[%s] -> operator[%s] mixer_path[%s] acdb_id [%d]", __func__,
+ ALOGD("%s: device[%s] -> operator[%s] mixer_path[%s] acdb_id[%d]", __func__,
platform_get_snd_device_name(snd_device), operator, mixer_path, acdb_id);
}