Merge 4202f6db1ab6a980251efcab1c1967eb73d28efa on remote branch
Change-Id: Id070694ff5526bb651fe110005f54ebde63e7e49
diff --git a/configs/msm8937/audio_policy_configuration_sdm429w.xml b/configs/msm8937/audio_policy_configuration_sdm429w.xml
index b210fbc..33a4af5 100644
--- a/configs/msm8937/audio_policy_configuration_sdm429w.xml
+++ b/configs/msm8937/audio_policy_configuration_sdm429w.xml
@@ -49,7 +49,6 @@
<module name="primary" halVersion="2.0">
<attachedDevices>
<item>Speaker</item>
- <item>Speaker Safe</item>
<item>Earpiece</item>
<item>Telephony Tx</item>
<item>Built-In Mic</item>
@@ -117,8 +116,6 @@
</devicePort>
<devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink">
</devicePort>
- <devicePort tagName="Speaker Safe" type="AUDIO_DEVICE_OUT_SPEAKER_SAFE" role="sink">
- </devicePort>
<devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
@@ -163,8 +160,6 @@
sources="primary output,raw,deep_buffer"/>
<route type="mix" sink="Speaker"
sources="primary output,raw,deep_buffer,compressed_offload"/>
- <route type="mix" sink="Speaker Safe"
- sources="primary output,raw,deep_buffer,compressed_offload"/>
<route type="mix" sink="BT SCO"
sources="primary output,raw,deep_buffer,voip_rx"/>
<route type="mix" sink="BT SCO Headset"
diff --git a/configs/msm8937/mixer_paths_mtp.xml b/configs/msm8937/mixer_paths_mtp.xml
index 8ded630..c92fb58 100644
--- a/configs/msm8937/mixer_paths_mtp.xml
+++ b/configs/msm8937/mixer_paths_mtp.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- Copyright (c) 2015-2016, 2018-2020, The Linux Foundation. All rights reserved.
+ Copyright (c) 2015-2016, 2018-2021, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -1420,6 +1420,11 @@
<path name="headphones" />
</path>
+ <path name="wsa-speaker-and-headphones">
+ <path name="wsa-speaker" />
+ <path name="headphones" />
+ </path>
+
<path name="usb-headphones">
</path>
diff --git a/configs/msm8937/mixer_paths_sdm429w_dvt2.xml b/configs/msm8937/mixer_paths_sdm429w_dvt2.xml
index 4a6d124..aea01f4 100644
--- a/configs/msm8937/mixer_paths_sdm429w_dvt2.xml
+++ b/configs/msm8937/mixer_paths_sdm429w_dvt2.xml
@@ -935,6 +935,7 @@
<path name="speaker-and-bt-a2dp">
<path name="speaker" />
+ <path name="bt-a2dp" />
</path>
<path name="voice-rec-mic">
diff --git a/configs/msm8937/mixer_paths_tasha.xml b/configs/msm8937/mixer_paths_tasha.xml
index 24b5c1e..4944f9d 100644
--- a/configs/msm8937/mixer_paths_tasha.xml
+++ b/configs/msm8937/mixer_paths_tasha.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Copyright (c) 2015-2016, 2018, 2020, The Linux Foundation. All rights reserved. -->
+<!-- Copyright (c) 2015-2016, 2018, 2020-2021, The Linux Foundation. -->
+<!-- All rights reserved. -->
<!-- -->
<!-- Redistribution and use in source and binary forms, with or without -->
<!-- modification, are permitted provided that the following conditions are -->
@@ -2359,6 +2360,10 @@
<path name="wsa-speaker" />
</path>
+ <path name="wsa-speaker-and-headphones">
+ <path name="wsa-speaker" />
+ <path name="headphones" />
+ </path>
<path name="usb-headphones">
</path>
diff --git a/configs/msm8937/mixer_paths_tashalite.xml b/configs/msm8937/mixer_paths_tashalite.xml
index 00b2d74..4f20a0a 100644
--- a/configs/msm8937/mixer_paths_tashalite.xml
+++ b/configs/msm8937/mixer_paths_tashalite.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Copyright (c) 2015-2016, 2018, 2020, The Linux Foundation. All rights reserved. -->
+<!-- Copyright (c) 2015-2016, 2018, 2020-2021, -->
+<!-- The Linux Foundation. All rights reserved. -->
<!-- -->
<!-- Redistribution and use in source and binary forms, with or without -->
<!-- modification, are permitted provided that the following conditions are -->
@@ -2326,6 +2327,10 @@
<path name="wsa-speaker" />
</path>
+ <path name="wsa-speaker-and-headphones">
+ <path name="wsa-speaker" />
+ <path name="headphones" />
+ </path>
<path name="usb-headphones">
</path>
diff --git a/configs/msm8937/msm8937.mk b/configs/msm8937/msm8937.mk
index 5db9969..9e9c36c 100644
--- a/configs/msm8937/msm8937.mk
+++ b/configs/msm8937/msm8937.mk
@@ -199,8 +199,10 @@
audio.offload.min.duration.secs=30
#Enable offload audio video playback by default
+ifneq ($(TARGET_PRODUCT),sdm429w)
PRODUCT_PROPERTY_OVERRIDES += \
audio.offload.video=true
+endif
#Enable audio track offload by default
PRODUCT_PROPERTY_OVERRIDES += \
diff --git a/configs/msmnile_au/msmnile_au.mk b/configs/msmnile_au/msmnile_au.mk
index 5886918..22a08f9 100644
--- a/configs/msmnile_au/msmnile_au.mk
+++ b/configs/msmnile_au/msmnile_au.mk
@@ -97,7 +97,7 @@
ifneq ($(ENABLE_HYP),true)
AUDIO_FEATURE_ENABLED_AUTO_AUDIOD := true
-ifeq ($(TARGET_PRODUCT),msmnile_au)
+ifneq ( ,$(filter msmnile_au msmnile_tb, $(TARGET_PRODUCT)))
AUDIO_FEATURE_ENABLED_DAEMON_SUPPORT := true
AUDIO_FEATURE_ENABLED_SILENT_BOOT := true
else
diff --git a/configs/sdm660/audio_platform_info_tasha_skus.xml b/configs/sdm660/audio_platform_info_tasha_skus.xml
index a4ae7c1..ed35b4b 100644
--- a/configs/sdm660/audio_platform_info_tasha_skus.xml
+++ b/configs/sdm660/audio_platform_info_tasha_skus.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Copyright (c) 2014, 2016-2018, 2020 The Linux Foundation. All rights reserved.-->
+<!-- Copyright (c) 2014, 2016-2018, 2020-2021 The Linux Foundation. All rights reserved.-->
<!-- -->
<!-- Redistribution and use in source and binary forms, with or without -->
<!-- modification, are permitted provided that the following conditions are -->
@@ -95,7 +95,7 @@
<param key="spkr_2_tz_name" value="wsatz.14"/>
<!-- In the below value string, the value indicates default mono -->
<!-- speaker. It can be set to either left or right -->
- <param key="mono_speaker" value="right"/>
+ <param key="mono_speaker" value="left"/>
<!-- In the below value string, first parameter indicates size -->
<!-- followed by perf lock options -->
<param key="perf_lock_opts" value="4, 0x101, 0x704, 0x20F, 0x1E01"/>
diff --git a/configs/sdm660/sound_trigger_platform_info.xml b/configs/sdm660/sound_trigger_platform_info.xml
index 271f99d..13d1adc 100644
--- a/configs/sdm660/sound_trigger_platform_info.xml
+++ b/configs/sdm660/sound_trigger_platform_info.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--- Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. -->
+<!--- Copyright (c) 2013-2017, 2021 The Linux Foundation. All rights reserved. -->
<!--- -->
<!--- Redistribution and use in source and binary forms, with or without -->
<!--- modification, are permitted provided that the following conditions are -->
@@ -51,6 +51,7 @@
<sound_model_config>
<param vendor_uuid="68ab2d40-e860-11e3-95ef-0002a5d5c51b" />
<param execution_type="WDSP" /> <!-- value: "WDSP" "ADSP" "DYNAMIC" -->
+ <param second_stage_supported="false" />
<param app_type="2" /> <!-- app type used in ACDB -->
<param library="libsmwrapper.so" />
<param max_cpe_phrases="6" />
diff --git a/hal/audio_extn/soundtrigger.c b/hal/audio_extn/soundtrigger.c
index b3df579..d7bbb2f 100644
--- a/hal/audio_extn/soundtrigger.c
+++ b/hal/audio_extn/soundtrigger.c
@@ -561,7 +561,7 @@
struct stream_in *active_input = adev_get_active_input(st_dev->adev);
audio_source_t source = (active_input == NULL) ?
AUDIO_SOURCE_DEFAULT : active_input->source;
- if (voice_is_in_call(st_dev->adev)) {
+ if (voice_is_uc_active(st_dev->adev)) {
ev_info.u.usecase.type = USECASE_TYPE_VOICE_CALL;
} else if ((st_dev->adev->mode == AUDIO_MODE_IN_COMMUNICATION ||
source == AUDIO_SOURCE_VOICE_COMMUNICATION) &&
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 1f61d6d..f71f2b2 100755
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -1329,12 +1329,6 @@
platform_check_and_update_copp_sample_rate(adev->platform, snd_device,
usecase->stream.out->sample_rate,
&usecase->stream.out->app_type_cfg.sample_rate);
- } else if (((snd_device != SND_DEVICE_OUT_HEADPHONES_44_1 &&
- !audio_is_this_native_usecase(usecase)) &&
- usecase->stream.out->sample_rate == OUTPUT_SAMPLING_RATE_44100) ||
- (usecase->stream.out->sample_rate < OUTPUT_SAMPLING_RATE_44100)) {
- /* Reset to default if no native stream is active*/
- usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
} else if (snd_device == SND_DEVICE_OUT_BT_A2DP) {
/*
* For a2dp playback get encoder sampling rate and set copp sampling rate,
@@ -1343,8 +1337,12 @@
audio_extn_a2dp_get_enc_sample_rate(&usecase->stream.out->app_type_cfg.sample_rate);
ALOGI("%s using %d sample rate rate for A2DP CoPP",
__func__, usecase->stream.out->app_type_cfg.sample_rate);
- } else if (compare_device_type(&usecase->stream.out->device_list,
- AUDIO_DEVICE_OUT_SPEAKER)) {
+ } else if ((((snd_device != SND_DEVICE_OUT_HEADPHONES_44_1 &&
+ !audio_is_this_native_usecase(usecase)) &&
+ usecase->stream.out->sample_rate == OUTPUT_SAMPLING_RATE_44100) ||
+ (usecase->stream.out->sample_rate < OUTPUT_SAMPLING_RATE_44100)) ||
+ (compare_device_type(&usecase->stream.out->device_list,AUDIO_DEVICE_OUT_SPEAKER))) {
+ /* Reset to default if no native stream is active or default device is speaker*/
usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
}
audio_extn_btsco_get_sample_rate(snd_device, &usecase->stream.out->app_type_cfg.sample_rate);
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 0855185..9ed29ed 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2810,7 +2810,10 @@
(is_single_device_type_equal(&usecase->device_list,
AUDIO_DEVICE_IN_USB_HEADSET) &&
is_single_device_type_equal(&vc_usecase->device_list,
- AUDIO_DEVICE_OUT_USB_HEADSET)))) {
+ AUDIO_DEVICE_OUT_USB_HEADSET))||
+ (is_single_device_type_equal(&usecase->device_list,
+ AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET) &&
+ is_codec_backend_out_device_type(&vc_usecase->device_list)))) {
in_snd_device = vc_usecase->in_snd_device;
out_snd_device = vc_usecase->out_snd_device;
}
@@ -4116,9 +4119,8 @@
}
}
- if (out->realtime)
- platform_set_stream_channel_map(adev->platform, out->channel_mask,
- out->pcm_device_id, -1, &out->channel_map_param.channel_map[0]);
+ platform_set_stream_channel_map(adev->platform, out->channel_mask,
+ out->pcm_device_id, -1, &out->channel_map_param.channel_map[0]);
out->pcm = pcm_open_prepare_helper(adev->snd_card, out->pcm_device_id,
flags, pcm_open_retry_count,
@@ -4142,10 +4144,6 @@
}
}
- if (!out->realtime)
- platform_set_stream_channel_map(adev->platform, out->channel_mask,
- out->pcm_device_id, -1, &out->channel_map_param.channel_map[0]);
-
// apply volume for voip playback after path is set up
if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP)
out_set_voip_volume(&out->stream, out->volume_l, out->volume_r);
diff --git a/hal/voice.c b/hal/voice.c
index 230ceed..e2218e6 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -204,7 +204,7 @@
disable_snd_device(adev, uc_info->in_snd_device);
adev->voice.lte_call = false;
- adev->voice.in_call = false;
+ adev->voice.uc_active = false;
list_remove(&uc_info->list);
free(uc_info);
@@ -245,7 +245,7 @@
return -ENOMEM;
}
- adev->voice.in_call = true;
+ adev->voice.uc_active = true;
uc_info->id = usecase_id;
uc_info->type = VOICE_CALL;
@@ -256,6 +256,7 @@
if (is_in_call && list_length(&uc_info->device_list) == 2) {
ALOGE("%s: Invalid combo device(%#x) for voice call", __func__,
get_device_types(&uc_info->device_list));
+ adev->voice.in_call = false;
ret = -EIO;
goto error_start_voice;
}
@@ -457,6 +458,11 @@
return in_call_rec;
}
+bool voice_is_uc_active(const struct audio_device *adev)
+{
+ return adev->voice.uc_active;
+}
+
uint32_t voice_get_active_session_id(struct audio_device *adev)
{
int ret = 0;
@@ -727,12 +733,12 @@
{
int ret = 0;
+ adev->voice.in_call = false;
ret = voice_extn_stop_call(adev);
if (ret == -ENOSYS) {
ret = voice_stop_usecase(adev, USECASE_VOICE_CALL);
}
- adev->voice.in_call = false;
return ret;
}
@@ -838,6 +844,7 @@
adev->voice.mic_mute = false;
adev->voice.in_call = false;
adev->voice.lte_call = false;
+ adev->voice.uc_active = false;
for (i = 0; i < max_voice_sessions; i++) {
adev->voice.session[i].pcm_rx = NULL;
adev->voice.session[i].pcm_tx = NULL;
diff --git a/hal/voice.h b/hal/voice.h
index 290ca3d..da456f9 100644
--- a/hal/voice.h
+++ b/hal/voice.h
@@ -62,6 +62,7 @@
float volume;
bool in_call;
bool lte_call;
+ bool uc_active;
};
struct power_mode_cfg {
@@ -93,6 +94,7 @@
bool voice_is_in_call(const struct audio_device *adev);
bool voice_is_in_call_or_call_screen(const struct audio_device *adev);
bool voice_is_in_call_rec_stream(const struct stream_in *in);
+bool voice_is_uc_active(const struct audio_device *adev);
int voice_set_mic_mute(struct audio_device *dev, bool state);
bool voice_is_lte_call_active(struct audio_device *adev);
bool voice_get_mic_mute(struct audio_device *dev);