Merge "hal: Add proper check for incall recording"
diff --git a/configs/common/audio_policy_configuration.xml b/configs/common/audio_policy_configuration.xml
index 45bda7b..78b5073 100644
--- a/configs/common/audio_policy_configuration.xml
+++ b/configs/common/audio_policy_configuration.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!-- Copyright (c) 2016-2017, 2019, The Linux Foundation. All rights reserved
+<!-- Copyright (c) 2016-2017, 2019, 2021, The Linux Foundation. All rights reserved
Not a Contribution.
-->
<!-- Copyright (C) 2015 The Android Open Source Project
diff --git a/configs/common_au/audio_policy_configuration.xml b/configs/common_au/audio_policy_configuration.xml
index 01fa0de..b2d0318 100644
--- a/configs/common_au/audio_policy_configuration.xml
+++ b/configs/common_au/audio_policy_configuration.xml
@@ -64,6 +64,7 @@
<item>Primary In Bus</item>
<item>Front Passenger In Bus</item>
<item>Rear Seat In Bus</item>
+ <item>Echo Reference</item>
</attachedDevices>
<defaultOutputDevice>Media Bus</defaultOutputDevice>
<mixPorts>
@@ -164,6 +165,10 @@
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
</mixPort>
+ <mixPort name="echo_ref" role="sink">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
+ </mixPort>
</mixPorts>
<devicePorts>
<devicePort tagName="Media Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
@@ -281,6 +286,11 @@
minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
</gains>
</devicePort>
+ <devicePort tagName="Echo Reference" type="AUDIO_DEVICE_IN_ECHO_REFERENCE" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="16000,48000"
+ channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
+ </devicePort>
</devicePorts>
<routes>
<route type="mix" sink="Media Bus"
@@ -311,6 +321,8 @@
sources="voice_tx,incall_music_uplink"/>
<route type="mix" sink="primary input"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Primary In Bus,Front Passenger In Bus,Rear Seat In Bus"/>
+ <route type="mix" sink="echo_ref"
+ sources="Echo Reference"/>
<route type="mix" sink="fast input"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic"/>
<route type="mix" sink="voice_rx"
diff --git a/configs/lahaina/audio_platform_info.xml b/configs/lahaina/audio_platform_info.xml
index bafbb34..8d05776 100644
--- a/configs/lahaina/audio_platform_info.xml
+++ b/configs/lahaina/audio_platform_info.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Copyright (c) 2014, 2016-2020, The Linux Foundation. All rights reserved. -->
+<!-- Copyright (c) 2014, 2016-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 -->
@@ -267,7 +267,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_platform_info_hdk.xml b/configs/lahaina/audio_platform_info_hdk.xml
index 3f161bb..04578d4 100644
--- a/configs/lahaina/audio_platform_info_hdk.xml
+++ b/configs/lahaina/audio_platform_info_hdk.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. -->
+<!-- Copyright (c) 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 -->
@@ -147,6 +147,7 @@
<device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" acdb_id="191"/>
<device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="11"/>
<device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" acdb_id="7"/>
+ <device name="SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MIC" acdb_id="133"/>
</acdb_ids>
<backend_names>
<device name="SND_DEVICE_OUT_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
@@ -301,7 +302,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_platform_info_intcodec.xml b/configs/lahaina/audio_platform_info_intcodec.xml
index 64e6cef..a362b39 100644
--- a/configs/lahaina/audio_platform_info_intcodec.xml
+++ b/configs/lahaina/audio_platform_info_intcodec.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Copyright (c) 2014, 2016-2020, The Linux Foundation. All rights reserved. -->
+<!-- Copyright (c) 2014, 2016-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 -->
@@ -147,6 +147,7 @@
<device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" acdb_id="191"/>
<device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="11"/>
<device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" acdb_id="7"/>
+ <device name="SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MIC" acdb_id="133"/>
</acdb_ids>
<backend_names>
<device name="SND_DEVICE_OUT_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
@@ -302,7 +303,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_platform_info_qrd.xml b/configs/lahaina/audio_platform_info_qrd.xml
index 6d45569..1404423 100644
--- a/configs/lahaina/audio_platform_info_qrd.xml
+++ b/configs/lahaina/audio_platform_info_qrd.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. -->
+<!-- Copyright (c) 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 -->
@@ -147,6 +147,7 @@
<device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" acdb_id="191"/>
<device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="11"/>
<device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" acdb_id="7"/>
+ <device name="SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MIC" acdb_id="133"/>
</acdb_ids>
<backend_names>
<device name="SND_DEVICE_OUT_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
@@ -301,7 +302,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_platform_info_shimaidp.xml b/configs/lahaina/audio_platform_info_shimaidp.xml
index bb77ab4..b1edc20 100644
--- a/configs/lahaina/audio_platform_info_shimaidp.xml
+++ b/configs/lahaina/audio_platform_info_shimaidp.xml
@@ -282,7 +282,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_platform_info_shimaqrd.xml b/configs/lahaina/audio_platform_info_shimaqrd.xml
index 0353a77..de717e9 100644
--- a/configs/lahaina/audio_platform_info_shimaqrd.xml
+++ b/configs/lahaina/audio_platform_info_shimaqrd.xml
@@ -284,7 +284,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_platform_info_yupikidp.xml b/configs/lahaina/audio_platform_info_yupikidp.xml
index dc742ff..e04f05a 100644
--- a/configs/lahaina/audio_platform_info_yupikidp.xml
+++ b/configs/lahaina/audio_platform_info_yupikidp.xml
@@ -134,6 +134,7 @@
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_2_PROTECTED_VBAT" acdb_id="150"/>
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_1" acdb_id="151"/>
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK_MONO_2" acdb_id="152"/>
+ <device name="SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MIC" acdb_id="133"/>
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_1" acdb_id="14"/>
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_2" acdb_id="14"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1" acdb_id="10"/>
@@ -302,7 +303,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_platform_info_yupikqrd.xml b/configs/lahaina/audio_platform_info_yupikqrd.xml
index c6b6075..9bdcf52 100644
--- a/configs/lahaina/audio_platform_info_yupikqrd.xml
+++ b/configs/lahaina/audio_platform_info_yupikqrd.xml
@@ -284,7 +284,6 @@
<device name="SND_DEVICE_IN_UNPROCESSED_STEREO_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_THREE_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_IN_UNPROCESSED_QUAD_MIC" interface="TX_CDC_DMA_TX_3"/>
- <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_ANC_HEADSET" backend="speaker-and-headphones" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco" interface="WSA_CDC_DMA_RX_0-and-SLIMBUS_7_RX"/>
diff --git a/configs/lahaina/audio_policy_configuration.xml b/configs/lahaina/audio_policy_configuration.xml
index 8ae7dcb..b7e9e65 100644
--- a/configs/lahaina/audio_policy_configuration.xml
+++ b/configs/lahaina/audio_policy_configuration.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!-- Copyright (c) 2016-2020, The Linux Foundation. All rights reserved
+<!-- Copyright (c) 2016-2021, The Linux Foundation. All rights reserved
Not a Contribution.
-->
<!-- Copyright (C) 2015 The Android Open Source Project
@@ -371,9 +371,9 @@
<route type="mix" sink="usb_surround_sound"
sources="USB Device In,USB Headset In"/>
<route type="mix" sink="fast input"
- sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
+ sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Wired Headset Mic"/>
<route type="mix" sink="quad mic"
- sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
+ sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Wired Headset Mic"/>
<route type="mix" sink="voip_tx"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/>
<route type="mix" sink="record_24"
diff --git a/configs/lahaina/mixer_paths_hhg.xml b/configs/lahaina/mixer_paths_hhg.xml
index f716350..b926a3a 100644
--- a/configs/lahaina/mixer_paths_hhg.xml
+++ b/configs/lahaina/mixer_paths_hhg.xml
@@ -2756,7 +2756,7 @@
</path>
<path name="speaker-mic">
- <path name="dmic5" />
+ <path name="dmic3" />
</path>
<path name="speaker-mic-liquid">
diff --git a/configs/lahaina/mixer_paths_shimaqrd.xml b/configs/lahaina/mixer_paths_shimaqrd.xml
index 2db82d3..89b3c6f 100755
--- a/configs/lahaina/mixer_paths_shimaqrd.xml
+++ b/configs/lahaina/mixer_paths_shimaqrd.xml
@@ -1817,6 +1817,11 @@
<path name="compress-offload-playback9" />
</path>
+ <path name="audio-with-haptics-playback handset">
+ <ctl name="RX_CDC_DMA_RX_6 Audio Mixer MultiMedia32" value="1"/>
+ <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia31" value="1"/>
+ </path>
+
<path name="audio-record">
<ctl name="MultiMedia1 Mixer TX_CDC_DMA_TX_3" value="1" />
</path>
diff --git a/configs/lahaina/yupik_overlay/mixer_paths_yupikqrd_overlay.xml b/configs/lahaina/yupik_overlay/mixer_paths_yupikqrd_overlay.xml
index 0dd5a01..0437aef 100644
--- a/configs/lahaina/yupik_overlay/mixer_paths_yupikqrd_overlay.xml
+++ b/configs/lahaina/yupik_overlay/mixer_paths_yupikqrd_overlay.xml
@@ -270,4 +270,8 @@
<path name="mmap-record capture-fm">
<ctl name="MultiMedia16 Mixer SEC_MI2S_TX" value="1"/>
</path>
+ <path name="audio-with-haptics-playback handset">
+ <ctl name="RX_CDC_DMA_RX_6 Audio Mixer MultiMedia32" value="1"/>
+ <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia31" value="1"/>
+ </path>
</mixer>
diff --git a/configs/msm8937/audio_platform_info_sdm429w.xml b/configs/msm8937/audio_platform_info_sdm429w.xml
index 91a7a20..9509f18 100644
--- a/configs/msm8937/audio_platform_info_sdm429w.xml
+++ b/configs/msm8937/audio_platform_info_sdm429w.xml
@@ -56,6 +56,7 @@
<param key="spkr_1_tz_name" value="wsa881x.0f"/>
<param key="spkr_2_tz_name" value=""/>
<param key="hfp_pcm_dev_id" value="18"/>
+ <param key="afe_loopback" value="1"/>
</config_params>
<acdb_ids>
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED" acdb_id="136"/>
diff --git a/configs/msm8937/audio_platform_info_sdm429w_dvt2.xml b/configs/msm8937/audio_platform_info_sdm429w_dvt2.xml
index 8dacccf..65450e5 100644
--- a/configs/msm8937/audio_platform_info_sdm429w_dvt2.xml
+++ b/configs/msm8937/audio_platform_info_sdm429w_dvt2.xml
@@ -59,6 +59,7 @@
<param key="spkr_2_tz_name" value=""/>
<param key="hfp_vol_mixer_ctl" value="SLIMBUS_7 LOOPBACK Volume"/>
<param key="hfp_pcm_dev_id" value="18"/>
+ <param key="afe_loopback" value="1"/>
</config_params>
<acdb_ids>
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED" acdb_id="136"/>
diff --git a/configs/msm8937/msm8937.mk b/configs/msm8937/msm8937.mk
index 7ffe8e2..a801809 100644
--- a/configs/msm8937/msm8937.mk
+++ b/configs/msm8937/msm8937.mk
@@ -157,10 +157,10 @@
$(TOPDIR)vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8937/audio_policy_configuration_sdm429w.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml
else ifeq ($(TARGET_USES_AOSP_FOR_AUDIO), true)
PRODUCT_COPY_FILES += \
- $(TOPDIR)vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8937/audio_policy_configuration_common.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
+ $(TOPDIR)vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8937/audio_policy_configuration_common.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml
else
PRODUCT_COPY_FILES += \
- $(TOPDIR)vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8937/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml
+ $(TOPDIR)vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8937/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/audio_policy_configuration.xml
endif
PRODUCT_COPY_FILES += \
$(TOPDIR)vendor/qcom/opensource/audio-hal/primary-hal/configs/common/bluetooth_qti_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \
diff --git a/configs/msm8953/audio_output_policy.conf b/configs/msm8953/audio_output_policy.conf
index d983d9a..b19fbb0 100644
--- a/configs/msm8953/audio_output_policy.conf
+++ b/configs/msm8953/audio_output_policy.conf
@@ -18,6 +18,13 @@
bit_width 16
app_type 69937
}
+ voip_rx {
+ flags AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT
+ formats AUDIO_FORMAT_PCM_16_BIT
+ sampling_rates 8000|16000|32000|48000
+ bit_width 16
+ app_type 69946
+ }
deep_buffer {
flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER
formats AUDIO_FORMAT_PCM_16_BIT
diff --git a/configs/msm8953/audio_platform_info_intcodec.xml b/configs/msm8953/audio_platform_info_intcodec.xml
index 157d998..557cd0f 100644
--- a/configs/msm8953/audio_platform_info_intcodec.xml
+++ b/configs/msm8953/audio_platform_info_intcodec.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -53,6 +53,8 @@
<usecase name="USECASE_INCALL_REC_UPLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_DOWNLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_UPLINK_AND_DOWNLINK" type="in" id="14" />
+ <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="27" />
+ <usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="27" />
</pcm_ids>
<config_params>
<param key="spkr_1_tz_name" value="wsa881x.0f"/>
@@ -64,6 +66,7 @@
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT" acdb_id="136"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT" acdb_id="136"/>
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK" acdb_id="137"/>
+ <device name="SND_DEVICE_IN_HEADSET_MIC_FLUENCE" acdb_id="8"/>
</acdb_ids>
<backend_names>
@@ -165,6 +168,10 @@
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB" backend="speaker-and-bt-sco-wb" interface="PRI_MI2S_RX-and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO" backend="wsa-speaker-and-bt-sco" interface="PRI_MI2S_RX-and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_WB" backend="wsa-speaker-and-bt-sco-wb" interface="PRI_MI2S_RX-and-INT_BT_SCO_RX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_NREC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB_NREC" interface="INT_BT_SCO_TX"/>
</backend_names>
<!-- below values are for ref purpose to OEM, doesn't contain actual hardware info on MTP -->
<microphone_characteristics>
diff --git a/configs/msm8953/audio_platform_info_sku3_tasha.xml b/configs/msm8953/audio_platform_info_sku3_tasha.xml
index d3cf620..806584e 100644
--- a/configs/msm8953/audio_platform_info_sku3_tasha.xml
+++ b/configs/msm8953/audio_platform_info_sku3_tasha.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -62,6 +62,8 @@
<usecase name="USECASE_INCALL_REC_UPLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_DOWNLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_UPLINK_AND_DOWNLINK" type="in" id="14" />
+ <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="28" />
+ <usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="28" />
</pcm_ids>
<config_params>
<param key="native_audio_mode" value="src"/>
@@ -69,6 +71,9 @@
<param key="ffv_split_ec_ref_data" value="false"/>
<param key="ffv_ec_ref_channel_count" value="1"/>
</config_params>
+ <acdb_ids>
+ <device name="SND_DEVICE_IN_HEADSET_MIC_FLUENCE" acdb_id="8"/>
+ </acdb_ids>
<backend_names>
<device name="SND_DEVICE_OUT_BT_SCO_WB" interface="INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_BT_SCO" interface="INT_BT_SCO_RX"/>
@@ -87,6 +92,10 @@
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB" backend="speaker-and-bt-sco-wb" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO" backend="wsa-speaker-and-bt-sco" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_WB" backend="wsa-speaker-and-bt-sco-wb" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_NREC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB_NREC" interface="INT_BT_SCO_TX"/>
</backend_names>
<!-- below values are for ref purpose to OEM, doesn't contain actual hardware info on MTP -->
<microphone_characteristics>
diff --git a/configs/msm8953/audio_platform_info_sku4.xml b/configs/msm8953/audio_platform_info_sku4.xml
index 8b211a7..d848790 100644
--- a/configs/msm8953/audio_platform_info_sku4.xml
+++ b/configs/msm8953/audio_platform_info_sku4.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -52,6 +52,8 @@
<usecase name="USECASE_INCALL_REC_UPLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_DOWNLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_UPLINK_AND_DOWNLINK" type="in" id="14" />
+ <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="27" />
+ <usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="27" />
</pcm_ids>
<config_params>
<param key="spkr_1_tz_name" value="wsa881x.0f"/>
@@ -63,6 +65,7 @@
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED_VBAT" acdb_id="136"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_PROTECTED_VBAT" acdb_id="136"/>
<device name="SND_DEVICE_IN_CAPTURE_VI_FEEDBACK" acdb_id="137"/>
+ <device name="SND_DEVICE_IN_HEADSET_MIC_FLUENCE" acdb_id="8"/>
</acdb_ids>
<backend_names>
@@ -164,6 +167,10 @@
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB" backend="speaker-and-bt-sco-wb" interface="PRI_MI2S_RX-and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO" backend="wsa-speaker-and-bt-sco" interface="PRI_MI2S_RX-and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_WB" backend="wsa-speaker-and-bt-sco-wb" interface="PRI_MI2S_RX-and-INT_BT_SCO_RX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_NREC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB_NREC" interface="INT_BT_SCO_TX"/>
</backend_names>
<!-- below values are for ref purpose to OEM, doesn't contain actual hardware info on MTP -->
<microphone_characteristics>
diff --git a/configs/msm8953/audio_platform_info_tasha.xml b/configs/msm8953/audio_platform_info_tasha.xml
index b9ae049..ee65dac 100644
--- a/configs/msm8953/audio_platform_info_tasha.xml
+++ b/configs/msm8953/audio_platform_info_tasha.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -64,6 +64,8 @@
<usecase name="USECASE_INCALL_REC_UPLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_DOWNLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_UPLINK_AND_DOWNLINK" type="in" id="14" />
+ <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="28" />
+ <usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="28" />
</pcm_ids>
<config_params>
<param key="native_audio_mode" value="src"/>
@@ -71,6 +73,9 @@
<param key="ffv_split_ec_ref_data" value="false"/>
<param key="ffv_ec_ref_channel_count" value="1"/>
</config_params>
+ <acdb_ids>
+ <device name="SND_DEVICE_IN_HEADSET_MIC_FLUENCE" acdb_id="8"/>
+ </acdb_ids>
<backend_names>
<device name="SND_DEVICE_OUT_BT_SCO_WB" interface="INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_BT_SCO" interface="INT_BT_SCO_RX"/>
@@ -89,6 +94,10 @@
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB" backend="speaker-and-bt-sco-wb" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO" backend="wsa-speaker-and-bt-sco" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_WB" backend="wsa-speaker-and-bt-sco-wb" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_NREC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB_NREC" interface="INT_BT_SCO_TX"/>
</backend_names>
<!-- below values are for ref purpose to OEM, doesn't contain actual hardware info on MTP -->
<microphone_characteristics>
diff --git a/configs/msm8953/audio_platform_info_tashalite.xml b/configs/msm8953/audio_platform_info_tashalite.xml
index a358144..ee65dac 100644
--- a/configs/msm8953/audio_platform_info_tashalite.xml
+++ b/configs/msm8953/audio_platform_info_tashalite.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -64,6 +64,8 @@
<usecase name="USECASE_INCALL_REC_UPLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_DOWNLINK" type="in" id="14" />
<usecase name="USECASE_INCALL_REC_UPLINK_AND_DOWNLINK" type="in" id="14" />
+ <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="28" />
+ <usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="28" />
</pcm_ids>
<config_params>
<param key="native_audio_mode" value="src"/>
@@ -71,6 +73,9 @@
<param key="ffv_split_ec_ref_data" value="false"/>
<param key="ffv_ec_ref_channel_count" value="1"/>
</config_params>
+ <acdb_ids>
+ <device name="SND_DEVICE_IN_HEADSET_MIC_FLUENCE" acdb_id="8"/>
+ </acdb_ids>
<backend_names>
<device name="SND_DEVICE_OUT_BT_SCO_WB" interface="INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_BT_SCO" interface="INT_BT_SCO_RX"/>
@@ -89,6 +94,10 @@
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB" backend="speaker-and-bt-sco-wb" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO" backend="wsa-speaker-and-bt-sco" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
<device name="SND_DEVICE_OUT_SPEAKER_WSA_AND_BT_SCO_WB" backend="wsa-speaker-and-bt-sco-wb" interface="SLIMBUS_0_RX--and-INT_BT_SCO_RX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_NREC" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB" interface="INT_BT_SCO_TX"/>
+ <device name="SND_DEVICE_IN_BT_SCO_MIC_WB_NREC" interface="INT_BT_SCO_TX"/>
</backend_names>
<!-- below values are for ref purpose to OEM, doesn't contain actual hardware info on MTP -->
<microphone_characteristics>
diff --git a/configs/msm8953/mixer_paths_mtp.xml b/configs/msm8953/mixer_paths_mtp.xml
index fea32be..3d38818 100644
--- a/configs/msm8953/mixer_paths_mtp.xml
+++ b/configs/msm8953/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, 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
@@ -266,6 +266,15 @@
<ctl name="IIR1 Enable Band5" value="0" />
<!-- IIR -->
+ <!-- VoIP over audio -->
+ <ctl name="MultiMedia10 Mixer TERT_MI2S_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="0" />
+ <ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia10" value="0" />
+ <ctl name="PRI_MI2S_RX Audio Mixer MultiMedia10" value="0" />
+ <ctl name="AFE_PCM_RX Audio Mixer MultiMedia10" value="0" />
+ <!-- VoIP over audio -->
+
<!-- ADSP testfwk -->
<ctl name="MI2S_DL_HL Switch" value="0" />
<!-- ADSP testfwk end-->
@@ -1309,7 +1318,68 @@
<ctl name="SpkrMono WSA_RDAC" value="Switch" />
</path>
- <path name="spkr-rx-calib">
+ <!-- VoIP Rx settings -->
+ <path name="audio-playback-voip">
+ <ctl name="PRI_MI2S_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip headphones">
+ <ctl name="PRI_MI2S_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco">
+ <ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco-wb">
+ <ctl name="BT SampleRate" value="KHZ_16" />
+ <path name="audio-playback-voip bt-sco" />
+ </path>
+
+ <path name="audio-playback-voip afe-proxy">
+ <ctl name="AFE_PCM_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip usb-headphones">
+ <path name="audio-playback-voip afe-proxy" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-usb-headphones">
+ <path name="audio-playback-voip usb-headphones" />
+ <path name="audio-playback-voip" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-headphones">
+ <path name="audio-playback-voip" />
+ </path>
+
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer TERT_MI2S_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer TERT_MI2S_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <path name="audio-record-voip bt-sco" />
+ </path>
+
+ <path name="audio-record-voip usb-headset-mic">
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
+ <path name="spkr-rx-calib">
<ctl name="PRI_MI2S_RX_DL_HL Switch" value="1" />
</path>
diff --git a/configs/msm8953/mixer_paths_sku3_tasha.xml b/configs/msm8953/mixer_paths_sku3_tasha.xml
index 7efefd2..8bc89e9 100644
--- a/configs/msm8953/mixer_paths_sku3_tasha.xml
+++ b/configs/msm8953/mixer_paths_sku3_tasha.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -546,6 +546,12 @@
<ctl name="SLIMBUS6_DL_HL Switch" value="0" />
<!-- ADSP testfwk end-->
+ <!-- VoIP over audio -->
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="0" />
+ <!-- VoIP over audio -->
+
<!-- These are audio route (FE to BE) specific mixer settings -->
<path name="deep-buffer-playback">
<ctl name="SLIMBUS_0_RX Audio Mixer MultiMedia1" value="1" />
@@ -1964,6 +1970,60 @@
<ctl name="SLIMBUS_5_TX LSM Function" value="AUDIO" />
</path>
+ <!-- VoIP Rx settings -->
+ <path name="audio-playback-voip">
+ <ctl name="SLIMBUS_0_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip headphones">
+ <ctl name="SLIMBUS_6_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco">
+ <ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco-wb">
+ <ctl name="BT SampleRate" value="KHZ_16" />
+ <path name="audio-playback-voip bt-sco" />
+ </path>
+
+ <path name="audio-playback-voip afe-proxy">
+ <ctl name="AFE_PCM_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip usb-headphones">
+ <path name="audio-playback-voip afe-proxy" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-usb-headphones">
+ <path name="audio-playback-voip usb-headphones" />
+ <path name="audio-playback-voip" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-headphones">
+ <path name="audio-playback-voip" />
+ </path>
+
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <ctl name="SLIM_1 SampleRate" value="16000" />
+ <path name="audio-record-voip bt-sco" />
+ </path>
+
+ <path name="audio-record-voip usb-headset-mic">
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
<path name="spkr-rx-calib">
<ctl name="SLIMBUS_DL_HL Switch" value="1" />
</path>
diff --git a/configs/msm8953/mixer_paths_sku4.xml b/configs/msm8953/mixer_paths_sku4.xml
index 91a4d1a..d171873 100644
--- a/configs/msm8953/mixer_paths_sku4.xml
+++ b/configs/msm8953/mixer_paths_sku4.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- Copyright (c) 2015, 2018, 2020 The Linux Foundation. All rights reserved.
+ Copyright (c) 2015, 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
@@ -270,6 +270,15 @@
<ctl name="MI2S_DL_HL Switch" value="0" />
<!-- ADSP testfwk end-->
+ <!-- VoIP over audio -->
+ <ctl name="MultiMedia10 Mixer TERT_MI2S_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="0" />
+ <ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia10" value="0" />
+ <ctl name="PRI_MI2S_RX Audio Mixer MultiMedia10" value="0" />
+ <ctl name="AFE_PCM_RX Audio Mixer MultiMedia10" value="0" />
+ <!-- VoIP over audio -->
+
<path name="bt-sco-wb-samplerate">
<ctl name="Internal BTSCO SampleRate" value="16000" />
</path>
@@ -1308,6 +1317,59 @@
<ctl name="SpkrMono WSA_RDAC" value="Switch" />
</path>
+ <!-- VoIP Rx settings -->
+ <path name="audio-playback-voip">
+ <ctl name="PRI_MI2S_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip headphones">
+ <ctl name="PRI_MI2S_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco">
+ <ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco-wb">
+ <ctl name="BT SampleRate" value="KHZ_16" />
+ <path name="audio-playback-voip bt-sco" />
+ </path>
+
+ <path name="audio-playback-voip afe-proxy">
+ <ctl name="AFE_PCM_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip usb-headphones">
+ <path name="audio-playback-voip afe-proxy" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-usb-headphones">
+ <path name="audio-playback-voip usb-headphones" />
+ <path name="audio-playback-voip" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-headphones">
+ <path name="audio-playback-voip" />
+ </path>
+
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer TERT_MI2S_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <path name="audio-record-voip bt-sco" />
+ </path>
+
+ <path name="audio-record-voip usb-headset-mic">
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
<path name="spkr-rx-calib">
<ctl name="PRI_MI2S_RX_DL_HL Switch" value="1" />
</path>
diff --git a/configs/msm8953/mixer_paths_tasha.xml b/configs/msm8953/mixer_paths_tasha.xml
index 1a2987c..948a88e 100644
--- a/configs/msm8953/mixer_paths_tasha.xml
+++ b/configs/msm8953/mixer_paths_tasha.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -571,6 +571,12 @@
<ctl name="SLIMBUS6_DL_HL Switch" value="0" />
<!-- ADSP testfwk end-->
+ <!-- VoIP over audio -->
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="0" />
+ <!-- VoIP over audio -->
+
<!-- These are audio route (FE to BE) specific mixer settings -->
<path name="deep-buffer-playback">
<ctl name="SLIMBUS_0_RX Audio Mixer MultiMedia1" value="1" />
@@ -2034,6 +2040,68 @@
<ctl name="SLIMBUS_5_TX LSM Function" value="AUDIO" />
</path>
+ <!-- VoIP Rx settings -->
+ <path name="audio-playback-voip">
+ <ctl name="SLIMBUS_0_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip headphones">
+ <ctl name="SLIMBUS_6_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco">
+ <ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco-wb">
+ <ctl name="BT SampleRate" value="KHZ_16" />
+ <path name="audio-playback-voip bt-sco" />
+ </path>
+
+ <path name="audio-playback-voip afe-proxy">
+ <ctl name="AFE_PCM_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip usb-headphones">
+ <path name="audio-playback-voip afe-proxy" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-usb-headphones">
+ <path name="audio-playback-voip usb-headphones" />
+ <path name="audio-playback-voip" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-headphones">
+ <path name="audio-playback-voip" />
+ </path>
+
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <ctl name="SLIM_1 SampleRate" value="16000" />
+ <path name="audio-record bt-sco" />
+ </path>
+
+ <path name="audio-record-voip usb-headset-mic">
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
<path name="spkr-rx-calib">
<ctl name="SLIMBUS_DL_HL Switch" value="1" />
</path>
diff --git a/configs/msm8953/mixer_paths_tashalite.xml b/configs/msm8953/mixer_paths_tashalite.xml
index 5efe6d3..923bff1 100644
--- a/configs/msm8953/mixer_paths_tashalite.xml
+++ b/configs/msm8953/mixer_paths_tashalite.xml
@@ -1,5 +1,5 @@
<?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 -->
@@ -553,6 +553,12 @@
<ctl name="SLIMBUS6_DL_HL Switch" value="0" />
<!-- ADSP testfwk end-->
+ <!-- VoIP over audio -->
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="0" />
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="0" />
+ <!-- VoIP over audio -->
+
<!-- These are audio route (FE to BE) specific mixer settings -->
<path name="deep-buffer-playback">
<ctl name="SLIMBUS_0_RX Audio Mixer MultiMedia1" value="1" />
@@ -2011,6 +2017,68 @@
<ctl name="SLIMBUS_5_TX LSM Function" value="AUDIO" />
</path>
+ <!-- VoIP Rx settings -->
+ <path name="audio-playback-voip">
+ <ctl name="SLIMBUS_0_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip headphones">
+ <ctl name="SLIMBUS_6_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco">
+ <ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip bt-sco-wb">
+ <ctl name="BT SampleRate" value="KHZ_16" />
+ <path name="audio-playback-voip bt-sco" />
+ </path>
+
+ <path name="audio-playback-voip afe-proxy">
+ <ctl name="AFE_PCM_RX Audio Mixer MultiMedia10" value="1" />
+ </path>
+
+ <path name="audio-playback-voip usb-headphones">
+ <path name="audio-playback-voip afe-proxy" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-usb-headphones">
+ <path name="audio-playback-voip usb-headphones" />
+ <path name="audio-playback-voip" />
+ </path>
+
+ <path name="audio-playback-voip speaker-and-headphones">
+ <path name="audio-playback-voip" />
+ </path>
+
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+ <!-- VoIP Tx settings -->
+ <path name="audio-record-voip">
+ <ctl name="MultiMedia10 Mixer SLIM_0_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco">
+ <ctl name="MultiMedia10 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-voip bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <ctl name="SLIM_1 SampleRate" value="16000" />
+ <path name="audio-record-voip bt-sco" />
+ </path>
+
+ <path name="audio-record-voip usb-headset-mic">
+ <ctl name="MultiMedia10 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
<path name="spkr-rx-calib">
<ctl name="SLIMBUS_DL_HL Switch" value="1" />
</path>
diff --git a/configs/msm8953/msm8953.mk b/configs/msm8953/msm8953.mk
index e68cc7e..3043a4c 100644
--- a/configs/msm8953/msm8953.mk
+++ b/configs/msm8953/msm8953.mk
@@ -8,7 +8,7 @@
#AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY := true
AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE := false
-AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
+AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := false
AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true
AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true
@@ -257,7 +257,7 @@
endor.audio.feature.spkr_prot.enable=true \
vendor.audio.feature.dsm_feedback.enable=false \
vendor.audio.feature.ssrec.enable=true \
-vendor.audio.feature.compr_voip.enable=true \
+vendor.audio.feature.compr_voip.enable=false \
vendor.audio.feature.kpi_optimize.enable=true \
vendor.audio.feature.usb_offload.enable=false \
vendor.audio.feature.usb_offload_burst_mode.enable=false \
diff --git a/configs/msmnile_au/audio_policy_configuration.xml b/configs/msmnile_au/audio_policy_configuration.xml
index 07b27d3..f4d867e 100644
--- a/configs/msmnile_au/audio_policy_configuration.xml
+++ b/configs/msmnile_au/audio_policy_configuration.xml
@@ -61,7 +61,11 @@
<item>Rear Seat Bus</item>
<item>Built-In Mic</item>
<item>Built-In Back Mic</item>
+ <item>Primary In Bus</item>
+ <item>Front Passenger In Bus</item>
+ <item>Rear Seat In Bus</item>
<item>FM Tuner</item>
+ <item>Echo Reference</item>
</attachedDevices>
<defaultOutputDevice>Media Bus</defaultOutputDevice>
<mixPorts>
@@ -216,6 +220,11 @@
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4"/>
</mixPort>
+ <mixPort name="fast input" role="sink" flags="AUDIO_INPUT_FLAG_FAST">
+ <profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
+ samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
+ channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
+ </mixPort>
<mixPort name="voice_rx" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
@@ -225,6 +234,15 @@
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
</mixPort>
+ <mixPort name="voip_tx" role="sink"
+ flags="AUDIO_INPUT_FLAG_VOIP_TX">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
+ </mixPort>
+ <mixPort name="echo_ref" role="sink">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
+ </mixPort>
</mixPorts>
<devicePorts>
@@ -380,7 +398,35 @@
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
</devicePort>
-
+ <devicePort tagName="Primary In Bus" type="AUDIO_DEVICE_IN_BUS" role="source" address="BUS04_INPUT">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="Front Passenger In Bus" type="AUDIO_DEVICE_IN_BUS" role="source" address="BUS09_INPUT_FRONT_PASSENGER">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="Rear Seat In Bus" type="AUDIO_DEVICE_IN_BUS" role="source" address="BUS17_INPUT_REAR_SEAT">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="Echo Reference" type="AUDIO_DEVICE_IN_ECHO_REFERENCE" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="16000,48000"
+ channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
+ </devicePort>
</devicePorts>
<!-- route declaration, i.e. list all available sources for a given sink -->
<routes>
@@ -420,10 +466,16 @@
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
<route type="mix" sink="Telephony Tx"
sources="voice_tx,incall_music_uplink"/>
+ <route type="mix" sink="primary input"
+ sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Primary In Bus,Front Passenger In Bus,Rear Seat In Bus"/>
+ <route type="mix" sink="fast input"
+ sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic"/>
<route type="mix" sink="voice_rx"
sources="Telephony Rx"/>
<route type="mix" sink="primary input"
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
+ <route type="mix" sink="echo_ref"
+ sources="Echo Reference"/>
<route type="mix" sink="voip_tx"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic"/>
<route type="mix" sink="record_24"
diff --git a/configs/msmnile_au/mixer_paths_adp.xml b/configs/msmnile_au/mixer_paths_adp.xml
index 3c21e2e..8761181 100644
--- a/configs/msmnile_au/mixer_paths_adp.xml
+++ b/configs/msmnile_au/mixer_paths_adp.xml
@@ -1371,6 +1371,10 @@
<ctl name="MultiMedia1 Mixer TERT_TDM_TX_0" value="1" />
</path>
+ <path name="echo-reference-external">
+ <ctl name="MultiMedia2 Mixer SEC_TDM_TX_0" value="1" />
+ </path>
+
<path name="audio-record-compress">
<ctl name="TERT_TDM_TX_0 Channels" value="One" />
<ctl name="MultiMedia8 Mixer TERT_TDM_TX_0" value="1" />
diff --git a/configs/msmnile_au/msmnile_au.mk b/configs/msmnile_au/msmnile_au.mk
index 8e7f833..2d47885 100644
--- a/configs/msmnile_au/msmnile_au.mk
+++ b/configs/msmnile_au/msmnile_au.mk
@@ -101,6 +101,9 @@
endif
AUDIO_FEATURE_ENABLED_FM_TUNER_EXT := true
AUDIO_FEATURE_ENABLED_ICC := true
+ifneq ( ,$(filter S 12, $(PLATFORM_VERSION)))
+AUDIO_FEATURE_ENABLED_POWER_POLICY := true
+endif
##AUTOMOTIVE_AUDIO_FEATURE_FLAGS
ifneq ($(strip $(TARGET_USES_RRO)), true)
@@ -390,7 +393,8 @@
vendor.audio.feature.audiozoom.enable=false \
vendor.audio.feature.snd_mon.enable=false \
vendor.audio.feature.auto_hal.enable=true \
-vendor.audio.feature.synth.enable=true
+vendor.audio.feature.synth.enable=true \
+vendor.audio.feature.powerpolicy.enable=true
else
# Non-Generic ODM varient related
PRODUCT_ODM_PROPERTIES += \
@@ -437,7 +441,8 @@
vendor.audio.feature.audiozoom.enable=false \
vendor.audio.feature.snd_mon.enable=false \
vendor.audio.feature.auto_hal.enable=true \
-vendor.audio.feature.synth.enable=true
+vendor.audio.feature.synth.enable=true \
+vendor.audio.feature.powerpolicy.enable=true
endif
# for HIDL related packages
@@ -483,15 +488,6 @@
android.hardware.automotive.audiocontrol@2.0-service \
android.hardware.automotive.audiocontrol@2.0
-# enable sound trigger hidl hal 2.2
-PRODUCT_PACKAGES += \
- android.hardware.soundtrigger@2.2-impl \
-
-# enable sound trigger hidl hal 2.3
-PRODUCT_PACKAGES += \
- android.hardware.soundtrigger@2.3-impl \
-
-
ifeq ($(ENABLE_HYP),true)
PRODUCT_PROPERTY_OVERRIDES += \
persist.vendor.audio.calfile0=/vendor/etc/acdbdata/adsp_avs_config.acdb\
diff --git a/configs/msmsteppe_au/audio_policy_configuration.xml b/configs/msmsteppe_au/audio_policy_configuration.xml
index e85abe1..658c238 100644
--- a/configs/msmsteppe_au/audio_policy_configuration.xml
+++ b/configs/msmsteppe_au/audio_policy_configuration.xml
@@ -61,7 +61,11 @@
<item>Rear Seat Bus</item>
<item>Built-In Mic</item>
<item>Built-In Back Mic</item>
+ <item>Primary In Bus</item>
+ <item>Front Passenger In Bus</item>
+ <item>Rear Seat In Bus</item>
<item>FM Tuner</item>
+ <item>Echo Reference</item>
</attachedDevices>
<defaultOutputDevice>Media Bus</defaultOutputDevice>
<mixPorts>
@@ -216,6 +220,11 @@
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3,AUDIO_CHANNEL_INDEX_MASK_4"/>
</mixPort>
+ <mixPort name="fast input" role="sink" flags="AUDIO_INPUT_FLAG_FAST">
+ <profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT"
+ samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
+ channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
+ </mixPort>
<mixPort name="voice_rx" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
@@ -225,6 +234,15 @@
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/>
</mixPort>
+ <mixPort name="voip_tx" role="sink"
+ flags="AUDIO_INPUT_FLAG_VOIP_TX">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
+ </mixPort>
+ <mixPort name="echo_ref" role="sink">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
+ </mixPort>
</mixPorts>
<devicePorts>
@@ -380,7 +398,35 @@
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
</devicePort>
-
+ <devicePort tagName="Primary In Bus" type="AUDIO_DEVICE_IN_BUS" role="source" address="BUS04_INPUT">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="Front Passenger In Bus" type="AUDIO_DEVICE_IN_BUS" role="source" address="BUS09_INPUT_FRONT_PASSENGER">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="Rear Seat In Bus" type="AUDIO_DEVICE_IN_BUS" role="source" address="BUS17_INPUT_REAR_SEAT">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
+ <gains>
+ <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+ minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+ </gains>
+ </devicePort>
+ <devicePort tagName="Echo Reference" type="AUDIO_DEVICE_IN_ECHO_REFERENCE" role="source">
+ <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+ samplingRates="16000,48000"
+ channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/>
+ </devicePort>
</devicePorts>
<!-- route declaration, i.e. list all available sources for a given sink -->
<routes>
@@ -420,10 +466,16 @@
sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/>
<route type="mix" sink="Telephony Tx"
sources="voice_tx,incall_music_uplink"/>
+ <route type="mix" sink="primary input"
+ sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,Primary In Bus,Front Passenger In Bus,Rear Seat In Bus"/>
+ <route type="mix" sink="fast input"
+ sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic"/>
<route type="mix" sink="voice_rx"
sources="Telephony Rx"/>
<route type="mix" sink="primary input"
sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
+ <route type="mix" sink="echo_ref"
+ sources="Echo Reference"/>
<route type="mix" sink="voip_tx"
sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic"/>
<route type="mix" sink="record_24"
diff --git a/configs/msmsteppe_au/mixer_paths_adp.xml b/configs/msmsteppe_au/mixer_paths_adp.xml
index 2dfca35..a881aee 100644
--- a/configs/msmsteppe_au/mixer_paths_adp.xml
+++ b/configs/msmsteppe_au/mixer_paths_adp.xml
@@ -1208,6 +1208,10 @@
<ctl name="MultiMedia1 Mixer TERT_TDM_TX_0" value="1" />
</path>
+ <path name="echo-reference-external">
+ <ctl name="MultiMedia2 Mixer SEC_TDM_TX_0" value="1" />
+ </path>
+
<path name="audio-record-compress">
<ctl name="TERT_TDM_TX_0 Channels" value="One" />
<ctl name="MultiMedia8 Mixer TERT_TDM_TX_0" value="1" />
diff --git a/configs/msmsteppe_au/msmsteppe_au.mk b/configs/msmsteppe_au/msmsteppe_au.mk
index 5e083bb..9d990a5 100644
--- a/configs/msmsteppe_au/msmsteppe_au.mk
+++ b/configs/msmsteppe_au/msmsteppe_au.mk
@@ -84,6 +84,9 @@
endif
AUDIO_FEATURE_ENABLED_FM_TUNER_EXT := true
AUDIO_FEATURE_ENABLED_ICC := true
+ifneq ( ,$(filter S 12, $(PLATFORM_VERSION)))
+AUDIO_FEATURE_ENABLED_POWER_POLICY := true
+endif
##AUTOMOTIVE_AUDIO_FEATURE_FLAGS
ifneq ($(strip $(TARGET_USES_RRO)), true)
@@ -366,7 +369,8 @@
vendor.audio.feature.audiozoom.enable=false \
vendor.audio.feature.snd_mon.enable=false \
vendor.audio.feature.auto_hal.enable=true \
-vendor.audio.feature.synth.enable=true
+vendor.audio.feature.synth.enable=true \
+vendor.audio.feature.powerpolicy.enable=true
else
# Non-Generic ODM varient related
PRODUCT_ODM_PROPERTIES += \
@@ -413,7 +417,8 @@
vendor.audio.feature.audiozoom.enable=false \
vendor.audio.feature.snd_mon.enable=false \
vendor.audio.feature.auto_hal.enable=true \
-vendor.audio.feature.synth.enable=true
+vendor.audio.feature.synth.enable=true \
+vendor.audio.feature.powerpolicy.enable=true
endif
# for HIDL related packages
diff --git a/hal/acdb.h b/hal/acdb.h
index e1ab942..4db8c60 100644
--- a/hal/acdb.h
+++ b/hal/acdb.h
@@ -66,6 +66,8 @@
typedef int (*acdb_reload_t) (char *, char *, char *, int);
typedef int (*acdb_reload_v2_t) (char *, char *, char *, struct listnode *);
typedef int (*acdb_send_gain_dep_cal_t)(int, int, int, int, int);
+typedef void (*acdb_set_fluence_nn_state_t)(bool);
+typedef bool (*acdb_get_fluence_nn_state_t)();
struct meta_key_list {
struct listnode list;
diff --git a/hal/audio_extn/Android.mk b/hal/audio_extn/Android.mk
index aba6592..bc8392d 100755
--- a/hal/audio_extn/Android.mk
+++ b/hal/audio_extn/Android.mk
@@ -1139,3 +1139,41 @@
endif
include $(BUILD_SHARED_LIBRARY)
endif
+#-------------------------------------------
+
+# Build Power_Policy_Client LIB
+#-------------------------------------------
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_POWER_POLICY)),true)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libaudiopowerpolicy
+
+LOCAL_VENDOR_MODULE := true
+
+LOCAL_SRC_FILES:= \
+ PowerPolicyClient.cpp \
+ power_policy_launcher.cpp
+
+LOCAL_C_INCLUDES:= \
+ vendor/qcom/opensource/audio-hal/primary-hal/hal \
+ system/media/audio/include
+
+LOCAL_SHARED_LIBRARIES:= \
+ android.frameworks.automotive.powerpolicy-V1-ndk_platform \
+ libbase \
+ libbinder_ndk \
+ libcutils \
+ liblog \
+ libpowerpolicyclient
+
+ifneq ($(filter kona lahaina holi,$(TARGET_BOARD_PLATFORM)),)
+LOCAL_SANITIZE := integer_overflow
+endif
+
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DAEMON_SUPPORT)),true)
+ LOCAL_CFLAGS += -DDAEMON_SUPPORT_AUTO
+endif
+
+include $(BUILD_SHARED_LIBRARY)
+endif
diff --git a/hal/audio_extn/PowerPolicyClient.cpp b/hal/audio_extn/PowerPolicyClient.cpp
new file mode 100644
index 0000000..e3a9e22
--- /dev/null
+++ b/hal/audio_extn/PowerPolicyClient.cpp
@@ -0,0 +1,117 @@
+/* Copyright (c) 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
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
+
+#include "PowerPolicyClient.h"
+
+#include <android-base/logging.h>
+#include <dlfcn.h>
+
+#ifdef DAEMON_SUPPORT_AUTO
+#define LIB_AUDIO_HAL_PLUGIN "libaudiohalpluginclient.so"
+#else
+#define LIB_AUDIO_HAL_PLUGIN "libaudiohalplugin.so"
+#endif
+
+namespace aafap = aidl::android::frameworks::automotive::powerpolicy;
+
+using aafap::CarPowerPolicy;
+using aafap::CarPowerPolicyFilter;
+using aafap::PowerComponent;
+using ::android::frameworks::automotive::powerpolicy::hasComponent;
+using ::ndk::ScopedAStatus;
+
+namespace {
+
+constexpr PowerComponent kAudioComponent = PowerComponent::AUDIO;
+constexpr PowerComponent kMicComponent = PowerComponent::MICROPHONE;
+
+} // namespace
+
+PowerPolicyClient::PowerPolicyClient() {
+ plugin_handle = dlopen(LIB_AUDIO_HAL_PLUGIN, RTLD_NOW);
+ if (plugin_handle == NULL) {
+ LOG(ERROR) << "Failed to open plugin library";
+ return;
+ }
+
+ hal_plugin_send_msg = (hal_plugin_send_msg_t) dlsym(plugin_handle,
+ "audio_hal_plugin_send_msg");
+ if (hal_plugin_send_msg == NULL) {
+ LOG(ERROR) << "dlsym failed for audio_hal_plugin_send_msg";
+ dlclose(plugin_handle);
+ plugin_handle = NULL;
+ }
+
+ LOG(ERROR) << "PowerPolicyClient Initialzed";
+}
+
+PowerPolicyClient::~PowerPolicyClient() {
+ if (plugin_handle != NULL)
+ dlclose(plugin_handle);
+}
+
+void PowerPolicyClient::onInitFailed() {
+ LOG(ERROR) << "Initializing power policy client failed";
+}
+
+std::vector<PowerComponent> PowerPolicyClient::getComponentsOfInterest() {
+ std::vector<PowerComponent> components{kAudioComponent, kMicComponent};
+ return components;
+}
+
+ScopedAStatus PowerPolicyClient::onPolicyChanged(const CarPowerPolicy& powerPolicy) {
+ uint8_t disable = 0;
+
+ if (hasComponent(powerPolicy.enabledComponents, kAudioComponent)) {
+ LOG(ERROR) << "Power policy: Audio component is enabled";
+ disable = 0;
+ if (hal_plugin_send_msg != NULL)
+ hal_plugin_send_msg(AUDIO_HAL_PLUGIN_MSG_SILENT_MODE,
+ &disable, sizeof(disable));
+ } else if (hasComponent(powerPolicy.disabledComponents, kAudioComponent)) {
+ LOG(ERROR) << "Power policy: Audio component is disabled";
+ disable = 1;
+ if (hal_plugin_send_msg != NULL)
+ hal_plugin_send_msg(AUDIO_HAL_PLUGIN_MSG_SILENT_MODE,
+ &disable, sizeof(disable));
+ }
+
+ if (hasComponent(powerPolicy.enabledComponents, kMicComponent)) {
+ LOG(ERROR) << "Power policy: Microphone component is enabled";
+ disable = 0;
+ if (hal_plugin_send_msg != NULL)
+ hal_plugin_send_msg(AUDIO_HAL_PLUGIN_MSG_MIC_STATE,
+ &disable, sizeof(disable));
+ } else if (hasComponent(powerPolicy.disabledComponents, kMicComponent)) {
+ disable = 1;
+ if (hal_plugin_send_msg != NULL)
+ hal_plugin_send_msg(AUDIO_HAL_PLUGIN_MSG_MIC_STATE,
+ &disable, sizeof(disable));
+ LOG(ERROR) << "Power policy: Microphone component is disabled";
+ }
+ return ScopedAStatus::ok();
+}
diff --git a/hal/audio_extn/PowerPolicyClient.h b/hal/audio_extn/PowerPolicyClient.h
new file mode 100644
index 0000000..da0b434
--- /dev/null
+++ b/hal/audio_extn/PowerPolicyClient.h
@@ -0,0 +1,53 @@
+/* Copyright (c) 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
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
+
+#ifndef QTI_AUDIO_POWERPOLICYCLIENT_H_
+#define QTI_AUDIO_POWERPOLICYCLIENT_H_
+
+#include "PowerPolicyClientBase.h"
+#include "audio_hal_plugin.h"
+
+typedef int32_t (*hal_plugin_send_msg_t) (audio_hal_plugin_msg_type_t, void*, uint32_t);
+
+class PowerPolicyClient
+ : public ::android::frameworks::automotive::powerpolicy::PowerPolicyClientBase {
+ public:
+ explicit PowerPolicyClient();
+ ~PowerPolicyClient();
+
+ void onInitFailed();
+ std::vector<::aidl::android::frameworks::automotive::powerpolicy::PowerComponent>
+ getComponentsOfInterest() override;
+ ::ndk::ScopedAStatus onPolicyChanged(
+ const ::aidl::android::frameworks::automotive::powerpolicy::CarPowerPolicy&) override;
+
+ private:
+ void* plugin_handle;
+ hal_plugin_send_msg_t hal_plugin_send_msg;
+};
+
+#endif // QTI_AUDIO_POWERPOLICYCLIENT_H_
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index d3b2935..d874656 100755
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -6096,6 +6096,9 @@
typedef int (*auto_hal_open_input_stream_t)(struct stream_in*);
static auto_hal_open_input_stream_t auto_hal_open_input_stream;
+typedef int (*auto_hal_open_echo_reference_stream_t)(struct stream_in*);
+static auto_hal_open_echo_reference_stream_t auto_hal_open_echo_reference_stream;
+
typedef bool (*auto_hal_is_bus_device_usecase_t)(audio_usecase_t);
static auto_hal_is_bus_device_usecase_t auto_hal_is_bus_device_usecase;
@@ -6131,6 +6134,9 @@
car_audio_stream);
static auto_hal_get_snd_device_for_car_audio_stream_t auto_hal_get_snd_device_for_car_audio_stream;
+typedef bool (*auto_hal_overwrite_priority_for_auto_t)(struct stream_in*);
+static auto_hal_overwrite_priority_for_auto_t auto_hal_overwrite_priority_for_auto;
+
int auto_hal_feature_init(bool is_feature_enabled)
{
ALOGD("%s: Called with feature %s", __func__,
@@ -6163,6 +6169,9 @@
!(auto_hal_open_input_stream =
(auto_hal_open_input_stream_t)dlsym(
auto_hal_lib_handle, "auto_hal_open_input_stream")) ||
+ !(auto_hal_open_echo_reference_stream =
+ (auto_hal_open_echo_reference_stream_t)dlsym(
+ auto_hal_lib_handle, "auto_hal_open_echo_reference_stream")) ||
!(auto_hal_is_bus_device_usecase =
(auto_hal_is_bus_device_usecase_t)dlsym(
auto_hal_lib_handle, "auto_hal_is_bus_device_usecase")) ||
@@ -6189,7 +6198,10 @@
auto_hal_lib_handle, "auto_hal_get_output_snd_device")) ||
!(auto_hal_get_snd_device_for_car_audio_stream =
(auto_hal_get_snd_device_for_car_audio_stream_t)dlsym(
- auto_hal_lib_handle, "auto_hal_get_snd_device_for_car_audio_stream"))) {
+ auto_hal_lib_handle, "auto_hal_get_snd_device_for_car_audio_stream")) ||
+ !(auto_hal_overwrite_priority_for_auto =
+ (auto_hal_overwrite_priority_for_auto_t)dlsym(
+ auto_hal_lib_handle, "auto_hal_overwrite_priority_for_auto"))) {
ALOGE("%s: dlsym failed", __func__);
goto feature_disabled;
}
@@ -6210,6 +6222,7 @@
auto_hal_get_car_audio_stream_from_address = NULL;
auto_hal_open_output_stream = NULL;
auto_hal_open_input_stream = NULL;
+ auto_hal_open_echo_reference_stream = NULL;
auto_hal_is_bus_device_usecase = NULL;
auto_hal_get_audio_port = NULL;
auto_hal_set_audio_port_config = NULL;
@@ -6219,6 +6232,7 @@
auto_hal_get_input_snd_device = NULL;
auto_hal_get_output_snd_device = NULL;
auto_hal_get_snd_device_for_car_audio_stream = NULL;
+ auto_hal_overwrite_priority_for_auto = NULL;
ALOGW(":: %s: ---- Feature AUTO_HAL is disabled ----", __func__);
return -ENOSYS;
@@ -6293,6 +6307,12 @@
auto_hal_open_input_stream(in): -ENOSYS);
}
+int audio_extn_auto_hal_open_echo_reference_stream(struct stream_in *in)
+{
+ return ((auto_hal_open_echo_reference_stream) ?
+ auto_hal_open_echo_reference_stream(in): 0);
+}
+
bool audio_extn_auto_hal_is_bus_device_usecase(audio_usecase_t uc_id)
{
return ((auto_hal_is_bus_device_usecase) ?
@@ -6353,6 +6373,13 @@
return ((auto_hal_get_snd_device_for_car_audio_stream) ?
auto_hal_get_snd_device_for_car_audio_stream(car_audio_stream): SND_DEVICE_NONE);
}
+
+bool audio_extn_auto_hal_overwrite_priority_for_auto(struct stream_in *in)
+{
+ return ((auto_hal_overwrite_priority_for_auto) ?
+ auto_hal_overwrite_priority_for_auto(in): false);
+}
+
// END: AUTO_HAL ===================================================================
// START: Synth ======================================================================
@@ -6438,7 +6465,75 @@
// END: Synth ========================================================================
+// START: Power Policy Client ======================================================================
+#ifdef __LP64__
+#define POWER_POLICY_LIB_PATH "/vendor/lib64/libaudiopowerpolicy.so"
+#else
+#define POWER_POLICY_LIB_PATH "/vendor/lib/libaudiopowerpolicy.so"
+#endif
+static void* power_policy_lib_handle;
+typedef int (*launch_power_policy_t) ();
+static launch_power_policy_t launch_power_policy;
+
+static void* power_policy_thread_func(void* arg __unused) {
+ if (launch_power_policy == NULL) {
+ ALOGE("%s: Power Policy launcher is NULL", __func__);
+ goto exit;
+ }
+ ALOGD("%s: Launching Power Policy Client", __func__);
+ launch_power_policy();
+
+exit:
+ pthread_exit(NULL);
+}
+
+static int power_policy_feature_init(bool is_feature_enabled)
+{
+ pthread_t tid;
+ pthread_attr_t attr;
+
+ ALOGD("%s: Called with feature %s", __func__,
+ is_feature_enabled ? "Enabled" : "NOT Enabled");
+ if (is_feature_enabled) {
+ // dlopen lib
+ power_policy_lib_handle = dlopen(POWER_POLICY_LIB_PATH, RTLD_NOW);
+
+ if (!power_policy_lib_handle) {
+ ALOGE("%s: dlopen failed", __func__);
+ goto feature_disabled;
+ }
+ if (!(launch_power_policy = (launch_power_policy_t)dlsym(
+ power_policy_lib_handle, "launchPowerPolicyClient")))
+ {
+ ALOGE("%s: dlsym failed", __func__);
+ goto feature_disabled;
+ }
+
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ if (pthread_create(&tid, &attr, power_policy_thread_func, NULL))
+ {
+ ALOGE("%s: Failed to create power policy thread", __func__);
+ goto feature_disabled;
+ }
+ ALOGD("%s:: ---- Feature Power Policy Client is Enabled ----", __func__);
+ return 0;
+ }
+
+feature_disabled:
+ if (power_policy_lib_handle) {
+ dlclose(power_policy_lib_handle);
+ power_policy_lib_handle = NULL;
+ }
+
+ launch_power_policy = NULL;
+
+ ALOGW(":: %s: ---- Feature Power Policy Client is disabled ----", __func__);
+ return -ENOSYS;
+
+// END: Power Policy Client ======================================================================
+}
void audio_extn_feature_init()
{
vendor_enhanced_info = audio_extn_utils_get_vendor_enhanced_info();
@@ -6563,6 +6658,9 @@
synth_feature_init(
property_get_bool("vendor.audio.feature.synth.enable",
false));
+ power_policy_feature_init(
+ property_get_bool("vendor.audio.feature.powerpolicy.enable",
+ false));
}
void audio_extn_set_parameters(struct audio_device *adev,
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 64b77e8..efba4bb 100755
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -1373,6 +1373,8 @@
int audio_extn_auto_hal_get_car_audio_stream_from_address(const char *address);
int audio_extn_auto_hal_open_output_stream(struct stream_out *out);
int audio_extn_auto_hal_open_input_stream(struct stream_in *in);
+int audio_extn_auto_hal_open_echo_reference_stream(struct stream_in *in);
+bool audio_extn_auto_hal_overwrite_priority_for_auto(struct stream_in *in);
bool audio_extn_auto_hal_is_bus_device_usecase(audio_usecase_t uc_id);
int audio_extn_auto_hal_get_audio_port(struct audio_hw_device *dev,
struct audio_port *config);
diff --git a/hal/audio_extn/auto_hal.c b/hal/audio_extn/auto_hal.c
index 39f2838..977147c 100755
--- a/hal/audio_extn/auto_hal.c
+++ b/hal/audio_extn/auto_hal.c
@@ -336,6 +336,25 @@
return ret;
}
+/*
+ * Function: auto_hal_open_echo_reference_stream
+ * ---------------------------------------------
+ * opens an input stream to capture an echo reference
+ * and sets for external echo reference
+ *
+ * param *in: stream to be used for echo reference
+ *
+ * returns: 0
+ */
+int auto_hal_open_echo_reference_stream(struct stream_in *in)
+{
+ /* note: this function may be expanded in the future
+ to accommodate other echo reference sources
+ such as an internal AFE loopback. */
+ in->usecase = USECASE_AUDIO_RECORD_ECHO_REF_EXT;
+ return 0;
+}
+
int auto_hal_open_output_stream(struct stream_out *out)
{
int ret = 0;
@@ -467,6 +486,17 @@
return snd_device;
}
+bool auto_hal_overwrite_priority_for_auto(struct stream_in *in)
+{
+ /* Don't use the priority_in stream when the source is
+ * AUDIO_SOURCE_ECHO_REFERENCE because the platform_get_input_snd_device
+ * call (below) needs to set the snd_device based the echo ref stream and
+ * NOT based on higher priority streams (such as concurrent recording
+ * streams from the mic) */
+
+ return (in->source == AUDIO_SOURCE_ECHO_REFERENCE);
+}
+
int auto_hal_get_audio_port(struct audio_hw_device *dev __unused,
struct audio_port *config __unused)
{
diff --git a/hal/audio_extn/ext_hw_plugin.c b/hal/audio_extn/ext_hw_plugin.c
index 571ba54..5f21c3f 100644
--- a/hal/audio_extn/ext_hw_plugin.c
+++ b/hal/audio_extn/ext_hw_plugin.c
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
+* Copyright (c) 2014-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
@@ -182,6 +182,7 @@
case USECASE_AUDIO_RECORD_COMPRESS:
case USECASE_AUDIO_RECORD_LOW_LATENCY:
case USECASE_AUDIO_RECORD_FM_VIRTUAL:
+ case USECASE_AUDIO_RECORD_ECHO_REF_EXT:
*plugin_usecase = AUDIO_HAL_PLUGIN_USECASE_DEFAULT_CAPTURE;
break;
case USECASE_AUDIO_HFP_SCO:
diff --git a/hal/audio_extn/power_policy_launcher.cpp b/hal/audio_extn/power_policy_launcher.cpp
new file mode 100644
index 0000000..a85f30c
--- /dev/null
+++ b/hal/audio_extn/power_policy_launcher.cpp
@@ -0,0 +1,51 @@
+/* Copyright (c) 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
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
+
+#include "PowerPolicyClient.h"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <log/log.h>
+
+extern "C" {
+
+ int launchPowerPolicyClient() {
+ ALOGD("%s: power policy launcher called", __func__);
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+ std::shared_ptr<PowerPolicyClient> powerPolicyClient =
+ ::ndk::SharedRefBase::make<PowerPolicyClient>();
+ ALOGD("%s:Instantiating power policy client from launcher", __func__);
+ powerPolicyClient->init();
+ ALOGD("%s: Power Policy class inited, joining threadpool", __func__);
+
+ ABinderProcess_joinThreadPool();
+
+ LOG(ERROR) << "Error in PowerPolicyClient binder thread";
+ return EXIT_FAILURE; // should not reach
+ }
+}
diff --git a/hal/audio_extn/soundtrigger.c b/hal/audio_extn/soundtrigger.c
index a97ccf0..330c9cb 100644
--- a/hal/audio_extn/soundtrigger.c
+++ b/hal/audio_extn/soundtrigger.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, 2016-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, 2016-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
@@ -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 (st_dev->adev->mode == AUDIO_MODE_IN_CALL) {
+ if (voice_is_call_state_active_in_call(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_hal_plugin.h b/hal/audio_hal_plugin.h
index 3d77b23..1f56a2f 100644
--- a/hal/audio_hal_plugin.h
+++ b/hal/audio_hal_plugin.h
@@ -87,6 +87,7 @@
AUDIO_HAL_PLUGIN_MSG_CODEC_GET_PP_EQ_SUBBANDS, /**< get EQ subbands params */
AUDIO_HAL_PLUGIN_MSG_CODEC_TUNNEL_GET_CMD, /**< pass through get cmds */
AUDIO_HAL_PLUGIN_MSG_SILENT_MODE, /**<set silent boot mode */
+ AUDIO_HAL_PLUGIN_MSG_MIC_STATE, /**< enable or disable codec mic */
AUDIO_HAL_PLUGIN_MSG_MAX
} audio_hal_plugin_msg_type_t;
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 83c35c7..166cd15 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -428,6 +428,7 @@
[USECASE_AUDIO_RECORD_BUS_FRONT_PASSENGER] = "front-passenger-record",
[USECASE_AUDIO_RECORD_BUS_REAR_SEAT] = "rear-seat-record",
[USECASE_AUDIO_PLAYBACK_SYNTHESIZER] = "synth-loopback",
+ [USECASE_AUDIO_RECORD_ECHO_REF_EXT] = "echo-reference-external",
};
static const audio_usecase_t offload_usecases[] = {
@@ -1273,6 +1274,13 @@
snd_device = usecase->out_snd_device;
}
+ if (usecase->type == PCM_CAPTURE) {
+ if (platform_get_fluence_nn_state(adev->platform) == 0) {
+ platform_set_fluence_nn_state(adev->platform, true);
+ ALOGD("%s: set fluence nn capture state", __func__);
+ }
+ }
+
#ifdef DS1_DOLBY_DAP_ENABLED
audio_extn_dolby_set_dmid(adev);
audio_extn_dolby_set_endpoint(adev);
@@ -1291,6 +1299,14 @@
}
if (usecase->type == PCM_CAPTURE) {
+ if (platform_get_fluence_nn_state(adev->platform) == 1 &&
+ adev->fluence_nn_usecase_id == USECASE_INVALID ) {
+ adev->fluence_nn_usecase_id = usecase->id;
+ ALOGD("%s: assign fluence nn usecase %d", __func__, usecase->id);
+ }
+ }
+
+ if (usecase->type == PCM_CAPTURE) {
in = usecase->stream.in;
if (in && is_loopback_input_device(get_device_types(&in->device_list))) {
ALOGD("%s: set custom mtmx params v1", __func__);
@@ -1376,6 +1392,11 @@
in->ec_opened = false;
}
}
+ if (usecase->id == adev->fluence_nn_usecase_id) {
+ platform_set_fluence_nn_state(adev->platform, false);
+ adev->fluence_nn_usecase_id = USECASE_INVALID;
+ ALOGD("%s: reset fluence nn capture state", __func__);
+ }
audio_extn_sound_trigger_update_stream_status(usecase, ST_EVENT_STREAM_FREE);
audio_extn_listen_update_stream_status(usecase, LISTEN_EVENT_STREAM_FREE);
@@ -2884,7 +2905,8 @@
/* get the input with the highest priority source*/
priority_in = get_priority_input(adev);
- if (!priority_in)
+ if (!priority_in ||
+ audio_extn_auto_hal_overwrite_priority_for_auto(usecase->stream.in))
priority_in = usecase->stream.in;
}
if (compare_device_type(&usecase->device_list, AUDIO_DEVICE_IN_BUS)){
@@ -3426,6 +3448,7 @@
pthread_mutex_lock(&out->latch_lock);
out->offload_state = OFFLOAD_STATE_IDLE;
pthread_mutex_unlock(&out->latch_lock);
+
out->playback_started = 0;
out->send_new_metadata = 1;
if (out->compr != NULL) {
@@ -7749,6 +7772,7 @@
#ifdef AUDIO_GKI_ENABLED
__s32 *generic_dec;
#endif
+ pthread_mutexattr_t latch_attr;
if (is_usb_dev && (!audio_extn_usb_connected(NULL))) {
is_usb_dev = false;
@@ -7778,7 +7802,10 @@
pthread_mutex_init(&out->lock, (const pthread_mutexattr_t *) NULL);
pthread_mutex_init(&out->pre_lock, (const pthread_mutexattr_t *) NULL);
- pthread_mutex_init(&out->latch_lock, (const pthread_mutexattr_t *) NULL);
+ pthread_mutexattr_init(&latch_attr);
+ pthread_mutexattr_settype(&latch_attr, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&out->latch_lock, &latch_attr);
+ pthread_mutexattr_destroy(&latch_attr);
pthread_mutex_init(&out->position_query_lock, (const pthread_mutexattr_t *) NULL);
pthread_cond_init(&out->cond, (const pthread_condattr_t *) NULL);
@@ -8759,12 +8786,14 @@
struct listnode *node;
list_for_each(node, &adev->usecase_list) {
usecase = node_to_item(node, struct audio_usecase, list);
- if (usecase->stream.in && (usecase->type == PCM_CAPTURE) &&
+ if (usecase->stream.in && (usecase->type == PCM_CAPTURE ||
+ usecase->type == VOICE_CALL) &&
(!is_btsco_device(SND_DEVICE_NONE, usecase->in_snd_device))) {
ALOGD("BT_SCO ON, switch all in use case to it");
select_devices(adev, usecase->id);
}
- if (usecase->stream.out && (usecase->type == PCM_PLAYBACK) &&
+ if (usecase->stream.out && (usecase->type == PCM_PLAYBACK ||
+ usecase->type == VOICE_CALL) &&
(!is_btsco_device(usecase->out_snd_device, SND_DEVICE_NONE))) {
ALOGD("BT_SCO ON, switch all out use case to it");
select_devices(adev, usecase->id);
@@ -9480,6 +9509,11 @@
}
}
+ /* reassign use case for echo reference stream on automotive platforms */
+ if (in->source == AUDIO_SOURCE_ECHO_REFERENCE) {
+ ret = audio_extn_auto_hal_open_echo_reference_stream(in);
+ }
+
if (in->source == AUDIO_SOURCE_FM_TUNER) {
if(!get_usecase_from_list(adev, USECASE_AUDIO_RECORD_FM_VIRTUAL))
in->usecase = USECASE_AUDIO_RECORD_FM_VIRTUAL;
@@ -10455,10 +10489,12 @@
if (out->offload_state == OFFLOAD_STATE_PLAYING)
compress_pause(out->compr);
out_set_compr_volume(&out->stream, (float)0, (float)0);
- } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
- out_set_voip_volume(&out->stream, (float)0, (float)0);
} else {
- out_set_pcm_volume(&out->stream, (float)0, (float)0);
+ if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP)
+ out_set_voip_volume(&out->stream, (float)0, (float)0);
+ else
+ out_set_pcm_volume(&out->stream, (float)0, (float)0);
+
/* wait for stale pcm drained before switching to speaker */
uint32_t latency =
(out->config.period_count * out->config.period_size * 1000) /
@@ -10723,6 +10759,7 @@
adev->enable_voicerx = false;
adev->bt_wb_speech_enabled = false;
adev->swb_speech_mode = SPEECH_MODE_INVALID;
+ adev->fluence_nn_usecase_id = USECASE_INVALID;
//initialize this to false for now,
//this will be set to true through set param
adev->vr_audio_mode_enabled = false;
@@ -10752,8 +10789,7 @@
configured_low_latency_capture_period_size = trial;
}
}
- if ((property_get("vendor.audio_hal.in_period_size", value, NULL) > 0) ||
- (property_get("audio_hal.in_period_size", value, NULL) > 0)) {
+ if (property_get("vendor.audio_hal.in_period_size", value, NULL) > 0) {
trial = atoi(value);
if (period_size_is_plausible_for_low_latency(trial)) {
configured_low_latency_capture_period_size = trial;
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 8caefe8..403f69e 100755
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -250,6 +250,9 @@
USECASE_AUDIO_PLAYBACK_SYNTHESIZER,
+ /* Echo reference capture usecases */
+ USECASE_AUDIO_RECORD_ECHO_REF_EXT,
+
/*Audio FM Tuner usecase*/
USECASE_AUDIO_FM_TUNER_EXT,
/*voip usecase with low latency path*/
@@ -392,11 +395,12 @@
pthread_mutex_t pre_lock; /* acquire before lock to avoid DOS by playback thread */
pthread_cond_t cond;
/* stream_out->lock is of large granularity, and can only be held before device lock
- * latch is a supplemetary lock to protect certain fields of out stream and
- * it can be held after device lock
+ * latch is a supplemetary lock to protect certain fields of out stream (such as
+ * offload_state, a2dp_muted, to add any stream member that needs to be accessed
+ * with device lock held) and it can be held after device lock
*/
pthread_mutex_t latch_lock;
- pthread_mutex_t position_query_lock; /* sychronize frame written */
+ pthread_mutex_t position_query_lock;
struct pcm_config config;
struct compr_config compr_config;
struct pcm *pcm;
@@ -424,7 +428,7 @@
int non_blocking;
int playback_started;
- int offload_state;
+ int offload_state; /* guarded by latch_lock */
pthread_cond_t offload_cond;
pthread_t offload_thread;
struct listnode offload_cmd_list;
@@ -466,7 +470,7 @@
qahwi_stream_out_t qahwi_out;
bool is_iec61937_info_available;
- bool a2dp_muted;
+ bool a2dp_muted; /* guarded by latch_lock */
float volume_l;
float volume_r;
bool apply_volume;
@@ -744,6 +748,7 @@
int haptic_pcm_device_id;
uint8_t *haptic_buffer;
size_t haptic_buffer_size;
+ int fluence_nn_usecase_id;
/* logging */
snd_device_t last_logged_snd_device[AUDIO_USECASE_MAX][2]; /* [out, in] */
@@ -802,6 +807,7 @@
audio_usecase_t get_usecase_id_from_usecase_type(const struct audio_device *adev,
usecase_type_t type);
+/* adev lock held */
int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool restore);
int adev_open_output_stream(struct audio_hw_device *dev,
@@ -859,7 +865,8 @@
/*
* NOTE: when multiple mutexes have to be acquired, always take the
- * stream_in or stream_out mutex first, followed by the audio_device mutex.
+ * stream_in or stream_out mutex first, followed by the audio_device mutex
+ * and latch at last.
*/
#endif // QCOM_AUDIO_HW_H
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index ba1c9cf..ca5164f 100755
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -359,6 +359,8 @@
acdb_set_codec_data_t acdb_set_codec_data;
acdb_reload_t acdb_reload;
acdb_reload_v2_t acdb_reload_v2;
+ acdb_get_fluence_nn_state_t acdb_get_fluence_nn_state;
+ acdb_set_fluence_nn_state_t acdb_set_fluence_nn_state;
void *hw_info;
acdb_send_gain_dep_cal_t acdb_send_gain_dep_cal;
struct csd_data *csd;
@@ -537,6 +539,7 @@
[USECASE_AUDIO_RECORD_BUS_FRONT_PASSENGER] = {FRONT_PASSENGER_PCM_DEVICE, FRONT_PASSENGER_PCM_DEVICE},
[USECASE_AUDIO_RECORD_BUS_REAR_SEAT] = {REAR_SEAT_PCM_DEVICE, REAR_SEAT_PCM_DEVICE},
[USECASE_AUDIO_PLAYBACK_SYNTHESIZER] = {-1, -1},
+ [USECASE_AUDIO_RECORD_ECHO_REF_EXT] = {MULTIMEDIA2_PCM_DEVICE, MULTIMEDIA2_PCM_DEVICE},
};
/* Array to store sound devices */
@@ -803,6 +806,7 @@
[SND_DEVICE_IN_CALL_PROXY] = "call-proxy-in",
[SND_DEVICE_IN_ICC] = "speaker-mic",
[SND_DEVICE_IN_SYNTH_MIC] = "speaker-mic",
+ [SND_DEVICE_IN_ECHO_REFERENCE] = "echo-reference",
};
// Platform specific backend bit width table
@@ -1040,6 +1044,7 @@
[SND_DEVICE_IN_USB_HEADSET_MULTI_CHANNEL_MIC_AEC] = 162,
[SND_DEVICE_IN_UNPROCESSED_USB_HEADSET_MULTI_CHANNEL_MIC] = 162,
[SND_DEVICE_IN_CAPTURE_FM] = 0,
+ [SND_DEVICE_IN_ECHO_REFERENCE] = 100,
[SND_DEVICE_IN_AANC_HANDSET_MIC] = 104,
[SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC] = 105,
[SND_DEVICE_IN_QUAD_MIC] = 46,
@@ -1294,6 +1299,7 @@
{TO_NAME_INDEX(SND_DEVICE_IN_VOICE_RECOG_USB_HEADSET_MULTI_CHANNEL_MIC)},
{TO_NAME_INDEX(SND_DEVICE_IN_USB_HEADSET_MULTI_CHANNEL_MIC_AEC)},
{TO_NAME_INDEX(SND_DEVICE_IN_CAPTURE_FM)},
+ {TO_NAME_INDEX(SND_DEVICE_IN_ECHO_REFERENCE)},
{TO_NAME_INDEX(SND_DEVICE_IN_AANC_HANDSET_MIC)},
{TO_NAME_INDEX(SND_DEVICE_IN_VOICE_FLUENCE_DMIC_AANC)},
{TO_NAME_INDEX(SND_DEVICE_IN_QUAD_MIC)},
@@ -2680,6 +2686,7 @@
hw_interface_table[SND_DEVICE_OUT_ICC] = strdup("TERT_TDM_RX_0");
hw_interface_table[SND_DEVICE_OUT_SYNTH_SPKR] = strdup("TERT_TDM_RX_0");
hw_interface_table[SND_DEVICE_IN_SYNTH_MIC] = strdup("TERT_TDM_TX_0");
+ hw_interface_table[SND_DEVICE_IN_ECHO_REFERENCE] = strdup("SEC_TDM_TX_0");
my_data->max_mic_count = PLATFORM_DEFAULT_MIC_COUNT;
/*remove ALAC & APE from DSP decoder list based on software decoder availability*/
@@ -3725,6 +3732,18 @@
ALOGE("%s: dlsym error %s for acdb_loader_reload_acdb_files_v2", __func__, dlerror());
}
+ my_data->acdb_set_fluence_nn_state = (acdb_set_fluence_nn_state_t)dlsym(
+ my_data->acdb_handle,
+ "acdb_set_fluence_nn_state");
+ if (!my_data->acdb_set_fluence_nn_state)
+ ALOGE("%s: dlsym error %s for acdb_set_fluence_nn_state", __func__, dlerror());
+
+ my_data->acdb_get_fluence_nn_state = (acdb_get_fluence_nn_state_t)dlsym(
+ my_data->acdb_handle,
+ "acdb_get_fluence_nn_state");
+ if (!my_data->acdb_get_fluence_nn_state)
+ ALOGE("%s: dlsym error %s for acdb_get_fluence_nn_state", __func__, dlerror());
+
my_data->acdb_reload = (acdb_reload_t)dlsym(my_data->acdb_handle,
"acdb_loader_reload_acdb_files");
if (my_data->acdb_reload == NULL) {
@@ -7566,6 +7585,9 @@
}
} else if (source == AUDIO_SOURCE_FM_TUNER) {
snd_device = SND_DEVICE_IN_CAPTURE_FM;
+ } else if ((source == AUDIO_SOURCE_ECHO_REFERENCE) &&
+ (uc_id == USECASE_AUDIO_RECORD_ECHO_REF_EXT)) {
+ snd_device = SND_DEVICE_IN_ECHO_REFERENCE;
} else if (source == AUDIO_SOURCE_DEFAULT) {
goto exit;
}
@@ -7639,6 +7661,9 @@
snd_device = SND_DEVICE_IN_USB_HEADSET_MIC;
} else if (compare_device_type(&in_devices, AUDIO_DEVICE_IN_FM_TUNER)) {
snd_device = SND_DEVICE_IN_CAPTURE_FM;
+ } else if (compare_device_type(&in_devices, AUDIO_DEVICE_IN_ECHO_REFERENCE) &&
+ (uc_id == USECASE_AUDIO_RECORD_ECHO_REF_EXT)) {
+ snd_device = SND_DEVICE_IN_ECHO_REFERENCE;
} else if (audio_extn_usb_connected(NULL) &&
is_usb_in_device_type(&in_devices)) {
snd_device = fixup_usb_headset_mic_snd_device(platform,
@@ -9040,6 +9065,13 @@
/* Delay in Us */
int64_t platform_get_audio_source_delay(audio_source_t audio_source)
{
+ if (audio_source == AUDIO_SOURCE_ECHO_REFERENCE) {
+ /* return 0 because audio source delay is not
+ currently implemented on automotive in the
+ audio_platform_info.xml */
+ return 0;
+ }
+
if ((audio_source < AUDIO_SOURCE_DEFAULT) ||
(audio_source > AUDIO_SOURCE_MAX)) {
ALOGE("%s: Invalid audio_source = %d", __func__, audio_source);
@@ -9523,7 +9555,9 @@
ALOGD("%s:becf: afe: %s mixer set to %d bit for %x format", __func__,
my_data->current_backend_cfg[backend_idx].bitwidth_mixer_ctl, bit_width, format);
for (int idx = 0; idx < MAX_CODEC_BACKENDS; idx++) {
- if (my_data->current_backend_cfg[idx].bitwidth_mixer_ctl) {
+ if (my_data->current_backend_cfg[idx].bitwidth_mixer_ctl
+ && strcmp(my_data->current_backend_cfg[idx].bitwidth_mixer_ctl,
+ my_data->current_backend_cfg[backend_idx].bitwidth_mixer_ctl) == 0) {
ctl = mixer_get_ctl_by_name(adev->mixer,
my_data->current_backend_cfg[idx].bitwidth_mixer_ctl);
id_string = platform_get_mixer_control(ctl);
@@ -9628,7 +9662,9 @@
ALOGD("%s:becf: afe: %s set to %s", __func__,
my_data->current_backend_cfg[backend_idx].samplerate_mixer_ctl, rate_str);
for (int idx = 0; idx < MAX_CODEC_BACKENDS; idx++) {
- if (my_data->current_backend_cfg[idx].samplerate_mixer_ctl) {
+ if (my_data->current_backend_cfg[idx].samplerate_mixer_ctl
+ && strcmp(my_data->current_backend_cfg[idx].samplerate_mixer_ctl,
+ my_data->current_backend_cfg[backend_idx].samplerate_mixer_ctl) == 0) {
ctl = mixer_get_ctl_by_name(adev->mixer,
my_data->current_backend_cfg[idx].samplerate_mixer_ctl);
id_string = platform_get_mixer_control(ctl);
@@ -9683,7 +9719,9 @@
ALOGD("%s:becf: afe: %s set to %s", __func__,
my_data->current_backend_cfg[backend_idx].channels_mixer_ctl, channel_cnt_str);
for (int idx = 0; idx < MAX_CODEC_BACKENDS; idx++) {
- if (my_data->current_backend_cfg[idx].channels_mixer_ctl) {
+ if (my_data->current_backend_cfg[idx].channels_mixer_ctl &&
+ strcmp(my_data->current_backend_cfg[idx].channels_mixer_ctl,
+ my_data->current_backend_cfg[backend_idx].channels_mixer_ctl) == 0) {
ctl = mixer_get_ctl_by_name(adev->mixer,
my_data->current_backend_cfg[idx].channels_mixer_ctl);
id_string = platform_get_mixer_control(ctl);
@@ -12573,3 +12611,37 @@
return true;
return false;
}
+
+bool platform_set_fluence_nn_state(void *platform, bool state) {
+ struct platform_data *my_data = (struct platform_data *)platform;
+
+ if (my_data->acdb_set_fluence_nn_state == NULL) {
+ ALOGE("%s: dlsym error for acdb_set_fluence_nn_state", __func__);
+ return false;
+ }
+
+ if (my_data->fluence_nn_enabled) {
+ my_data->acdb_set_fluence_nn_state(state);
+ ALOGD("%s: set fluence nn state %d", __func__, state);
+ return true;
+ }
+
+ return false;
+}
+
+int platform_get_fluence_nn_state(void *platform) {
+ struct platform_data *my_data = (struct platform_data *)platform;
+ int ret = -1;
+
+ if (my_data->acdb_get_fluence_nn_state == NULL) {
+ ALOGE("%s: dlsym error for acdb_get_fluence_nn_state", __func__);
+ return ret;
+ }
+
+ if (my_data->fluence_nn_enabled)
+ ret = my_data->acdb_get_fluence_nn_state();
+ else
+ ALOGD("fluence nn disabled");
+
+ return ret;
+}
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index 5f67510..07cf8be 100755
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -364,6 +364,7 @@
SND_DEVICE_IN_CALL_PROXY,
SND_DEVICE_IN_ICC,
SND_DEVICE_IN_SYNTH_MIC,
+ SND_DEVICE_IN_ECHO_REFERENCE,
SND_DEVICE_IN_END,
SND_DEVICE_MAX = SND_DEVICE_IN_END,
diff --git a/hal/platform_api.h b/hal/platform_api.h
index f0b10f5..bea9675 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -424,6 +424,8 @@
int platform_get_display_port_ctl_index(int controller, int stream);
bool platform_is_call_proxy_snd_device(snd_device_t snd_device);
void platform_set_audio_source_delay(audio_source_t audio_source, int delay_ms);
+bool platform_set_fluence_nn_state(void *platform, bool start);
+int platform_get_fluence_nn_state(void *platform);
int platform_get_audio_source_index(const char *audio_source_name);
bool platform_check_and_update_island_power_status(void *platform,