summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreetam Singh Ranawat <apranawat@codeaurora.org>2014-11-19 16:00:42 +0530
committerSteve Kondik <steve@cyngn.com>2014-12-23 22:49:46 -0800
commitd175695426ef0fc4a772287d507ee827d991ea6b (patch)
tree533071e71b308d21b956d6b6b9970f2739de0397
parentd9387d2bd26b7c13db49362cad8d9a0b649de853 (diff)
downloadandroid_hardware_qcom_audio-d175695426ef0fc4a772287d507ee827d991ea6b.tar.gz
android_hardware_qcom_audio-d175695426ef0fc4a772287d507ee827d991ea6b.tar.bz2
android_hardware_qcom_audio-d175695426ef0fc4a772287d507ee827d991ea6b.zip
hal : Overwrite the APP type for PCM RX and TX path
-For all the rx/tx sessions hal sends the default app type 'general playback' with acdb cal data if output policy conf file is not added.So it sets the SA+ topo id for POPP. -With output policy conf file it would create the multiple instance of COPP for different output with different app type, which is not recommended for resource constrained target.So we can not add the output policy conf file with different app types to avoid SA+. -Overwrite the app type for PCM Rx and Tx path to avoid setting SA+ for POPP. Change-Id: I1a3e0cbb01360e4d2e7b0ba0ecf8a1bee7fecda7
-rw-r--r--hal/audio_extn/utils.c4
-rw-r--r--hal/msm8916/platform.c28
-rw-r--r--hal/msm8960/platform.c12
-rw-r--r--hal/msm8974/platform.c12
-rw-r--r--hal/platform_api.h2
5 files changed, 49 insertions, 9 deletions
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index d364eb8f..35735b3f 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -567,13 +567,13 @@ void audio_extn_utils_send_audio_calibration(struct audio_device *adev,
int snd_device = usecase->out_snd_device;
snd_device = (snd_device == SND_DEVICE_OUT_SPEAKER) ?
audio_extn_get_spkr_prot_snd_device(snd_device) : snd_device;
- platform_send_audio_calibration(adev->platform, usecase->out_snd_device,
+ platform_send_audio_calibration(adev->platform, usecase,
out->app_type_cfg.app_type,
out->app_type_cfg.sample_rate);
}
if ((type == PCM_HFP_CALL) || (type == PCM_CAPTURE)) {
/* when app type is default. the sample rate is not used to send cal */
- platform_send_audio_calibration(adev->platform, usecase->in_snd_device,
+ platform_send_audio_calibration(adev->platform, usecase,
platform_get_default_app_type(adev->platform),
48000);
}
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 4841e626..2befa458 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -95,6 +95,8 @@
#define AUDIO_PARAMETER_KEY_SLOWTALK "st_enable"
#define AUDIO_PARAMETER_KEY_HD_VOICE "hd_voice"
#define AUDIO_PARAMETER_KEY_VOLUME_BOOST "volume_boost"
+#define APP_TYPE_SYSTEM_SOUNDS 0x00011131
+#define APP_TYPE_GENERAL_RECORDING 0x00011132
enum {
VOICE_FEATURE_SET_DEFAULT,
@@ -1126,13 +1128,35 @@ int platform_get_snd_device_bit_width(snd_device_t snd_device)
return backend_bit_width_table[snd_device];
}
-int platform_send_audio_calibration(void *platform, snd_device_t snd_device,
+int platform_send_audio_calibration(void *platform, struct audio_usecase *usecase,
int app_type, int sample_rate)
{
struct platform_data *my_data = (struct platform_data *)platform;
int acdb_dev_id, acdb_dev_type;
-
+ struct audio_device *adev = my_data->adev;
+ int snd_device = SND_DEVICE_OUT_SPEAKER;
+
+ if (usecase->type == PCM_PLAYBACK)
+ snd_device = platform_get_output_snd_device(adev->platform,
+ usecase->stream.out->devices);
+ else if ((usecase->type == PCM_HFP_CALL) || (usecase->type == PCM_CAPTURE))
+ snd_device = platform_get_input_snd_device(adev->platform,
+ adev->primary_output->devices);
acdb_dev_id = acdb_device_table[snd_device];
+
+
+ switch (usecase->id) {
+ case USECASE_AUDIO_PLAYBACK_DEEP_BUFFER:
+ app_type = APP_TYPE_SYSTEM_SOUNDS;
+ break;
+ case USECASE_AUDIO_PLAYBACK_LOW_LATENCY:
+ app_type = APP_TYPE_SYSTEM_SOUNDS;
+ break;
+ case USECASE_AUDIO_RECORD:
+ app_type = APP_TYPE_GENERAL_RECORDING;
+ break;
+ }
+
if (acdb_dev_id < 0) {
ALOGE("%s: Could not find acdb id for device(%d)",
__func__, snd_device);
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index 8ec88dba..6f955060 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -475,12 +475,20 @@ int platform_get_default_app_type(void *platform __unused)
return -ENOSYS;
}
-int platform_send_audio_calibration(void *platform, snd_device_t snd_device,
+int platform_send_audio_calibration(void *platform, struct audio_usecase *usecase,
int app_type __unused, int sample_rate __unused)
{
struct platform_data *my_data = (struct platform_data *)platform;
int acdb_dev_id, acdb_dev_type;
-
+ struct audio_device *adev = my_data->adev;
+ int snd_device = SND_DEVICE_OUT_SPEAKER;
+
+ if (usecase->type == PCM_PLAYBACK)
+ snd_device = platform_get_output_snd_device(adev->platform,
+ usecase->stream.out->devices);
+ else if ((usecase->type == PCM_HFP_CALL) || (usecase->type == PCM_CAPTURE))
+ snd_device = platform_get_input_snd_device(adev->platform,
+ adev->primary_output->devices);
acdb_dev_id = acdb_device_table[snd_device];
if (acdb_dev_id < 0) {
ALOGE("%s: Could not find acdb id for device(%d)",
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 37bc1c53..489a2062 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -1311,12 +1311,20 @@ int platform_get_snd_device_bit_width(snd_device_t snd_device)
return backend_bit_width_table[snd_device];
}
-int platform_send_audio_calibration(void *platform, snd_device_t snd_device,
+int platform_send_audio_calibration(void *platform, struct audio_usecase *usecase,
int app_type, int sample_rate)
{
struct platform_data *my_data = (struct platform_data *)platform;
int acdb_dev_id, acdb_dev_type;
-
+ struct audio_device *adev = my_data->adev;
+ int snd_device = SND_DEVICE_OUT_SPEAKER;
+
+ if (usecase->type == PCM_PLAYBACK)
+ snd_device = platform_get_output_snd_device(adev->platform,
+ usecase->stream.out->devices);
+ else if ((usecase->type == PCM_HFP_CALL) || (usecase->type == PCM_CAPTURE))
+ snd_device = platform_get_input_snd_device(adev->platform,
+ adev->primary_output->devices);
acdb_dev_id = acdb_device_table[audio_extn_get_spkr_prot_snd_device(snd_device)];
if (acdb_dev_id < 0) {
ALOGE("%s: Could not find acdb id for device(%d)",
diff --git a/hal/platform_api.h b/hal/platform_api.h
index ca524703..12d5e029 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -38,7 +38,7 @@ int platform_set_snd_device_acdb_id(snd_device_t snd_device, unsigned int acdb_i
int platform_get_snd_device_acdb_id(snd_device_t snd_device);
int platform_set_snd_device_bit_width(snd_device_t snd_device, unsigned int bit_width);
int platform_get_snd_device_bit_width(snd_device_t snd_device);
-int platform_send_audio_calibration(void *platform, snd_device_t snd_device,
+int platform_send_audio_calibration(void *platform, struct audio_usecase *usecase,
int app_type, int sample_rate);
int platform_get_default_app_type(void *platform);
int platform_switch_voice_call_device_pre(void *platform);