summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Kumar Alamanda <ralama@codeaurora.org>2015-06-08 16:44:05 -0700
committerSteve Kondik <steve@cyngn.com>2016-05-09 13:15:56 -0700
commit68f3ab17b3001585e72a3471a6b4ed551202ab2a (patch)
tree2f12597a748a43959a0a3ad1a9f19d32e173e386
parentc2a55621b68f06284a6a5990771e31e1df7bfd05 (diff)
downloadhardware_qcom_audio-68f3ab17b3001585e72a3471a6b4ed551202ab2a.tar.gz
hardware_qcom_audio-68f3ab17b3001585e72a3471a6b4ed551202ab2a.tar.bz2
hardware_qcom_audio-68f3ab17b3001585e72a3471a6b4ed551202ab2a.zip
hal: update combo device handling
If the wired headset/headphone/line devices are handled by a different backend than speaker/earpiece devices, the combo devices such as speaker+headphones can be split into individual devices and enabled/disabled independently. Bug: 21581860. Change-Id: Icdd962a4dc1da536fe89c4de2202e7383275603d hal: fix backend check routine for combo device If there is path change between combo device and general device that shares backend, previous device should be disabled before the new device is enabled. Otherwise, by the race conditio, the new device would be disabled by previous combo device For example, when the previous device is 'speaker-and-headphone' and the new devcie is 'voice-headphones', there is possibility that 'voice-headphones' get mute by disabling 'speaker-and-headphone'. BUG=23916345 Change-Id: I765b3c0b6576f22c4aca290846d58dd1c6dfb8c5 hal msm8974: fix logic in platform_check_backends_match(). Fix logic error in if() condition in commit 9af4b91 "hal: fix backend check routine for combo device" BUG: 23916345 Change-Id: I587dd157ba34cad5f539d88e8161750f3e2b32c7
-rw-r--r--hal/audio_extn/spkr_protection.c3
-rw-r--r--hal/audio_hw.c27
-rw-r--r--hal/msm8916/platform.c3
-rw-r--r--hal/msm8960/platform.c22
-rw-r--r--hal/msm8974/platform.c158
-rw-r--r--hal/msm8974/platform.h6
-rw-r--r--hal/platform_api.h10
-rw-r--r--hal/platform_info.c11
8 files changed, 193 insertions, 47 deletions
diff --git a/hal/audio_extn/spkr_protection.c b/hal/audio_extn/spkr_protection.c
index a8c2ccc5..ae07fd8c 100644
--- a/hal/audio_extn/spkr_protection.c
+++ b/hal/audio_extn/spkr_protection.c
@@ -767,7 +767,8 @@ void audio_extn_spkr_prot_init(void *adev)
property_get("ro.board.platform", platform, "");
if (!strncmp("apq8084", platform, sizeof("apq8084"))) {
platform_set_snd_device_backend(SND_DEVICE_OUT_VOICE_SPEAKER,
- "speaker-protected");
+ "speaker-protected",
+ "SLIMBUS_0_RX");
}
}
}
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 10ed1a63..fc72b166 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -587,6 +587,8 @@ int enable_snd_device(struct audio_device *adev,
snd_device_t snd_device)
{
char device_name[DEVICE_NAME_MAX_SIZE] = {0};
+ int i, num_devices = 0;
+ snd_device_t new_snd_devices[2];
if (snd_device < SND_DEVICE_MIN ||
snd_device >= SND_DEVICE_MAX) {
@@ -630,6 +632,10 @@ int enable_snd_device(struct audio_device *adev,
audio_extn_dev_arbi_release(snd_device);
return -EINVAL;
}
+ } else if (platform_can_split_snd_device(snd_device, &num_devices, new_snd_devices)) {
+ for (i = 0; i < num_devices; i++) {
+ enable_snd_device(adev, new_snd_devices[i]);
+ }
} else {
ALOGD("%s: snd_device(%d: %s)", __func__, snd_device, device_name);
/* due to the possibility of calibration overwrite between listen
@@ -657,6 +663,8 @@ int disable_snd_device(struct audio_device *adev,
snd_device_t snd_device)
{
char device_name[DEVICE_NAME_MAX_SIZE] = {0};
+ int i, num_devices = 0;
+ snd_device_t new_snd_devices[2];
if (snd_device < SND_DEVICE_MIN ||
snd_device >= SND_DEVICE_MAX) {
@@ -690,6 +698,10 @@ int disable_snd_device(struct audio_device *adev,
snd_device == SND_DEVICE_OUT_VOICE_SPEAKER) &&
audio_extn_spkr_prot_is_enabled()) {
audio_extn_spkr_prot_stop_processing(snd_device);
+ } else if (platform_can_split_snd_device(snd_device, &num_devices, new_snd_devices)) {
+ for (i = 0; i < num_devices; i++) {
+ disable_snd_device(adev, new_snd_devices[i]);
+ }
} else {
audio_route_reset_and_update_path(adev->audio_route, device_name);
amplifier_enable_devices(snd_device, false);
@@ -705,9 +717,9 @@ int disable_snd_device(struct audio_device *adev,
return 0;
}
-static void check_usecases_codec_backend(struct audio_device *adev,
- struct audio_usecase *uc_info,
- snd_device_t snd_device)
+static void check_and_route_playback_usecases(struct audio_device *adev,
+ struct audio_usecase *uc_info,
+ snd_device_t snd_device)
{
struct listnode *node;
struct audio_usecase *usecase;
@@ -743,7 +755,8 @@ static void check_usecases_codec_backend(struct audio_device *adev,
if (usecase->type != PCM_CAPTURE &&
usecase != uc_info &&
(usecase->out_snd_device != snd_device || force_routing) &&
- usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) {
+ usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND &&
+ platform_check_backends_match(snd_device, usecase->out_snd_device)) {
ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
__func__, use_case_table[usecase->id],
platform_get_snd_device_name(usecase->out_snd_device));
@@ -953,7 +966,7 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
* so that it would not result any device switch. All the usecases will
* be switched to new device when select_devices() is called for voice call
* usecase. This is to avoid switching devices for voice call when
- * check_usecases_codec_backend() is called below.
+ * check_and_route_playback_usecases() is called below.
*/
if (voice_is_in_call(adev) && adev->mode == AUDIO_MODE_IN_CALL) {
vc_usecase = get_usecase_from_list(adev,
@@ -1065,7 +1078,7 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
/* Enable new sound devices */
if (out_snd_device != SND_DEVICE_NONE) {
if (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND)
- check_usecases_codec_backend(adev, usecase, out_snd_device);
+ check_and_route_playback_usecases(adev, usecase, out_snd_device);
enable_snd_device(adev, out_snd_device);
}
@@ -2058,7 +2071,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
/*
* select_devices() call below switches all the usecases on the same
- * backend to the new device. Refer to check_usecases_codec_backend() in
+ * backend to the new device. Refer to check_and_route_playback_usecases() in
* the select_devices(). But how do we undo this?
*
* For example, music playback is active on headset (deep-buffer usecase)
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 3da16e17..9bdfb8c9 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -2627,7 +2627,8 @@ int platform_set_usecase_pcm_id(audio_usecase_t usecase __unused, int32_t type _
}
int platform_set_snd_device_backend(snd_device_t snd_device __unused,
- const char * backend __unused)
+ const char * backend __unused,
+ const char * hw_interface __unused)
{
return -ENOSYS;
}
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index 1659061d..883a8a7e 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -1059,7 +1059,8 @@ int platform_set_usecase_pcm_id(audio_usecase_t usecase __unused, int32_t type _
}
int platform_set_snd_device_backend(snd_device_t snd_device __unused,
- const char * backend __unused)
+ const char * backend __unused,
+ const char * hw_interface __unused)
{
return -ENOSYS;
}
@@ -1156,3 +1157,22 @@ int platform_set_snd_device_name(snd_device_t snd_device __unused,
{
return -ENOSYS;
}
+
+bool platform_send_gain_dep_cal(void *platform __unused,
+ int level __unused)
+{
+ return 0;
+}
+
+bool platform_can_split_snd_device(snd_device_t in_snd_device __unused,
+ int *num_devices __unused,
+ snd_device_t *out_snd_devices __unused)
+{
+ return false;
+}
+
+bool platform_check_backends_match(snd_device_t snd_device1 __unused,
+ snd_device_t snd_device2 __unused)
+{
+ return true;
+}
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 7699d523..617176b4 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -541,6 +541,7 @@ static struct name_to_index snd_device_name_index[SND_DEVICE_MAX] = {
{TO_NAME_INDEX(SND_DEVICE_IN_HEADSET_MIC_FLUENCE)},
{TO_NAME_INDEX(SND_DEVICE_IN_VOICE_SPEAKER_MIC)},
{TO_NAME_INDEX(SND_DEVICE_IN_VOICE_HEADSET_MIC)},
+
{TO_NAME_INDEX(SND_DEVICE_IN_HDMI_MIC)},
{TO_NAME_INDEX(SND_DEVICE_IN_BT_SCO_MIC)},
{TO_NAME_INDEX(SND_DEVICE_IN_BT_SCO_MIC_NREC)},
@@ -576,7 +577,8 @@ static struct name_to_index snd_device_name_index[SND_DEVICE_MAX] = {
{TO_NAME_INDEX(SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS)},
};
-static char * backend_table[SND_DEVICE_MAX] = {0};
+static char * backend_tag_table[SND_DEVICE_MAX] = {0};
+static char * hw_interface_table[SND_DEVICE_MAX] = {0};
static struct name_to_index usecase_name_index[AUDIO_USECASE_MAX] = {
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_DEEP_BUFFER)},
@@ -864,32 +866,55 @@ static void set_platform_defaults()
{
int32_t dev;
for (dev = 0; dev < SND_DEVICE_MAX; dev++) {
- backend_table[dev] = NULL;
+ backend_tag_table[dev] = NULL;
+ hw_interface_table[dev] = NULL;
}
for (dev = 0; dev < SND_DEVICE_MAX; dev++) {
backend_bit_width_table[dev] = 16;
}
- // TBD - do these go to the platform-info.xml file.
- // will help in avoiding strdups here
- backend_table[SND_DEVICE_IN_BT_SCO_MIC] = strdup("bt-sco");
- backend_table[SND_DEVICE_IN_BT_SCO_MIC_WB] = strdup("bt-sco-wb");
- backend_table[SND_DEVICE_IN_BT_SCO_MIC_NREC] = strdup("bt-sco");
- backend_table[SND_DEVICE_IN_BT_SCO_MIC_WB_NREC] = strdup("bt-sco-wb");
- backend_table[SND_DEVICE_OUT_BT_SCO] = strdup("bt-sco");
- backend_table[SND_DEVICE_OUT_BT_SCO_WB] = strdup("bt-sco-wb");
- backend_table[SND_DEVICE_OUT_HDMI] = strdup("hdmi");
- backend_table[SND_DEVICE_OUT_SPEAKER_AND_HDMI] = strdup("speaker-and-hdmi");
- backend_table[SND_DEVICE_OUT_VOICE_TX] = strdup("afe-proxy");
- backend_table[SND_DEVICE_IN_VOICE_RX] = strdup("afe-proxy");
-
- backend_table[SND_DEVICE_OUT_AFE_PROXY] = strdup("afe-proxy");
- backend_table[SND_DEVICE_OUT_USB_HEADSET] = strdup("usb-headphones");
- backend_table[SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET] =
+ // To overwrite these go to the audio_platform_info.xml file.
+ backend_tag_table[SND_DEVICE_IN_BT_SCO_MIC] = strdup("bt-sco");
+ backend_tag_table[SND_DEVICE_IN_BT_SCO_MIC_WB] = strdup("bt-sco-wb");
+ backend_tag_table[SND_DEVICE_IN_BT_SCO_MIC_NREC] = strdup("bt-sco");
+ backend_tag_table[SND_DEVICE_IN_BT_SCO_MIC_WB_NREC] = strdup("bt-sco-wb");
+ backend_tag_table[SND_DEVICE_OUT_BT_SCO] = strdup("bt-sco");
+ backend_tag_table[SND_DEVICE_OUT_BT_SCO_WB] = strdup("bt-sco-wb");
+ backend_tag_table[SND_DEVICE_OUT_HDMI] = strdup("hdmi");
+ backend_tag_table[SND_DEVICE_OUT_SPEAKER_AND_HDMI] = strdup("speaker-and-hdmi");
+ backend_tag_table[SND_DEVICE_OUT_VOICE_TX] = strdup("afe-proxy");
+ backend_tag_table[SND_DEVICE_IN_VOICE_RX] = strdup("afe-proxy");
+
+ backend_tag_table[SND_DEVICE_OUT_AFE_PROXY] = strdup("afe-proxy");
+ backend_tag_table[SND_DEVICE_OUT_USB_HEADSET] = strdup("usb-headphones");
+ backend_tag_table[SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET] =
strdup("speaker-and-usb-headphones");
- backend_table[SND_DEVICE_IN_USB_HEADSET_MIC] = strdup("usb-headset-mic");
- backend_table[SND_DEVICE_IN_CAPTURE_FM] = strdup("capture-fm");
- backend_table[SND_DEVICE_OUT_TRANSMISSION_FM] = strdup("transmission-fm");
+ backend_tag_table[SND_DEVICE_IN_USB_HEADSET_MIC] = strdup("usb-headset-mic");
+ backend_tag_table[SND_DEVICE_IN_CAPTURE_FM] = strdup("capture-fm");
+ backend_tag_table[SND_DEVICE_OUT_TRANSMISSION_FM] = strdup("transmission-fm");
+
+ hw_interface_table[SND_DEVICE_OUT_HANDSET] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_SPEAKER] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_SPEAKER_REVERSE] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_HEADPHONES] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_LINE] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_SPEAKER_AND_LINE] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_HANDSET] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_SPEAKER] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_HEADPHONES] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_LINE] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_HDMI] = strdup("HDMI_RX");
+ hw_interface_table[SND_DEVICE_OUT_SPEAKER_AND_HDMI] = strdup("SLIMBUS_0_RX-and-HDMI_RX");
+ hw_interface_table[SND_DEVICE_OUT_BT_SCO] = strdup("SEC_AUX_PCM_RX");
+ hw_interface_table[SND_DEVICE_OUT_BT_SCO_WB] = strdup("SEC_AUX_PCM_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_TX] = strdup("AFE_PCM_RX");
+ hw_interface_table[SND_DEVICE_OUT_SPEAKER_PROTECTED] = strdup("SLIMBUS_0_RX");
+ hw_interface_table[SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED] = strdup("SLIMBUS_0_RX");
+
}
void get_cvd_version(char *cvd_version, struct audio_device *adev)
@@ -1268,9 +1293,9 @@ void platform_deinit(void *platform)
int32_t dev;
for (dev = 0; dev < SND_DEVICE_MAX; dev++) {
- if (backend_table[dev]) {
- free(backend_table[dev]);
- backend_table[dev]= NULL;
+ if (backend_tag_table[dev]) {
+ free(backend_tag_table[dev]);
+ backend_tag_table[dev]= NULL;
}
}
@@ -1319,7 +1344,7 @@ void platform_add_backend_name(char *mixer_path, snd_device_t snd_device)
return;
}
- const char * suffix = backend_table[snd_device];
+ const char * suffix = backend_tag_table[snd_device];
if (suffix != NULL) {
strlcat(mixer_path, " ", MIXER_PATH_MAX_LENGTH);
@@ -1327,6 +1352,36 @@ void platform_add_backend_name(char *mixer_path, snd_device_t snd_device)
}
}
+bool platform_check_backends_match(snd_device_t snd_device1, snd_device_t snd_device2)
+{
+ bool result = true;
+
+ ALOGV("%s: snd_device1 = %s, snd_device2 = %s", __func__,
+ platform_get_snd_device_name(snd_device1),
+ platform_get_snd_device_name(snd_device2));
+
+ if ((snd_device1 < SND_DEVICE_MIN) || (snd_device1 >= SND_DEVICE_MAX)) {
+ ALOGE("%s: Invalid snd_device = %s", __func__,
+ platform_get_snd_device_name(snd_device1));
+ return false;
+ }
+ if ((snd_device2 < SND_DEVICE_MIN) || (snd_device2 >= SND_DEVICE_MAX)) {
+ ALOGE("%s: Invalid snd_device = %s", __func__,
+ platform_get_snd_device_name(snd_device2));
+ return false;
+ }
+ const char * be_itf1 = hw_interface_table[snd_device1];
+ const char * be_itf2 = hw_interface_table[snd_device2];
+
+ if (NULL != be_itf1 && NULL != be_itf2) {
+ if ((NULL == strstr(be_itf2, be_itf1)) && (NULL == strstr(be_itf1, be_itf2)))
+ result = false;
+ }
+
+ ALOGV("%s: be_itf1 = %s, be_itf2 = %s, match %d", __func__, be_itf1, be_itf2, result);
+ return result;
+}
+
int platform_get_pcm_device_id(audio_usecase_t usecase, int device_type)
{
int device_id;
@@ -1450,6 +1505,8 @@ int platform_set_snd_device_acdb_id(snd_device_t snd_device, unsigned int acdb_i
goto done;
}
+ ALOGV("%s: acdb_device_table[%s]: old = %d new = %d", __func__,
+ platform_get_snd_device_name(snd_device), acdb_device_table[snd_device], acdb_id);
acdb_device_table[snd_device] = acdb_id;
done:
return ret;
@@ -1782,6 +1839,37 @@ int platform_set_device_mute(void *platform, bool state, char *dir)
return ret;
}
+bool platform_can_split_snd_device(snd_device_t snd_device,
+ int *num_devices,
+ snd_device_t *new_snd_devices)
+{
+ bool status = false;
+
+ if (NULL == num_devices || NULL == new_snd_devices) {
+ ALOGE("%s: NULL pointer ..", __func__);
+ return false;
+ }
+
+ /*
+ * If wired headset/headphones/line devices share the same backend
+ * with speaker/earpiece this routine returns false.
+ */
+ if (snd_device == SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES &&
+ !platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, SND_DEVICE_OUT_HEADPHONES)) {
+ *num_devices = 2;
+ new_snd_devices[0] = SND_DEVICE_OUT_SPEAKER;
+ new_snd_devices[1] = SND_DEVICE_OUT_HEADPHONES;
+ status = true;
+ } else if (snd_device == SND_DEVICE_OUT_SPEAKER_AND_LINE &&
+ !platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, SND_DEVICE_OUT_LINE)) {
+ *num_devices = 2;
+ new_snd_devices[0] = SND_DEVICE_OUT_SPEAKER;
+ new_snd_devices[1] = SND_DEVICE_OUT_LINE;
+ status = true;
+ }
+ return status;
+}
+
snd_device_t platform_get_output_snd_device(void *platform, audio_devices_t devices)
{
struct platform_data *my_data = (struct platform_data *)platform;
@@ -3228,7 +3316,8 @@ bool platform_check_and_set_codec_backend_cfg(struct audio_device* adev, struct
return false;
}
-int platform_set_snd_device_backend(snd_device_t device, const char *backend)
+int platform_set_snd_device_backend(snd_device_t device, const char *backend_tag,
+ const char * hw_interface)
{
int ret = 0;
@@ -3239,10 +3328,20 @@ int platform_set_snd_device_backend(snd_device_t device, const char *backend)
goto done;
}
- if (backend_table[device]) {
- free(backend_table[device]);
+ ALOGV("%s: backend_tag_table[%s]: old = %s new = %s", __func__,
+ platform_get_snd_device_name(device),
+ backend_tag_table[device] != NULL ? backend_tag_table[device]: "null", backend_tag);
+ if (backend_tag_table[device]) {
+ free(backend_tag_table[device]);
+ }
+ backend_tag_table[device] = strdup(backend_tag);
+
+ if (hw_interface != NULL) {
+ if (hw_interface_table[device])
+ free(hw_interface_table[device]);
+ ALOGV("%s: hw_interface_table[%d] = %s", __func__, device, hw_interface);
+ hw_interface_table[device] = strdup(hw_interface);
}
- backend_table[device] = strdup(backend);
done:
return ret;
}
@@ -3260,6 +3359,7 @@ int platform_set_usecase_pcm_id(audio_usecase_t usecase, int32_t type, int32_t p
ALOGE("%s: invalid usecase type", __func__);
ret = -EINVAL;
}
+ ALOGV("%s: pcm_device_table[%d][%d] = %d", __func__, usecase, type, pcm_id);
pcm_device_table[usecase][type] = pcm_id;
done:
return ret;
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index 9a2ca127..57829642 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -294,12 +294,6 @@ enum {
#define VOLTE_CALL_PCM_DEVICE 15
#define QCHAT_CALL_PCM_DEVICE 14
#define VOWLAN_CALL_PCM_DEVICE -1
-#elif PLATFORM_MSM8994
-#define VOICE_CALL_PCM_DEVICE 2
-#define VOICE2_CALL_PCM_DEVICE 22
-#define VOLTE_CALL_PCM_DEVICE 14
-#define QCHAT_CALL_PCM_DEVICE 20
-#define VOWLAN_CALL_PCM_DEVICE 36
#else
#define VOICE_CALL_PCM_DEVICE 2
#define VOICE2_CALL_PCM_DEVICE 22
diff --git a/hal/platform_api.h b/hal/platform_api.h
index 14ca7cf9..787036a2 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -81,7 +81,8 @@ bool platform_listen_usecase_needs_event(audio_usecase_t uc_id);
bool platform_sound_trigger_device_needs_event(snd_device_t snd_device);
bool platform_sound_trigger_usecase_needs_event(audio_usecase_t uc_id);
-int platform_set_snd_device_backend(snd_device_t snd_device, const char * backend);
+int platform_set_snd_device_backend(snd_device_t snd_device, const char * backend,
+ const char * hw_interface);
int platform_set_snd_device_name(snd_device_t snd_device, const char * name);
/* From platform_info_parser.c */
@@ -111,4 +112,11 @@ void platform_cache_edid(void * platform);
void platform_invalidate_edid(void * platform);
int platform_set_hdmi_config(struct stream_out *out);
int platform_set_device_params(struct stream_out *out, int param, int value);
+
+bool platform_can_split_snd_device(snd_device_t in_snd_device,
+ int *num_devices,
+ snd_device_t *out_snd_devices);
+
+bool platform_check_backends_match(snd_device_t snd_device1, snd_device_t snd_device2);
+
#endif // AUDIO_PLATFORM_API_H
diff --git a/hal/platform_info.c b/hal/platform_info.c
index c5e2f885..72a475e1 100644
--- a/hal/platform_info.c
+++ b/hal/platform_info.c
@@ -152,6 +152,7 @@ done:
static void process_backend_name(const XML_Char **attr)
{
int index;
+ char *hw_interface = NULL;
if (strcmp(attr[0], "name") != 0) {
ALOGE("%s: 'name' not found, no ACDB ID set!", __func__);
@@ -171,7 +172,15 @@ static void process_backend_name(const XML_Char **attr)
goto done;
}
- if (platform_set_snd_device_backend(index, attr[3]) < 0) {
+ if (attr[4] != NULL) {
+ if (strcmp(attr[4], "interface") != 0) {
+ hw_interface = NULL;
+ } else {
+ hw_interface = (char *)attr[5];
+ }
+ }
+
+ if (platform_set_snd_device_backend(index, attr[3], hw_interface) < 0) {
ALOGE("%s: Device %s backend %s was not set!",
__func__, attr[1], attr[3]);
goto done;