Merge "configs: lito: add sound models merge feature flag"
diff --git a/configs/atoll/audio_policy_configuration.xml b/configs/atoll/audio_policy_configuration.xml
index a6d7eef..bcf3e4b 100644
--- a/configs/atoll/audio_policy_configuration.xml
+++ b/configs/atoll/audio_policy_configuration.xml
@@ -176,6 +176,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="surround_sound" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@@ -361,6 +366,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="usb_surround_sound"
diff --git a/configs/kona/audio_policy_configuration.xml b/configs/kona/audio_policy_configuration.xml
index 8bb3328..1e4e338 100644
--- a/configs/kona/audio_policy_configuration.xml
+++ b/configs/kona/audio_policy_configuration.xml
@@ -173,6 +173,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="usb_surround_sound" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000,176400,192000"
@@ -350,6 +355,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="usb_surround_sound"
                        sources="USB Device In,USB Headset In"/>
                 <route type="mix" sink="record_24"
diff --git a/configs/kona/mixer_paths.xml b/configs/kona/mixer_paths.xml
index 3949c7c..36595c0 100644
--- a/configs/kona/mixer_paths.xml
+++ b/configs/kona/mixer_paths.xml
@@ -236,6 +236,7 @@
     <ctl name="WSA_CDC_DMA_RX_0_Voice Mixer Voip" value="0" />
     <ctl name="RX_CDC_DMA_RX_0_Voice Mixer Voip" value="0" />
     <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip" value="0" />
+    <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_4_Voip" value="0" />
     <ctl name="SLIM_7_RX_Voice Mixer Voip" value="0" />
     <ctl name="Voip_Tx Mixer SLIM_7_TX_Voip" value="0" />
     <ctl name="AFE_PCM_RX_Voice Mixer Voip" value="0" />
@@ -1740,6 +1741,10 @@
         <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip" value="1" />
     </path>
 
+    <path name="compress-voip-call headset">
+        <ctl name="RX_CDC_DMA_RX_0_Voice Mixer Voip" value="1" />
+        <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_4_Voip" value="1" />
+    </path>
 
     <path name="compress-voip-call bt-sco">
         <ctl name="SLIM_7_RX_Voice Mixer Voip" value="1" />
@@ -1887,6 +1892,10 @@
         <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia10" value="1" />
     </path>
 
+    <path name="audio-playback-voip headset">
+        <path name="audio-playback-voip headphones" />
+    </path>
+
     <path name="audio-playback-voip bt-sco">
         <ctl name="SLIMBUS_7_RX Audio Mixer MultiMedia10" value="1" />
     </path>
@@ -2703,6 +2712,10 @@
         <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia16" value="1" />
     </path>
 
+    <path name="mmap-playback headset">
+        <path name="mmap-playback headphones" />
+    </path>
+
     <path name="mmap-playback speaker-and-headphones">
         <path name="mmap-playback" />
         <path name="mmap-playback headphones" />
diff --git a/configs/kona/mixer_paths_cdp.xml b/configs/kona/mixer_paths_cdp.xml
index 67041e6..ed9bfc0 100644
--- a/configs/kona/mixer_paths_cdp.xml
+++ b/configs/kona/mixer_paths_cdp.xml
@@ -237,6 +237,7 @@
     <ctl name="WSA_CDC_DMA_RX_0_Voice Mixer Voip" value="0" />
     <ctl name="RX_CDC_DMA_RX_0_Voice Mixer Voip" value="0" />
     <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip" value="0" />
+    <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_4_Voip" value="0" />
     <ctl name="SLIM_7_RX_Voice Mixer Voip" value="0" />
     <ctl name="Voip_Tx Mixer SLIM_7_TX_Voip" value="0" />
     <ctl name="AFE_PCM_RX_Voice Mixer Voip" value="0" />
@@ -1746,6 +1747,10 @@
         <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip" value="1" />
     </path>
 
+    <path name="compress-voip-call headset">
+        <ctl name="RX_CDC_DMA_RX_0_Voice Mixer Voip" value="1" />
+        <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_4_Voip" value="1" />
+    </path>
 
     <path name="compress-voip-call bt-sco">
         <ctl name="SLIM_7_RX_Voice Mixer Voip" value="1" />
@@ -1893,6 +1898,10 @@
         <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia10" value="1" />
     </path>
 
+    <path name="audio-playback-voip headset">
+        <path name="audio-playback-voip headphones" />
+    </path>
+
     <path name="audio-playback-voip bt-sco">
         <ctl name="SLIMBUS_7_RX Audio Mixer MultiMedia10" value="1" />
     </path>
@@ -2725,6 +2734,10 @@
         <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia16" value="1" />
     </path>
 
+    <path name="mmap-playback headset">
+        <path name="mmap-playback headphones" />
+    </path>
+
     <path name="mmap-playback speaker-and-headphones">
         <path name="mmap-playback" />
         <path name="mmap-playback headphones" />
diff --git a/configs/kona/mixer_paths_qrd.xml b/configs/kona/mixer_paths_qrd.xml
index 08176d5..65f15db 100644
--- a/configs/kona/mixer_paths_qrd.xml
+++ b/configs/kona/mixer_paths_qrd.xml
@@ -236,6 +236,7 @@
     <ctl name="WSA_CDC_DMA_RX_0_Voice Mixer Voip" value="0" />
     <ctl name="RX_CDC_DMA_RX_0_Voice Mixer Voip" value="0" />
     <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip" value="0" />
+    <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_4_Voip" value="0" />
     <ctl name="SLIM_7_RX_Voice Mixer Voip" value="0" />
     <ctl name="Voip_Tx Mixer SLIM_7_TX_Voip" value="0" />
     <ctl name="AFE_PCM_RX_Voice Mixer Voip" value="0" />
@@ -1757,6 +1758,11 @@
         <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip" value="1" />
     </path>
 
+    <path name="compress-voip-call headset">
+        <ctl name="RX_CDC_DMA_RX_0_Voice Mixer Voip" value="1" />
+        <ctl name="Voip_Tx Mixer TX_CDC_DMA_TX_4_Voip" value="1" />
+    </path>
+
     <path name="compress-voip-call bt-sco">
         <ctl name="SLIM_7_RX_Voice Mixer Voip" value="1" />
         <ctl name="Voip_Tx Mixer SLIM_7_TX_Voip" value="1" />
@@ -1917,6 +1923,10 @@
         <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia10" value="1" />
     </path>
 
+    <path name="audio-playback-voip headset">
+        <path name="audio-playback-voip headphones" />
+    </path>
+
     <path name="audio-playback-voip bt-sco">
         <ctl name="SLIMBUS_7_RX Audio Mixer MultiMedia10" value="1" />
     </path>
@@ -2110,6 +2120,10 @@
         <ctl name="RX_CDC_DMA_RX_0 Audio Mixer MultiMedia16" value="1" />
     </path>
 
+    <path name="mmap-playback headset">
+        <path name="mmap-playback headphones" />
+    </path>
+
     <path name="mmap-playback speaker-and-headphones">
         <path name="mmap-playback" />
         <path name="mmap-playback headphones" />
diff --git a/configs/lito/audio_policy_configuration.xml b/configs/lito/audio_policy_configuration.xml
index a33356b..b719ff0 100644
--- a/configs/lito/audio_policy_configuration.xml
+++ b/configs/lito/audio_policy_configuration.xml
@@ -173,6 +173,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="surround_sound" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@@ -358,6 +363,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="usb_surround_sound"
diff --git a/configs/msm8998/audio_policy_configuration.xml b/configs/msm8998/audio_policy_configuration.xml
index 505a205..5f861d9 100644
--- a/configs/msm8998/audio_policy_configuration.xml
+++ b/configs/msm8998/audio_policy_configuration.xml
@@ -167,6 +167,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="surround_sound" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@@ -346,6 +351,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="record_24"
diff --git a/configs/msm8998/msm8998.mk b/configs/msm8998/msm8998.mk
index 6b77f69..7004379 100644
--- a/configs/msm8998/msm8998.mk
+++ b/configs/msm8998/msm8998.mk
@@ -99,7 +99,9 @@
     vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8998/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_platform_info.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8998/graphite_ipc_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/graphite_ipc_platform_info.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8998/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \
-    vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8998/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml
+    vendor/qcom/opensource/audio-hal/primary-hal/configs/msm8998/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml \
+    frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \
+    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml
 
 #XML Audio configuration files
 ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)
diff --git a/configs/msmnile/audio_policy_configuration.xml b/configs/msmnile/audio_policy_configuration.xml
index 5c05206..1e4e338 100644
--- a/configs/msmnile/audio_policy_configuration.xml
+++ b/configs/msmnile/audio_policy_configuration.xml
@@ -173,6 +173,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="usb_surround_sound" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000,176400,192000"
@@ -184,7 +189,7 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,88200,96000,176400,192000"
                              channelMasks="AUDIO_CHANNEL_IN_5POINT1,AUDIO_CHANNEL_INDEX_MASK_6,AUDIO_CHANNEL_IN_7POINT1,AUDIO_CHANNEL_INDEX_MASK_8"/>
                 </mixPort>
-                <mixPort name="record_24" role="sink">
+                <mixPort name="record_24" role="sink" maxOpenCount="2" maxActiveCount="2">
                     <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
                              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"/>
@@ -350,6 +355,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="usb_surround_sound"
                        sources="USB Device In,USB Headset In"/>
                 <route type="mix" sink="record_24"
diff --git a/configs/msmnile/mixer_paths_tavil.xml b/configs/msmnile/mixer_paths_tavil.xml
index fb315bf..cb9d2af 100644
--- a/configs/msmnile/mixer_paths_tavil.xml
+++ b/configs/msmnile/mixer_paths_tavil.xml
@@ -3025,7 +3025,12 @@
     </path>
 
     <path name="voice-tty-hco-headset-mic">
-        <path name="voice-tty-full-headset-mic" />
+        <ctl name="AIF1_CAP Mixer SLIM TX0" value="1"/>
+        <ctl name="SLIM_0_TX Channels" value="One" />
+        <ctl name="CDC_IF TX0 MUX" value="DEC0" />
+        <ctl name="ADC MUX0" value="AMIC" />
+        <ctl name="AMIC MUX0" value="ADC2" />
+        <ctl name="IIR0 INP0 MUX" value="DEC0" />
     </path>
 
     <path name="voice-tty-vco-handset-mic">
diff --git a/configs/msmnile_au/msmnile_au.mk b/configs/msmnile_au/msmnile_au.mk
index 394dfea..7d17be7 100644
--- a/configs/msmnile_au/msmnile_au.mk
+++ b/configs/msmnile_au/msmnile_au.mk
@@ -80,7 +80,9 @@
 endif
 
 #Automotive audio specific device overlays
+ifneq ($(TARGET_USES_AOSP_FOR_AUDIO), true)
 DEVICE_PACKAGE_OVERLAYS += hardware/qcom/audio/configs/msmnile_au/overlay
+endif
 
 PRODUCT_COPY_FILES += \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/msmnile_au/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \
diff --git a/configs/msmsteppe/audio_policy_configuration.xml b/configs/msmsteppe/audio_policy_configuration.xml
index b092687..99f03bf 100644
--- a/configs/msmsteppe/audio_policy_configuration.xml
+++ b/configs/msmsteppe/audio_policy_configuration.xml
@@ -167,6 +167,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="incall_music_uplink" role="source"
                         flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -350,6 +355,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="usb_surround_sound"
                        sources="USB Device In,USB Headset In"/>
                 <route type="mix" sink="record_24"
diff --git a/configs/msmsteppe_au/audio_platform_info.xml b/configs/msmsteppe_au/audio_platform_info.xml
index a33ae3f..e90675c 100644
--- a/configs/msmsteppe_au/audio_platform_info.xml
+++ b/configs/msmsteppe_au/audio_platform_info.xml
@@ -30,6 +30,10 @@
         <device name="SND_DEVICE_OUT_HANDSET" acdb_id="78"/>
         <device name="SND_DEVICE_OUT_SPEAKER" acdb_id="78"/>
         <device name="SND_DEVICE_OUT_HEADPHONES" acdb_id="78"/>
+        <device name="SND_DEVICE_OUT_BUS_MEDIA" acdb_id="78"/>
+        <device name="SND_DEVICE_OUT_BUS_SYS" acdb_id="78"/>
+        <device name="SND_DEVICE_OUT_BUS_NAV" acdb_id="14"/>
+        <device name="SND_DEVICE_OUT_BUS_PHN" acdb_id="94"/>
         <device name="SND_DEVICE_OUT_BT_SCO" acdb_id="94"/>
         <device name="SND_DEVICE_OUT_BT_SCO_WB" acdb_id="94"/>
         <device name="SND_DEVICE_OUT_BT_A2DP" acdb_id="78"/>
@@ -37,6 +41,7 @@
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER" acdb_id="94"/>
         <device name="SND_DEVICE_IN_HANDSET_MIC" acdb_id="11"/>
         <device name="SND_DEVICE_IN_SPEAKER_MIC" acdb_id="11"/>
+        <device name="SND_DEVICE_IN_BUS" acdb_id="11"/>
         <device name="SND_DEVICE_IN_HEADSET_MIC" acdb_id="11"/>
         <device name="SND_DEVICE_IN_VOICE_SPEAKER_MIC" acdb_id="95"/>
         <device name="SND_DEVICE_IN_VOICE_HEADSET_MIC" acdb_id="95"/>
diff --git a/configs/msmsteppe_au/audio_policy_configuration.xml b/configs/msmsteppe_au/audio_policy_configuration.xml
index 4d9340d..6ab75d8 100644
--- a/configs/msmsteppe_au/audio_policy_configuration.xml
+++ b/configs/msmsteppe_au/audio_policy_configuration.xml
@@ -33,6 +33,11 @@
         “devicePorts”: a list of device descriptors for all input and output devices accessible via this
         module.
         This contains both permanently attached devices and removable devices.
+            "gain": constraints applied to the millibel values:
+                - maxValueMB >= minValueMB
+                - defaultValueMB >= minValueMB && defaultValueMB <= maxValueMB
+                - (maxValueMB - minValueMB) % stepValueMB == 0
+                - (defaultValueMB - minValueMB) % stepValueMB == 0
         “mixPorts”: listing all output and input streams exposed by the audio HAL
         “routes”: list of possible connections between input and output devices or between stream and
         devices.
@@ -47,18 +52,37 @@
     -->
     <modules>
         <!-- Primary Audio HAL -->
-        <module name="primary" halVersion="2.0">
+        <module name="primary" halVersion="3.0">
             <attachedDevices>
-                <item>Earpiece</item>
-                <item>Speaker</item>
+                <item>Media Bus</item>
+                <item>Sys Notification Bus</item>
+                <item>Nav Guidance Bus</item>
+                <item>Phone Bus</item>
                 <item>Telephony Tx</item>
                 <item>Built-In Mic</item>
                 <item>Built-In Back Mic</item>
                 <item>FM Tuner</item>
                 <item>Telephony Rx</item>
             </attachedDevices>
-            <defaultOutputDevice>Speaker</defaultOutputDevice>
+            <defaultOutputDevice>Media Bus</defaultOutputDevice>
             <mixPorts>
+                <mixPort name="media" role="source"
+                         flags="AUDIO_OUTPUT_FLAG_PRIMARY">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
+                <mixPort name="sys_notification" role="source">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
+                <mixPort name="nav_guidance" role="source">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
+                <mixPort name="phone" role="source">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_PRIMARY">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
@@ -203,6 +227,42 @@
 
             <devicePorts>
                 <!-- Output devices declaration, i.e. Sink DEVICE PORT -->
+                <devicePort tagName="Media Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+                        address="BUS00_MEDIA">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                    <gains>
+                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+                                minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+                    </gains>
+                </devicePort>
+                <devicePort tagName="Sys Notification Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+                        address="BUS01_SYS_NOTIFICATION">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                    <gains>
+                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+                                minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+                    </gains>
+                </devicePort>
+                <devicePort tagName="Nav Guidance Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+                        address="BUS02_NAV_GUIDANCE">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                    <gains>
+                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+                                minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+                    </gains>
+                </devicePort>
+                <devicePort tagName="Phone Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
+                        address="BUS03_PHONE">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                    <gains>
+                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
+                                minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
+                    </gains>
+                </devicePort>
                 <devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/>
@@ -301,6 +361,14 @@
             </devicePorts>
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
+                <route type="mix" sink="Media Bus"
+                       sources="media,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
+                <route type="mix" sink="Sys Notification Bus"
+                       sources="sys_notification"/>
+                <route type="mix" sink="Nav Guidance Bus"
+                       sources="nav_guidance"/>
+                <route type="mix" sink="Phone Bus"
+                       sources="phone"/>
                 <route type="mix" sink="Earpiece"
                        sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker"
diff --git a/configs/msmsteppe_au/mixer_paths_adp.xml b/configs/msmsteppe_au/mixer_paths_adp.xml
index e2de539..75ce9c5 100644
--- a/configs/msmsteppe_au/mixer_paths_adp.xml
+++ b/configs/msmsteppe_au/mixer_paths_adp.xml
@@ -755,6 +755,11 @@
         <path name="compress-offload-playback4" />
     </path>
 
+    <path name="voice-call">
+        <!-- Added AFE loopback ctrl path for CS-Voice call-->
+        <ctl name="TERT_TDM_RX_0 Port Mixer AUX_PCM_UL_TX" value="1" />
+        <ctl name="AUX_PCM_RX Port Mixer TERT_TDM_TX_0" value="1" />
+    </path>
 
     <path name="compress-offload-playback4 afe-proxy">
         <ctl name="AFE_PCM_RX Audio Mixer MultiMedia11" value="1" />
@@ -1135,6 +1140,27 @@
         <path name="compress-offload-playback9" />
     </path>
 
+    <!-- The following use cases are used for car streams  -->
+    <path name="media-playback">
+        <ctl name="TERT_TDM_RX_0 Channels" value="Six" />
+        <ctl name="TERT_TDM_RX_0 Audio Mixer MultiMedia1" value="1" />
+    </path>
+
+    <path name="sys-notification-playback">
+        <ctl name="TERT_TDM_RX_0 Channels" value="Six" />
+        <ctl name="TERT_TDM_RX_0 Audio Mixer MultiMedia5" value="1" />
+    </path>
+
+    <path name="nav-guidance-playback">
+        <ctl name="TERT_TDM_RX_1 Channels" value="One" />
+        <ctl name="TERT_TDM_RX_1 Audio Mixer MultiMedia2" value="1" />
+    </path>
+
+    <path name="phone-playback">
+        <ctl name="TERT_TDM_RX_2 Channels" value="One" />
+        <ctl name="TERT_TDM_RX_2 Audio Mixer MultiMedia10" value="1" />
+    </path>
+
     <path name="audio-record">
         <ctl name="TERT_TDM_TX_0 Channels" value="One" />
         <ctl name="MultiMedia1 Mixer TERT_TDM_TX_0" value="1" />
@@ -1622,9 +1648,15 @@
     </path>
 
     <path name="speaker-adp">
+        <!--ctl name="TERT_TDM_RX_0 Channels" value="Six" /-->
     </path>
 
     <path name="speaker-custom">
+        <!--ctl name="TERT_TDM_RX_0 Channels" value="Six" /-->
+    </path>
+
+    <path name="bus-speaker">
+        <!--ctl name="TERT_TDM_RX_0 Channels" value="Six" /-->
     </path>
 
    <path name="sidetone-iir">
diff --git a/configs/msmsteppe_au/mixer_paths_custom.xml b/configs/msmsteppe_au/mixer_paths_custom.xml
index 3de6f0f..5175d9f 100644
--- a/configs/msmsteppe_au/mixer_paths_custom.xml
+++ b/configs/msmsteppe_au/mixer_paths_custom.xml
@@ -1131,6 +1131,27 @@
         <path name="compress-offload-playback9" />
     </path>
 
+    <!-- The following use cases are used for car streams  -->
+    <path name="media-playback">
+        <ctl name="TERT_TDM_RX_0 Channels" value="Six" />
+        <ctl name="TERT_TDM_RX_0 Audio Mixer MultiMedia1" value="1" />
+    </path>
+
+    <path name="sys-notification-playback">
+        <ctl name="TERT_TDM_RX_0 Channels" value="Six" />
+        <ctl name="TERT_TDM_RX_0 Audio Mixer MultiMedia5" value="1" />
+    </path>
+
+    <path name="nav-guidance-playback">
+        <ctl name="TERT_TDM_RX_1 Channels" value="One" />
+        <ctl name="TERT_TDM_RX_1 Audio Mixer MultiMedia2" value="1" />
+    </path>
+
+    <path name="phone-playback">
+        <ctl name="TERT_TDM_RX_2 Channels" value="One" />
+        <ctl name="TERT_TDM_RX_2 Audio Mixer MultiMedia10" value="1" />
+    </path>
+
     <path name="audio-record">
         <ctl name="TERT_TDM_TX_0 Channels" value="One" />
         <ctl name="MultiMedia1 Mixer TERT_TDM_TX_0" value="1" />
@@ -1618,9 +1639,15 @@
     </path>
 
     <path name="speaker-adp">
+        <!--ctl name="TERT_TDM_RX_0 Channels" value="Six" /-->
     </path>
 
     <path name="speaker-custom">
+        <!--ctl name="TERT_TDM_RX_0 Channels" value="Six" /-->
+    </path>
+
+    <path name="bus-speaker">
+        <!--ctl name="TERT_TDM_RX_0 Channels" value="Six" /-->
     </path>
 
    <path name="sidetone-iir">
diff --git a/configs/msmsteppe_au/msmsteppe_au.mk b/configs/msmsteppe_au/msmsteppe_au.mk
index 51829bd..a0b9cf1 100644
--- a/configs/msmsteppe_au/msmsteppe_au.mk
+++ b/configs/msmsteppe_au/msmsteppe_au.mk
@@ -69,13 +69,20 @@
 AUDIO_FEATURE_ENABLED_BATTERY_LISTENER := false
 ##AUDIO_FEATURE_FLAGS
 
+AUDIO_FEATURE_ENABLED_AUTO_HAL := true
+AUDIO_FEATURE_ENABLED_EXT_HW_PLUGIN := true
+AUDIO_FEATURE_ENABLED_AUDIO_CONTROL_HAL := true
+##AUTOMOTIVE_AUDIO_FEATURE_FLAGS
+
 ifneq ($(strip $(TARGET_USES_RRO)), true)
 #Audio Specific device overlays
 DEVICE_PACKAGE_OVERLAYS += vendor/qcom/opensource/audio-hal/primary-hal/configs/common/overlay
 endif
 
 #Automotive audio specific device overlays
+ifneq ($(TARGET_USES_AOSP_FOR_AUDIO), true)
 DEVICE_PACKAGE_OVERLAYS += hardware/qcom/audio/configs/msmsteppe_au/overlay
+endif
 
 PRODUCT_COPY_FILES += \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/msmsteppe_au/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \
@@ -109,6 +116,10 @@
 PRODUCT_COPY_FILES += \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/msmsteppe_au/listen_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/listen_platform_info.xml
 
+#Audio HAL version
+PRODUCT_PROPERTY_OVERRIDES += \
+vendor.audio.hal.maj.version=3
+
 # Reduce client buffer size for fast audio output tracks
 PRODUCT_PROPERTY_OVERRIDES += \
     af.fast_track_multiplier=1
@@ -261,13 +272,20 @@
     android.hardware.audio.effect@4.0 \
     android.hardware.audio.effect@4.0-impl
 
+# for HIDL related audiocontrol packages
+PRODUCT_PACKAGES += \
+    vendor.qti.hardware.automotive.audiocontrol@1.0-service \
+    android.hardware.automotive.audiocontrol@1.0
+
+ifeq ($(ENABLE_HYP),true)
 PRODUCT_PROPERTY_OVERRIDES += \
-persist.audio.calfile0=/vendor/etc/acdbdata/adsp_avs_config.acdb\
-persist.audio.calfile1=/vendor/etc/acdbdata/ADP/Bluetooth_cal.acdb\
-persist.audio.calfile2=/vendor/etc/acdbdata/ADP/Codec_cal.acdb\
-persist.audio.calfile3=/vendor/etc/acdbdata/ADP/General_cal.acdb\
-persist.audio.calfile4=/vendor/etc/acdbdata/ADP/Global_cal.acdb\
-persist.audio.calfile5=/vendor/etc/acdbdata/ADP/Handset_cal.acdb\
-persist.audio.calfile6=/vendor/etc/acdbdata/ADP/Hdmi_cal.acdb\
-persist.audio.calfile7=/vendor/etc/acdbdata/ADP/Headset_cal.acdb\
-persist.audio.calfile8=/vendor/etc/acdbdata/ADP/Speaker_cal.acdb
+persist.vendor.audio.calfile0=/vendor/etc/acdbdata/adsp_avs_config.acdb\
+persist.vendor.audio.calfile1=/vendor/etc/acdbdata/ADP/Bluetooth_cal.acdb\
+persist.vendor.audio.calfile2=/vendor/etc/acdbdata/ADP/Codec_cal.acdb\
+persist.vendor.audio.calfile3=/vendor/etc/acdbdata/ADP/General_cal.acdb\
+persist.vendor.audio.calfile4=/vendor/etc/acdbdata/ADP/Global_cal.acdb\
+persist.vendor.audio.calfile5=/vendor/etc/acdbdata/ADP/Handset_cal.acdb\
+persist.vendor.audio.calfile6=/vendor/etc/acdbdata/ADP/Hdmi_cal.acdb\
+persist.vendor.audio.calfile7=/vendor/etc/acdbdata/ADP/Headset_cal.acdb\
+persist.vendor.audio.calfile8=/vendor/etc/acdbdata/ADP/Speaker_cal.acdb
+endif
diff --git a/configs/sdm660/audio_policy_configuration.xml b/configs/sdm660/audio_policy_configuration.xml
index 662764f..e1a0181 100644
--- a/configs/sdm660/audio_policy_configuration.xml
+++ b/configs/sdm660/audio_policy_configuration.xml
@@ -163,6 +163,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="surround_sound" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@@ -337,6 +342,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="record_24"
diff --git a/configs/sdm660/sdm660.mk b/configs/sdm660/sdm660.mk
index 5695851..03e59e2 100644
--- a/configs/sdm660/sdm660.mk
+++ b/configs/sdm660/sdm660.mk
@@ -106,7 +106,9 @@
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm660/sound_trigger_mixer_paths_wcd9340.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_mixer_paths_wcd9340.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm660/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_platform_info.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm660/graphite_ipc_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/graphite_ipc_platform_info.xml \
-    vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm660/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml
+    vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm660/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml \
+    frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \
+    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml
 
 #XML Audio configuration files
 ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)
diff --git a/configs/sdm710/audio_policy_configuration.xml b/configs/sdm710/audio_policy_configuration.xml
index a7f4869..145a811 100644
--- a/configs/sdm710/audio_policy_configuration.xml
+++ b/configs/sdm710/audio_policy_configuration.xml
@@ -167,6 +167,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="surround_sound" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
@@ -346,6 +351,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="record_24"
diff --git a/configs/sdm710/sdm710.mk b/configs/sdm710/sdm710.mk
index fb01728..ea71582 100644
--- a/configs/sdm710/sdm710.mk
+++ b/configs/sdm710/sdm710.mk
@@ -170,7 +170,9 @@
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm710/sound_trigger_mixer_paths_wcd9340.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_mixer_paths_wcd9340.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm710/sound_trigger_mixer_paths_wcd9340.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_mixer_paths_wcd9340.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm710/graphite_ipc_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/graphite_ipc_platform_info.xml \
-    vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm710/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml
+    vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm710/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml \
+    frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \
+    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml
 
 #XML Audio configuration files
 ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)
diff --git a/configs/sdm845/audio_policy_configuration.xml b/configs/sdm845/audio_policy_configuration.xml
index 76f5236..fcd0119 100644
--- a/configs/sdm845/audio_policy_configuration.xml
+++ b/configs/sdm845/audio_policy_configuration.xml
@@ -161,12 +161,16 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
                 </mixPort>
-
                 <mixPort name="primary input" role="sink" maxOpenCount="2" maxActiveCount="2">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_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"/>
                 </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="record_24" role="sink">
                     <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000,96000,192000"
@@ -341,6 +345,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="record_24"
                        sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic"/>
                 <route type="mix" sink="mmap_no_irq_in"
diff --git a/configs/sdm845/sdm845.mk b/configs/sdm845/sdm845.mk
index c3c3578..6e56597 100644
--- a/configs/sdm845/sdm845.mk
+++ b/configs/sdm845/sdm845.mk
@@ -124,7 +124,9 @@
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm845/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_platform_info.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm845/graphite_ipc_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/graphite_ipc_platform_info.xml \
     vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm845/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \
-    vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm845/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml
+    vendor/qcom/opensource/audio-hal/primary-hal/configs/sdm845/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml \
+    frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \
+    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml
 
 #XML Audio configuration files
 ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)
diff --git a/configs/trinket/audio_policy_configuration.xml b/configs/trinket/audio_policy_configuration.xml
index 8015afa..043df15 100644
--- a/configs/trinket/audio_policy_configuration.xml
+++ b/configs/trinket/audio_policy_configuration.xml
@@ -167,6 +167,11 @@
                              samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
                              channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
                 </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="incall_music_uplink" role="source"
                         flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -358,6 +363,8 @@
                        sources="Telephony Rx"/>
                 <route type="mix" sink="primary input"
                        sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,USB Device In,USB Headset In,Telephony Rx"/>
+                <route type="mix" sink="voip_tx"
+                       sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="usb_surround_sound"
diff --git a/hal/Android.mk b/hal/Android.mk
index 1a0c2e2..42b5951 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -87,6 +87,7 @@
 ifneq ($(filter lito,$(TARGET_BOARD_PLATFORM)),)
   LOCAL_CFLAGS := -DPLATFORM_LITO
   LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
+  LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
 endif
 ifneq ($(filter atoll,$(TARGET_BOARD_PLATFORM)),)
   LOCAL_CFLAGS := -DPLATFORM_ATOLL
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index f9f33d1..8e65471 100644
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -475,7 +475,7 @@
     int num_devices = 0, pcm_device_id = -1, i = 0, ret = 0;
     snd_device_t new_snd_devices[SND_DEVICE_OUT_END] = {0};
     struct audio_backend_cfg backend_cfg = {0};
-    uint32_t feature_id = 0;
+    uint32_t feature_id = 0, idx = 0;
 
     switch(usecase->type) {
     case PCM_PLAYBACK:
@@ -520,7 +520,7 @@
      * if features like dual_mono is enabled and overrides the default(i.e. 0).
      */
     info.id = feature_id;
-    info.usecase_id = usecase->id;
+    info.usecase_id[0] = usecase->id;
     for (i = 0, ret = 0; i < num_devices; i++) {
         info.snd_device = new_snd_devices[i];
         platform_get_codec_backend_cfg(adev, info.snd_device, &backend_cfg);
@@ -533,7 +533,7 @@
             info.op_channels = audio_channel_count_from_in_mask(
                                    usecase->stream.in->channel_mask);
         }
-        params = platform_get_custom_mtmx_params(adev->platform, &info);
+        params = platform_get_custom_mtmx_params(adev->platform, &info, &idx);
         if (params) {
             if (enable)
                 ret = update_custom_mtmx_coefficients_v2(adev, params,
@@ -678,7 +678,8 @@
                                            struct audio_custom_mtmx_in_params *in_params,
                                            int pcm_device_id,
                                            usecase_type_t type,
-                                           bool enable)
+                                           bool enable,
+                                           uint32_t idx)
 {
     struct mixer_ctl *ctl = NULL;
     char mixer_ctl_name[128] = {0};
@@ -692,13 +693,13 @@
           __func__, pinfo->ip_channels, pinfo->op_channels, pcm_device_id,
           type, enable);
 
-    if (!strcmp(pinfo->fe_name, "")) {
+    if (pinfo->fe_id[idx] == 0) {
         ALOGE("%s: Error. no front end defined", __func__);
         return -EINVAL;
     }
 
-    strlcpy(mixer_name_prefix, pinfo->fe_name, sizeof(mixer_name_prefix));
-
+    snprintf(mixer_name_prefix, sizeof(mixer_name_prefix), "%s%d",
+             "MultiMedia", pinfo->fe_id[idx]);
     /*
      * Enable/Disable channel mixer.
      * If enable, use params and in_params to configure mixer.
@@ -840,7 +841,7 @@
     struct audio_custom_mtmx_in_params_info in_info = {0};
     struct audio_custom_mtmx_in_params *in_params = NULL;
     int pcm_device_id = -1, ret = 0;
-    uint32_t feature_id = 0;
+    uint32_t feature_id = 0, idx = 0;
 
     switch(usecase->type) {
     case PCM_CAPTURE:
@@ -862,26 +863,26 @@
 
     ALOGD("%s: snd device %d", __func__, info.snd_device);
     info.id = feature_id;
-    info.usecase_id = usecase->id;
+    info.usecase_id[0] = usecase->id;
     info.op_channels = audio_channel_count_from_in_mask(
                                 usecase->stream.in->channel_mask);
 
-    in_info.usecase_id = info.usecase_id;
+    in_info.usecase_id[0] = info.usecase_id[0];
     in_info.op_channels = info.op_channels;
     in_params = platform_get_custom_mtmx_in_params(adev->platform, &in_info);
     if (!in_params) {
         ALOGE("%s: Could not get in params for usecase %d, channels %d",
-               __func__, in_info.usecase_id, in_info.op_channels);
+               __func__, in_info.usecase_id[0], in_info.op_channels);
         return;
     }
 
     info.ip_channels = in_params->ip_channels;
     ALOGD("%s: ip channels %d, op channels %d", __func__, info.ip_channels, info.op_channels);
 
-    params = platform_get_custom_mtmx_params(adev->platform, &info);
+    params = platform_get_custom_mtmx_params(adev->platform, &info, &idx);
     if (params) {
         ret = update_custom_mtmx_coefficients_v1(adev, params, in_params,
-                             pcm_device_id, usecase->type, enable);
+                             pcm_device_id, usecase->type, enable, idx);
         if (ret < 0)
             ALOGE("%s: error updating mtmx coeffs err:%d", __func__, ret);
     }
@@ -900,12 +901,12 @@
         return snd_device;
     }
 
-    in_info.usecase_id = usecase->id;
+    in_info.usecase_id[0] = usecase->id;
     in_info.op_channels = channel_count;
     in_params = platform_get_custom_mtmx_in_params(adev->platform, &in_info);
     if (!in_params) {
         ALOGE("%s: Could not get in params for usecase %d, channels %d",
-               __func__, in_info.usecase_id, in_info.op_channels);
+               __func__, in_info.usecase_id[0], in_info.op_channels);
         return snd_device;
     }
 
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 18bfc2a..d407f80 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -1275,8 +1275,6 @@
 #ifndef AUDIO_EXTN_AUTO_HAL_ENABLED
 #define audio_extn_auto_hal_init(adev)                (0)
 #define audio_extn_auto_hal_deinit()                  (0)
-#define audio_extn_auto_hal_enable_hostless()         (0)
-#define audio_extn_auto_hal_disable_hostless()        (0)
 #define audio_extn_auto_hal_create_audio_patch(dev, num_sources,\
     sources, num_sinks, sinks, handle) (0)
 #define audio_extn_auto_hal_release_audio_patch(dev, handle) (0)
@@ -1290,8 +1288,6 @@
 #else
 int32_t audio_extn_auto_hal_init(struct audio_device *adev);
 void audio_extn_auto_hal_deinit(void);
-int32_t audio_extn_auto_hal_enable_hostless(void);
-void audio_extn_auto_hal_disable_hostless(void);
 int audio_extn_auto_hal_create_audio_patch(struct audio_hw_device *dev,
                                 unsigned int num_sources,
                                 const struct audio_port_config *sources,
diff --git a/hal/audio_extn/auto_hal.c b/hal/audio_extn/auto_hal.c
index ad5e331..7f2163d 100644
--- a/hal/audio_extn/auto_hal.c
+++ b/hal/audio_extn/auto_hal.c
@@ -47,15 +47,9 @@
 
 #ifdef AUDIO_EXTN_AUTO_HAL_ENABLED
 
-struct hostless_config {
-    struct pcm *pcm_tx;
-    struct pcm *pcm_rx;
-};
-
 typedef struct auto_hal_module {
     struct audio_device *adev;
     card_status_t card_status;
-    struct hostless_config hostless;
 } auto_hal_module_t;
 
 /* Auto hal module struct */
@@ -71,104 +65,6 @@
     USECASE_AUDIO_PLAYBACK_PHONE,
 };
 
-/* Note: Due to ADP H/W design, SoC TERT/SEC TDM CLK and FSYNC lines are
- * both connected with CODEC and a single master is needed to provide
- * consistent CLK and FSYNC to slaves, hence configuring SoC TERT TDM as
- * single master and bring up a dummy hostless from TERT to SEC to ensure
- * both slave SoC SEC TDM and CODEC are driven upon system boot. */
-int32_t audio_extn_auto_hal_enable_hostless(void)
-{
-    int32_t ret = 0;
-    char mixer_path[MIXER_PATH_MAX_LENGTH];
-
-    ALOGD("%s: Enable TERT -> SEC Hostless", __func__);
-
-    if (auto_hal == NULL) {
-        ALOGE("%s: Invalid device", __func__);
-        return -EINVAL;
-    }
-
-    strlcpy(mixer_path, "dummy-hostless", MIXER_PATH_MAX_LENGTH);
-    ALOGD("%s: apply mixer and update path: %s", __func__, mixer_path);
-    if (audio_route_apply_and_update_path(auto_hal->adev->audio_route,
-            mixer_path)) {
-        ALOGD("%s: %s not supported, continue", __func__, mixer_path);
-        return ret;
-    }
-
-    /* TERT TDM TX 7 HOSTLESS to SEC TDM RX 7 HOSTLESS */
-    int pcm_dev_rx = 48, pcm_dev_tx = 49;
-    struct pcm_config pcm_config_lb = {
-        .channels = 1,
-        .rate = 48000,
-        .period_size = 240,
-        .period_count = 2,
-        .format = PCM_FORMAT_S16_LE,
-        .start_threshold = 0,
-        .stop_threshold = INT_MAX,
-        .avail_min = 0,
-    };
-
-    auto_hal->hostless.pcm_tx = pcm_open(auto_hal->adev->snd_card,
-                                   pcm_dev_tx,
-                                   PCM_IN, &pcm_config_lb);
-    if (auto_hal->hostless.pcm_tx &&
-        !pcm_is_ready(auto_hal->hostless.pcm_tx)) {
-        ALOGE("%s: %s", __func__,
-            pcm_get_error(auto_hal->hostless.pcm_tx));
-        ret = -EIO;
-        goto error;
-    }
-    auto_hal->hostless.pcm_rx = pcm_open(auto_hal->adev->snd_card,
-                                   pcm_dev_rx,
-                                   PCM_OUT, &pcm_config_lb);
-    if (auto_hal->hostless.pcm_rx &&
-        !pcm_is_ready(auto_hal->hostless.pcm_rx)) {
-        ALOGE("%s: %s", __func__,
-            pcm_get_error(auto_hal->hostless.pcm_rx));
-        ret = -EIO;
-        goto error;
-    }
-
-    if (pcm_start(auto_hal->hostless.pcm_tx) < 0) {
-        ALOGE("%s: pcm start for pcm tx failed", __func__);
-        ret = -EIO;
-        goto error;
-    }
-    if (pcm_start(auto_hal->hostless.pcm_rx) < 0) {
-        ALOGE("%s: pcm start for pcm rx failed", __func__);
-        ret = -EIO;
-        goto error;
-    }
-    return ret;
-
-error:
-    if (auto_hal->hostless.pcm_rx)
-        pcm_close(auto_hal->hostless.pcm_rx);
-    if (auto_hal->hostless.pcm_tx)
-        pcm_close(auto_hal->hostless.pcm_tx);
-    return ret;
-}
-
-void audio_extn_auto_hal_disable_hostless(void)
-{
-    ALOGD("%s: Disable TERT -> SEC Hostless", __func__);
-
-    if (auto_hal == NULL) {
-        ALOGE("%s: Invalid device", __func__);
-        return;
-    }
-
-    if (auto_hal->hostless.pcm_tx) {
-        pcm_close(auto_hal->hostless.pcm_tx);
-        auto_hal->hostless.pcm_tx = NULL;
-    }
-    if (auto_hal->hostless.pcm_rx) {
-        pcm_close(auto_hal->hostless.pcm_rx);
-        auto_hal->hostless.pcm_rx = NULL;
-    }
-}
-
 #define MAX_SOURCE_PORTS_PER_PATCH 1
 #define MAX_SINK_PORTS_PER_PATCH 1
 
@@ -578,11 +474,9 @@
         ALOGV("%s: snd card status %s", __func__, snd_card_status);
         if (strstr(snd_card_status, "OFFLINE")) {
             auto_hal->card_status = CARD_STATUS_OFFLINE;
-            audio_extn_auto_hal_disable_hostless();
         }
         else if (strstr(snd_card_status, "ONLINE")) {
             auto_hal->card_status = CARD_STATUS_ONLINE;
-            audio_extn_auto_hal_enable_hostless();
         }
     }
 
diff --git a/hal/audio_extn/ext_hw_plugin.c b/hal/audio_extn/ext_hw_plugin.c
index 6b4a718..619ecfc 100644
--- a/hal/audio_extn/ext_hw_plugin.c
+++ b/hal/audio_extn/ext_hw_plugin.c
@@ -77,85 +77,6 @@
 /* This can be defined in platform specific file or use compile flag */
 #define LIB_PLUGIN_DRIVER "libaudiohalplugin.so"
 
-/* Note: Due to ADP H/W design, SoC TERT/SEC TDM CLK and FSYNC lines are
- * both connected with CODEC and a single master is needed to provide
- * consistent CLK and FSYNC to slaves, hence configuring SoC TERT TDM as
- * single master and bring up a dummy hostless from TERT to SEC to ensure
- * both slave SoC SEC TDM and CODEC are driven upon system boot. */
-static void ext_hw_plugin_enable_adev_hostless(void *plugin)
-{
-    struct ext_hw_plugin_data *my_plugin =
-        (struct ext_hw_plugin_data *)plugin;
-    char mixer_path[MIXER_PATH_MAX_LENGTH];
-
-    ALOGI("%s: Enable TERT -> SEC Hostless", __func__);
-
-    strlcpy(mixer_path, "dummy-hostless", MIXER_PATH_MAX_LENGTH);
-    ALOGD("%s: apply mixer and update path: %s", __func__, mixer_path);
-    if (audio_route_apply_and_update_path(my_plugin->adev->audio_route,
-            mixer_path)) {
-        ALOGE("%s: %s not supported, continue", __func__, mixer_path);
-        return;
-    }
-
-    /* TERT TDM TX 7 HOSTLESS to SEC TDM RX 7 HOSTLESS */
-    int pcm_dev_rx = 48, pcm_dev_tx = 49;
-    struct pcm_config pcm_config_lb = {
-        .channels = 1,
-        .rate = 48000,
-        .period_size = 240,
-        .period_count = 2,
-        .format = PCM_FORMAT_S16_LE,
-        .start_threshold = 0,
-        .stop_threshold = INT_MAX,
-        .avail_min = 0,
-    };
-
-    my_plugin->adev_hostless.pcm_tx = pcm_open(my_plugin->adev->snd_card,
-                                   pcm_dev_tx,
-                                   PCM_IN, &pcm_config_lb);
-    if (my_plugin->adev_hostless.pcm_tx &&
-        !pcm_is_ready(my_plugin->adev_hostless.pcm_tx)) {
-        ALOGE("%s: %s", __func__,
-            pcm_get_error(my_plugin->adev_hostless.pcm_tx));
-        return;
-    }
-    my_plugin->adev_hostless.pcm_rx = pcm_open(my_plugin->adev->snd_card,
-                                   pcm_dev_rx,
-                                   PCM_OUT, &pcm_config_lb);
-    if (my_plugin->adev_hostless.pcm_rx &&
-        !pcm_is_ready(my_plugin->adev_hostless.pcm_rx)) {
-        ALOGE("%s: %s", __func__,
-            pcm_get_error(my_plugin->adev_hostless.pcm_rx));
-        return;
-    }
-
-    if (pcm_start(my_plugin->adev_hostless.pcm_tx) < 0) {
-        ALOGE("%s: pcm start for pcm tx failed", __func__);
-        return;
-    }
-    if (pcm_start(my_plugin->adev_hostless.pcm_rx) < 0) {
-        ALOGE("%s: pcm start for pcm rx failed", __func__);
-        return;
-    }
-}
-
-static void ext_hw_plugin_disable_adev_hostless(void *plugin)
-{
-    struct ext_hw_plugin_data *my_plugin = (struct ext_hw_plugin_data *)plugin;
-
-    ALOGI("%s: Disable TERT -> SEC Hostless", __func__);
-
-    if (my_plugin->adev_hostless.pcm_tx) {
-        pcm_close(my_plugin->adev_hostless.pcm_tx);
-        my_plugin->adev_hostless.pcm_tx = NULL;
-    }
-    if (my_plugin->adev_hostless.pcm_rx) {
-        pcm_close(my_plugin->adev_hostless.pcm_rx);
-        my_plugin->adev_hostless.pcm_rx = NULL;
-    }
-}
-
 void* ext_hw_plugin_init(struct audio_device *adev, ext_hw_plugin_init_config_t init_config)
 {
     int32_t ret = 0;
@@ -170,7 +91,6 @@
 
     my_plugin->adev = adev;
     fp_audio_route_apply_and_update_path = init_config.fp_audio_route_apply_and_update_path;
-    (void)audio_extn_auto_hal_enable_hostless();
 
     my_plugin->plugin_handle = dlopen(LIB_PLUGIN_DRIVER, RTLD_NOW);
     if (my_plugin->plugin_handle == NULL) {
@@ -209,7 +129,6 @@
             goto plugin_init_fail;
         }
     }
-    ext_hw_plugin_enable_adev_hostless(my_plugin);
     my_plugin->mic_mute = false;
     return my_plugin;
 
@@ -229,7 +148,6 @@
         ALOGE("[%s] NULL plugin pointer",__func__);
         return -EINVAL;
     }
-    ext_hw_plugin_disable_adev_hostless(my_plugin);
     if (my_plugin->audio_hal_plugin_deinit) {
         ret = my_plugin->audio_hal_plugin_deinit();
         if (ret) {
@@ -240,8 +158,6 @@
     if(my_plugin->plugin_handle != NULL)
         dlclose(my_plugin->plugin_handle);
 
-    audio_extn_auto_hal_disable_hostless();
-
     free(my_plugin);
     return ret;
 }
diff --git a/hal/audio_extn/soundtrigger.c b/hal/audio_extn/soundtrigger.c
index aa13c2b..1e28b86 100644
--- a/hal/audio_extn/soundtrigger.c
+++ b/hal/audio_extn/soundtrigger.c
@@ -274,10 +274,42 @@
 
 static void stdev_snd_mon_cb(void * stream __unused, struct str_parms * parms)
 {
+    audio_event_info_t event;
+    char value[32];
+    int ret = 0;
+
     if (!parms)
         return;
 
-    audio_extn_sound_trigger_set_parameters(NULL, parms);
+    ret = str_parms_get_str(parms, "SND_CARD_STATUS", value,
+                            sizeof(value));
+    if (ret > 0) {
+        if (strstr(value, "OFFLINE")) {
+            event.u.status = SND_CARD_STATUS_OFFLINE;
+            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
+        }
+        else if (strstr(value, "ONLINE")) {
+            event.u.status = SND_CARD_STATUS_ONLINE;
+            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
+        }
+        else
+            ALOGE("%s: unknown snd_card_status", __func__);
+    }
+
+    ret = str_parms_get_str(parms, "CPE_STATUS", value, sizeof(value));
+    if (ret > 0) {
+        if (strstr(value, "OFFLINE")) {
+            event.u.status = CPE_STATUS_OFFLINE;
+            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
+        }
+        else if (strstr(value, "ONLINE")) {
+            event.u.status = CPE_STATUS_ONLINE;
+            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
+        }
+        else
+            ALOGE("%s: unknown CPE status", __func__);
+    }
+
     return;
 }
 
@@ -630,34 +662,7 @@
         return;
     }
 
-    ret = str_parms_get_str(params, "SND_CARD_STATUS", value,
-                            sizeof(value));
-    if (ret > 0) {
-        if (strstr(value, "OFFLINE")) {
-            event.u.status = SND_CARD_STATUS_OFFLINE;
-            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
-        }
-        else if (strstr(value, "ONLINE")) {
-            event.u.status = SND_CARD_STATUS_ONLINE;
-            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
-        }
-        else
-            ALOGE("%s: unknown snd_card_status", __func__);
-    }
-
-    ret = str_parms_get_str(params, "CPE_STATUS", value, sizeof(value));
-    if (ret > 0) {
-        if (strstr(value, "OFFLINE")) {
-            event.u.status = CPE_STATUS_OFFLINE;
-            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
-        }
-        else if (strstr(value, "ONLINE")) {
-            event.u.status = CPE_STATUS_ONLINE;
-            st_dev->st_callback(AUDIO_EVENT_SSR, &event);
-        }
-        else
-            ALOGE("%s: unknown CPE status", __func__);
-    }
+    stdev_snd_mon_cb(NULL, params);
 
     ret = str_parms_get_int(params, "SVA_NUM_SESSIONS", &val);
     if (ret >= 0) {
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 7d8103b..397c86d 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -505,6 +505,10 @@
 static int out_set_voip_volume(struct audio_stream_out *stream, float left, float right);
 static int out_set_pcm_volume(struct audio_stream_out *stream, float left, float right);
 
+static void adev_snd_mon_cb(void *cookie, struct str_parms *parms);
+static void in_snd_mon_cb(void * stream, struct str_parms * parms);
+static void out_snd_mon_cb(void * stream, struct str_parms * parms);
+
 #ifdef AUDIO_FEATURE_ENABLED_GCOV
 extern void  __gcov_flush();
 static void enable_gcov()
@@ -2701,16 +2705,6 @@
     }
     enable_audio_route(adev, usecase);
 
-    /* Notify device change info to effect clients registered */
-    if (usecase->type == PCM_PLAYBACK) {
-        audio_extn_gef_notify_device_config(
-                usecase->stream.out->devices,
-                usecase->stream.out->channel_mask,
-                usecase->stream.out->app_type_cfg.sample_rate,
-                platform_get_snd_device_acdb_id(usecase->out_snd_device),
-                usecase->stream.out->app_type_cfg.app_type);
-    }
-
     audio_extn_qdsp_set_device(usecase);
 
     /* If input stream is already running then effect needs to be
@@ -5122,6 +5116,24 @@
             volume[1] = (long)(AmpToDb(right));
             mixer_ctl_set_array(ctl, volume, sizeof(volume)/sizeof(volume[0]));
             return 0;
+        } else if ((out->devices & AUDIO_DEVICE_OUT_BUS) &&
+                (audio_extn_auto_hal_get_snd_device_for_car_audio_stream(out) ==
+                    SND_DEVICE_OUT_BUS_MEDIA)) {
+            ALOGD("%s: Overriding offload set volume for media bus stream", __func__);
+            struct listnode *node = NULL;
+            list_for_each(node, &adev->active_outputs_list) {
+                streams_output_ctxt_t *out_ctxt = node_to_item(node,
+                                                    streams_output_ctxt_t,
+                                                    list);
+                if (out_ctxt->output->usecase == USECASE_AUDIO_PLAYBACK_MEDIA) {
+                    out->volume_l = out_ctxt->output->volume_l;
+                    out->volume_r = out_ctxt->output->volume_r;
+                }
+            }
+            if (!out->a2dp_compress_mute) {
+                ret = out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
+            }
+            return ret;
         } else {
             pthread_mutex_lock(&out->compr_mute_lock);
             ALOGV("%s: compress mute %d", __func__, out->a2dp_compress_mute);
@@ -8052,6 +8064,23 @@
     if (!parms)
         goto error;
 
+    /* notify adev and input/output streams on the snd card status */
+    adev_snd_mon_cb((void *)adev, parms);
+
+    list_for_each(node, &adev->active_outputs_list) {
+        streams_output_ctxt_t *out_ctxt = node_to_item(node,
+                                            streams_output_ctxt_t,
+                                            list);
+        out_snd_mon_cb((void *)out_ctxt->output, parms);
+    }
+
+    list_for_each(node, &adev->active_inputs_list) {
+        streams_input_ctxt_t *in_ctxt = node_to_item(node,
+                                            streams_input_ctxt_t,
+                                            list);
+        in_snd_mon_cb((void *)in_ctxt->input, parms);
+    }
+
     pthread_mutex_lock(&adev->lock);
     ret = str_parms_get_str(parms, "BT_SCO", value, sizeof(value));
     if (ret >= 0) {
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 8b9b53d..130c017 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -2778,11 +2778,18 @@
 
 struct audio_custom_mtmx_params *
     platform_get_custom_mtmx_params(void *platform,
-                                    struct audio_custom_mtmx_params_info *info)
+                                    struct audio_custom_mtmx_params_info *info,
+                                    uint32_t *idx)
 {
     struct platform_data *my_data = (struct platform_data *)platform;
     struct listnode *node = NULL;
     struct audio_custom_mtmx_params *params = NULL;
+    int i = 0;
+
+    if (!info || !idx) {
+        ALOGE("%s: Invalid params", __func__);
+        return NULL;
+    }
 
     list_for_each(node, &my_data->custom_mtmx_params_list) {
         params = node_to_item(node, struct audio_custom_mtmx_params, list);
@@ -2790,17 +2797,22 @@
             params->info.id == info->id &&
             params->info.ip_channels == info->ip_channels &&
             params->info.op_channels == info->op_channels &&
-            params->info.usecase_id == info->usecase_id &&
             params->info.snd_device == info->snd_device) {
-            ALOGV("%s: found params with ip_ch %d op_ch %d uc_id %d snd_dev %d",
-                  __func__, info->ip_channels, info->op_channels,
-                  info->usecase_id, info->snd_device);
-            return params;
+            while (params->info.usecase_id[i] != 0) {
+                if (params->info.usecase_id[i] == info->usecase_id[0]) {
+                    ALOGV("%s: found params with ip_ch %d op_ch %d uc_id %d snd_dev %d",
+                           __func__, info->ip_channels, info->op_channels,
+                           info->usecase_id[0], info->snd_device);
+                    *idx = i;
+                    return params;
+                }
+                i++;
+            }
         }
     }
     ALOGI("%s: no matching param with id %d ip_ch %d op_ch %d uc_id %d snd_dev %d",
           __func__, info->id, info->ip_channels, info->op_channels,
-          info->usecase_id, info->snd_device);
+          info->usecase_id[0], info->snd_device);
     return NULL;
 }
 
@@ -2810,6 +2822,12 @@
     struct platform_data *my_data = (struct platform_data *)platform;
     struct audio_custom_mtmx_params *params = NULL;
     uint32_t size = sizeof(*params);
+    int i = 0;
+
+    if (!info) {
+        ALOGE("%s: Invalid params", __func__);
+        return NULL;
+    }
 
     if (info->ip_channels > AUDIO_CHANNEL_COUNT_MAX ||
         info->op_channels > AUDIO_CHANNEL_COUNT_MAX) {
@@ -2825,9 +2843,14 @@
         return -ENOMEM;
     }
 
-    ALOGI("%s: adding mtmx params with id %d ip_ch %d op_ch %d uc_id %d snd_dev %d",
+    ALOGI("%s: adding mtmx params with id %d ip_ch %d op_ch %d snd_dev %d",
           __func__, info->id, info->ip_channels, info->op_channels,
-          info->usecase_id, info->snd_device);
+          info->snd_device);
+    while (info->usecase_id[i] != 0) {
+        ALOGI("%s: supported usecase ids for added mtmx params %d",
+              __func__, info->usecase_id[i]);
+        i++;
+    }
 
     params->info = *info;
     list_add_tail(&my_data->custom_mtmx_params_list, &params->list);
@@ -3696,6 +3719,17 @@
                   __func__, new_snd_device[i]);
             return -EINVAL;
         }
+
+        /* Notify device change info to effect clients registered */
+        if (usecase->type == PCM_PLAYBACK) {
+            audio_extn_gef_notify_device_config(
+                    usecase->stream.out->devices,
+                    usecase->stream.out->channel_mask,
+                    sample_rate,
+                    acdb_dev_id,
+                    usecase->stream.out->app_type_cfg.app_type);
+        }
+
         ALOGV("%s: sending audio calibration for snd_device(%d) acdb_id(%d)",
               __func__, new_snd_device[i], acdb_dev_id);
         if (new_snd_device[i] >= SND_DEVICE_OUT_BEGIN &&
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index 137e700..90105cd 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -357,7 +357,8 @@
     platform_get_custom_mtmx_params
     (
         void *platform __unused,
-        struct audio_custom_mtmx_params_info *info __unused
+        struct audio_custom_mtmx_params_info *info __unused,
+        uint32_t *idx __unused
     )
 {
     ALOGW("%s: not implemented!", __func__);
@@ -558,6 +559,17 @@
               __func__, snd_device);
         return -EINVAL;
     }
+
+    /* Notify device change info to effect clients registered */
+    if (usecase->type == PCM_PLAYBACK) {
+        audio_extn_gef_notify_device_config(
+                usecase->stream.out->devices,
+                usecase->stream.out->channel_mask,
+                usecase->stream.out->app_type_cfg.sample_rate,
+                acdb_dev_id,
+                usecase->stream.out->app_type_cfg.app_type);
+    }
+
     if (my_data->acdb_send_audio_cal) {
         ("%s: sending audio calibration for snd_device(%d) acdb_id(%d)",
               __func__, snd_device, acdb_dev_id);
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index c7d2090..d4128b5 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -2019,7 +2019,9 @@
         !strncmp(snd_card_name, "sdx-tavil-i2s-snd-card",
                  sizeof("sdx-tavil-i2s-snd-card")) ||
         !strncmp(snd_card_name, "sda845-tavil-i2s-snd-card",
-                 sizeof("sda845-tavil-i2s-snd-card"))) {
+                 sizeof("sda845-tavil-i2s-snd-card")) ||
+        !strncmp(snd_card_name, "sa6155-adp-star-snd-card",
+                 sizeof("sa6155-adp-star-snd-card"))) {
         plat_data->is_i2s_ext_modem = true;
     }
     ALOGV("%s, is_i2s_ext_modem:%d soundcard name is %s",__func__,
@@ -2028,6 +2030,20 @@
     return plat_data->is_i2s_ext_modem;
 }
 
+static bool is_auto_snd_card(const char *snd_card_name)
+{
+    bool is_auto_snd_card = false;
+
+    if (!strncmp(snd_card_name, "sa6155-adp-star-snd-card",
+                 sizeof("sa6155-adp-star-snd-card"))) {
+        is_auto_snd_card = true;
+        ALOGV("%s : Auto snd card detected: soundcard name is %s",__func__,
+               snd_card_name);
+    }
+
+    return is_auto_snd_card;
+}
+
 static void set_platform_defaults(struct platform_data * my_data)
 {
     int32_t dev;
@@ -2925,7 +2941,8 @@
         return NULL;
     }
 
-    if (platform_is_i2s_ext_modem(snd_card_name, my_data)) {
+    if (platform_is_i2s_ext_modem(snd_card_name, my_data) &&
+        !is_auto_snd_card(snd_card_name)) {
         ALOGD("%s: Call MIXER_XML_PATH_I2S", __func__);
 
         adev->audio_route = audio_route_init(adev->snd_card,
@@ -3163,7 +3180,7 @@
 
 
     /* Initialize ACDB ID's */
-    if (my_data->is_i2s_ext_modem)
+    if (my_data->is_i2s_ext_modem && !is_auto_snd_card(snd_card_name))
         platform_info_init(PLATFORM_INFO_XML_PATH_I2S, my_data, PLATFORM);
     else if (!strncmp(snd_card_name, "sdm660-snd-card-skush",
                sizeof("sdm660-snd-card-skush")))
@@ -3362,6 +3379,7 @@
     property_get("ro.baseband", baseband, "");
     if ((!strncmp("apq8084", platform, sizeof("apq8084")) ||
         !strncmp("msm8996", platform, sizeof("msm8996")) ||
+        !strncmp("sm6150", platform, sizeof("sm6150")) ||
         !strncmp("sdx", platform, sizeof("sdx")) ||
         !strncmp("sdm845", platform, sizeof("sdm845"))) &&
         ( !strncmp("mdm", baseband, (sizeof("mdm")-1)) ||
@@ -3682,11 +3700,18 @@
 
 struct audio_custom_mtmx_params *
     platform_get_custom_mtmx_params(void *platform,
-                                    struct audio_custom_mtmx_params_info *info)
+                                    struct audio_custom_mtmx_params_info *info,
+                                    uint32_t *idx)
 {
     struct platform_data *my_data = (struct platform_data *)platform;
     struct listnode *node = NULL;
     struct audio_custom_mtmx_params *params = NULL;
+    int i = 0;
+
+    if (!info || !idx) {
+        ALOGE("%s: Invalid params", __func__);
+        return NULL;
+    }
 
     list_for_each(node, &my_data->custom_mtmx_params_list) {
         params = node_to_item(node, struct audio_custom_mtmx_params, list);
@@ -3694,17 +3719,22 @@
             params->info.id == info->id &&
             params->info.ip_channels == info->ip_channels &&
             params->info.op_channels == info->op_channels &&
-            params->info.usecase_id == info->usecase_id &&
             params->info.snd_device == info->snd_device) {
-            ALOGV("%s: found params with ip_ch %d op_ch %d uc_id %d snd_dev %d",
-                  __func__, info->ip_channels, info->op_channels,
-                  info->usecase_id, info->snd_device);
-            return params;
+            while (params->info.usecase_id[i] != 0) {
+                if (params->info.usecase_id[i] == info->usecase_id[0]) {
+                    ALOGV("%s: found params with ip_ch %d op_ch %d uc_id %d snd_dev %d",
+                           __func__, info->ip_channels, info->op_channels,
+                           info->usecase_id[0], info->snd_device);
+                    *idx = i;
+                    return params;
+                }
+                i++;
+            }
         }
     }
     ALOGI("%s: no matching param with id %d ip_ch %d op_ch %d uc_id %d snd_dev %d",
           __func__, info->id, info->ip_channels, info->op_channels,
-          info->usecase_id, info->snd_device);
+          info->usecase_id[0], info->snd_device);
     return NULL;
 }
 
@@ -3714,6 +3744,12 @@
     struct platform_data *my_data = (struct platform_data *)platform;
     struct audio_custom_mtmx_params *params = NULL;
     uint32_t size = sizeof(*params);
+    int i = 0;
+
+    if (!info) {
+        ALOGE("%s: Invalid params", __func__);
+        return -EINVAL;
+    }
 
     if (info->ip_channels > AUDIO_CHANNEL_COUNT_MAX ||
         info->op_channels > AUDIO_CHANNEL_COUNT_MAX) {
@@ -3729,9 +3765,14 @@
         return -ENOMEM;
     }
 
-    ALOGI("%s: adding mtmx params with id %d ip_ch %d op_ch %d uc_id %d snd_dev %d",
+    ALOGI("%s: adding mtmx params with id %d ip_ch %d op_ch %d snd_dev %d",
           __func__, info->id, info->ip_channels, info->op_channels,
-          info->usecase_id, info->snd_device);
+          info->snd_device);
+    while (info->usecase_id[i] != 0) {
+        ALOGI("%s: supported usecase ids for added mtmx params %d",
+              __func__, info->usecase_id[i]);
+        i++;
+    }
 
     params->info = *info;
     list_add_tail(&my_data->custom_mtmx_params_list, &params->list);
@@ -3755,20 +3796,30 @@
     struct platform_data *my_data = (struct platform_data *)platform;
     struct listnode *node = NULL;
     struct audio_custom_mtmx_in_params *params = NULL;
+    int i = 0;
+
+    if (!info) {
+        ALOGE("%s: Invalid params", __func__);
+        return NULL;
+    }
 
     list_for_each(node, &my_data->custom_mtmx_in_params_list) {
         params = node_to_item(node, struct audio_custom_mtmx_in_params, list);
         if (params &&
-            params->in_info.op_channels == info->op_channels &&
-            params->in_info.usecase_id == info->usecase_id) {
-            ALOGV("%s: found params with op_ch %d uc_id %d",
-                  __func__, info->op_channels, info->usecase_id);
-            return params;
+            params->in_info.op_channels == info->op_channels) {
+            while (params->in_info.usecase_id[i] != 0) {
+                if (params->in_info.usecase_id[i] == info->usecase_id[0]) {
+                    ALOGV("%s: found params with op_ch %d uc_id %d",
+                          __func__, info->op_channels, info->usecase_id[0]);
+                    return params;
+                }
+                i++;
+            }
         }
     }
 
     ALOGI("%s: no matching param with op_ch %d uc_id %d",
-           __func__, info->op_channels, info->usecase_id);
+           __func__, info->op_channels, info->usecase_id[0]);
     return NULL;
 }
 
@@ -3778,6 +3829,12 @@
     struct platform_data *my_data = (struct platform_data *)platform;
     struct audio_custom_mtmx_in_params *params = NULL;
     uint32_t size = sizeof(*params);
+    int i = 0;
+
+    if (!info) {
+        ALOGE("%s: Invalid params", __func__);
+        return -EINVAL;
+    }
 
     if (info->op_channels > AUDIO_CHANNEL_COUNT_MAX) {
         ALOGE("%s: unusupported channels in %d", __func__, info->op_channels);
@@ -3790,8 +3847,14 @@
         return -ENOMEM;
     }
 
-    ALOGI("%s: adding mtmx in params with op_ch %d uc_id %d",
-          __func__, info->op_channels, info->usecase_id);
+    ALOGI("%s: adding mtmx in params with op_ch %d",
+          __func__, info->op_channels);
+
+    while (info->usecase_id[i] != 0) {
+        ALOGI("%s: supported usecase ids for added mtmx in params %d",
+              __func__, info->usecase_id[i]);
+        i++;
+    }
 
     params->in_info = *info;
     list_add_tail(&my_data->custom_mtmx_in_params_list, &params->list);
@@ -4918,6 +4981,17 @@
                   __func__, new_snd_device[i]);
             return -EINVAL;
         }
+
+        /* Notify device change info to effect clients registered */
+        if (usecase->type == PCM_PLAYBACK) {
+            audio_extn_gef_notify_device_config(
+                    usecase->stream.out->devices,
+                    usecase->stream.out->channel_mask,
+                    sample_rate,
+                    acdb_dev_id,
+                    usecase->stream.out->app_type_cfg.app_type);
+        }
+
         ALOGV("%s: sending audio calibration for snd_device(%d) acdb_id(%d)",
               __func__, new_snd_device[i], acdb_dev_id);
         if (new_snd_device[i] >= SND_DEVICE_OUT_BEGIN &&
@@ -6213,6 +6287,7 @@
     int str_bitwidth = (in == NULL) ? CODEC_BACKEND_DEFAULT_BIT_WIDTH : in->bit_width;
     int sample_rate = (in == NULL) ? 8000 : in->sample_rate;
     struct audio_usecase *usecase = NULL;
+    audio_usecase_t uc_id = (in == NULL) ? USECASE_AUDIO_RECORD : in->usecase;
 
     ALOGV("%s: enter: out_device(%#x) in_device(%#x) channel_count (%d) channel_mask (0x%x)",
           __func__, out_device, in_device, channel_count, channel_mask);
@@ -6622,7 +6697,7 @@
             }
         } else if (in_device & AUDIO_DEVICE_IN_LOOPBACK) {
             if (in_device & AUDIO_DEVICE_IN_BUILTIN_MIC) {
-                usecase = get_usecase_from_list(adev, USECASE_AUDIO_RECORD);
+                usecase = get_usecase_from_list(adev, uc_id);
                 if (usecase == NULL) {
                     ALOGE("%s: Could not find the record usecase", __func__);
                     snd_device = SND_DEVICE_NONE;
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index 13f85e6..7b4647a 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -586,6 +586,14 @@
 #define VOLTE_CALL_PCM_DEVICE 15
 #define QCHAT_CALL_PCM_DEVICE 37
 #define VOWLAN_CALL_PCM_DEVICE 16
+#elif PLATFORM_AUTO
+#define HOST_LESS_RX_ID 41
+#define HOST_LESS_TX_ID 42
+#define VOICE_CALL_PCM_DEVICE 8
+#define VOICE2_CALL_PCM_DEVICE -1
+#define VOLTE_CALL_PCM_DEVICE -1
+#define QCHAT_CALL_PCM_DEVICE -1
+#define VOWLAN_CALL_PCM_DEVICE -1
 #else
 #define VOICE_CALL_PCM_DEVICE 2
 #define VOICE2_CALL_PCM_DEVICE 22
diff --git a/hal/platform_api.h b/hal/platform_api.h
index 394310a..30a10c5 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -35,6 +35,7 @@
 #define PRODUCT_FFV      "ffv"
 #define PRODUCT_ALLPLAY  "allplay"
 #define MAX_IN_CHANNELS 32
+#define CUSTOM_MTRX_PARAMS_MAX_USECASE 8
 
 typedef enum {
     PLATFORM,
@@ -103,9 +104,9 @@
     uint32_t id;
     uint32_t ip_channels;
     uint32_t op_channels;
-    uint32_t usecase_id;
+    uint32_t usecase_id[CUSTOM_MTRX_PARAMS_MAX_USECASE];
     uint32_t snd_device;
-    char fe_name[128];
+    uint32_t fe_id[CUSTOM_MTRX_PARAMS_MAX_USECASE];
 };
 
 struct audio_custom_mtmx_params {
@@ -116,7 +117,7 @@
 
 struct audio_custom_mtmx_in_params_info {
     uint32_t op_channels;
-    uint32_t usecase_id;
+    uint32_t usecase_id[CUSTOM_MTRX_PARAMS_MAX_USECASE];
 };
 
 struct audio_custom_mtmx_params_in_ch_info {
@@ -377,7 +378,8 @@
 int platform_get_delay(void *platform, int pcm_device_id);
 struct audio_custom_mtmx_params *
     platform_get_custom_mtmx_params(void *platform,
-                                    struct audio_custom_mtmx_params_info *info);
+                                    struct audio_custom_mtmx_params_info *info,
+                                    uint32_t *idx);
 int platform_add_custom_mtmx_params(void *platform,
                                     struct audio_custom_mtmx_params_info *info);
 /* callback functions from platform to common audio HAL */
diff --git a/hal/platform_info.c b/hal/platform_info.c
index 8ee8b07..d73792c 100644
--- a/hal/platform_info.c
+++ b/hal/platform_info.c
@@ -653,6 +653,8 @@
     }
 
     str_parms_add_str(my_data.kvpairs, (char*)attr[1], (char*)attr[3]);
+    if (my_data.caller == PLATFORM)
+        platform_set_parameters(my_data.platform, my_data.kvpairs);
 done:
     return;
 }
@@ -1068,13 +1070,19 @@
 
 static void process_custom_mtmx_in_params(const XML_Char **attr)
 {
-    int attr_idx = 0;
+    int attr_idx = 0, i = 0;
+    char *context = NULL, *value = NULL;
 
     if (strcmp(attr[attr_idx++], "usecase") != 0) {
         ALOGE("%s: 'usecase' not found", __func__);
         return;
     }
-    mtmx_in_params_info.usecase_id = platform_get_usecase_index((char *)attr[attr_idx++]);
+    /* Check if multi usecases are supported for this custom mtrx params */
+    value = strtok_r((char *)attr[attr_idx++], ",", &context);
+    while (value && (i < CUSTOM_MTRX_PARAMS_MAX_USECASE)) {
+        mtmx_in_params_info.usecase_id[i++] = platform_get_usecase_index(value);
+        value = strtok_r(NULL, ",", &context);
+    }
 
     if (strcmp(attr[attr_idx++], "out_channel_count") != 0) {
         ALOGE("%s: 'out_channel_count' not found", __func__);
@@ -1089,7 +1097,7 @@
 static void process_custom_mtmx_param_coeffs(const XML_Char **attr)
 {
     uint32_t attr_idx = 0, out_ch_idx = -1, ch_coeff_count = 0;
-    uint32_t ip_channels = 0, op_channels = 0;
+    uint32_t ip_channels = 0, op_channels = 0, idx = 0;
     char *context = NULL, *ch_coeff_value = NULL;
     struct audio_custom_mtmx_params *mtmx_params = NULL;
 
@@ -1109,7 +1117,7 @@
         return;
     }
     mtmx_params = platform_get_custom_mtmx_params((void *)my_data.platform,
-                                                  &mtmx_params_info);
+                                                  &mtmx_params_info, &idx);
     if (mtmx_params == NULL) {
         ALOGE("%s: mtmx params with given param info, not found", __func__);
         return;
@@ -1129,7 +1137,10 @@
 
 static void process_custom_mtmx_params(const XML_Char **attr)
 {
-    int attr_idx = 0;
+    int attr_idx = 0, i = 0;
+    char *context = NULL, *value = NULL;
+
+    memset(&mtmx_params_info, 0, sizeof(mtmx_params_info));
 
     if (strcmp(attr[attr_idx++], "param_id") != 0) {
         ALOGE("%s: 'param_id' not found", __func__);
@@ -1153,7 +1164,13 @@
         ALOGE("%s: 'usecase' not found", __func__);
         return;
     }
-    mtmx_params_info.usecase_id = platform_get_usecase_index((char *)attr[attr_idx++]);
+
+    /* check if multi usecases are supported for this custom mtrx params */
+    value = strtok_r((char *)attr[attr_idx++], ",", &context);
+    while (value && (i < CUSTOM_MTRX_PARAMS_MAX_USECASE)) {
+        mtmx_params_info.usecase_id[i++] = platform_get_usecase_index(value);
+        value = strtok_r(NULL, ",", &context);
+    }
 
     if (strcmp(attr[attr_idx++], "snd_device") != 0) {
         ALOGE("%s: 'snd_device' not found", __func__);
@@ -1161,12 +1178,15 @@
     }
     mtmx_params_info.snd_device = platform_get_snd_device_index((char *)attr[attr_idx++]);
 
-    if ((attr[attr_idx] != NULL) && (strcmp(attr[attr_idx++], "fe_name") == 0)) {
-        strlcpy(mtmx_params_info.fe_name, (char *)attr[attr_idx++],
-                sizeof(mtmx_params_info.fe_name));
-    } else {
-        ALOGD("%s: 'fe_name' not found", __func__);
-        mtmx_params_info.fe_name[0] = '\0';
+    if ((attr[attr_idx] != NULL) && (strcmp(attr[attr_idx++], "fe_id") == 0)) {
+        i = 0;
+        value = strtok_r((char *)attr[attr_idx++], ",", &context);
+        while (value && (i < CUSTOM_MTRX_PARAMS_MAX_USECASE)) {
+            mtmx_params_info.fe_id[i++] = atoi(value);
+            value = strtok_r(NULL, ",", &context);
+        }
+
+        attr_idx++;
     }
 
     platform_add_custom_mtmx_params((void *)my_data.platform, &mtmx_params_info);
@@ -1387,9 +1407,6 @@
         section = ROOT;
     } else if (strcmp(tag_name, "config_params") == 0) {
         section = ROOT;
-        if (my_data.caller == PLATFORM) {
-            platform_set_parameters(my_data.platform, my_data.kvpairs);
-        }
     } else if (strcmp(tag_name, "operator_specific") == 0) {
         section = ROOT;
     } else if (strcmp(tag_name, "interface_names") == 0) {
diff --git a/hal/voice.c b/hal/voice.c
index 006dd08..c455537 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -48,6 +48,10 @@
     .format = PCM_FORMAT_S16_LE,
 };
 
+#ifdef PLATFORM_AUTO
+struct pcm *voice_loopback_tx = NULL;
+struct pcm *voice_loopback_rx = NULL;
+#endif
 static struct voice_session *voice_get_session_from_use_case(struct audio_device *adev,
                               audio_usecase_t usecase_id)
 {
@@ -182,6 +186,16 @@
         session->pcm_tx = NULL;
     }
 
+#ifdef PLATFORM_AUTO
+    if(voice_loopback_rx) {
+        pcm_close(voice_loopback_rx);
+        voice_loopback_rx = NULL;
+    }
+    if(voice_loopback_tx) {
+        pcm_close(voice_loopback_tx);
+        voice_loopback_tx = NULL;
+    }
+#endif
     /* 2. Get and set stream specific mixer controls */
     disable_audio_route(adev, uc_info);
 
@@ -201,6 +215,9 @@
     int ret = 0;
     struct audio_usecase *uc_info;
     int pcm_dev_rx_id, pcm_dev_tx_id;
+#ifdef PLATFORM_AUTO
+    int pcm_dev_loopback_rx_id, pcm_dev_loopback_tx_id;
+#endif
     uint32_t sample_rate = 8000;
     struct voice_session *session = NULL;
     struct pcm_config voice_config = pcm_config_voice_call;
@@ -246,6 +263,10 @@
 
     select_devices(adev, usecase_id);
 
+#ifdef PLATFORM_AUTO
+    pcm_dev_loopback_rx_id = HOST_LESS_RX_ID;
+    pcm_dev_loopback_tx_id = HOST_LESS_TX_ID;
+#endif
     pcm_dev_rx_id = platform_get_pcm_device_id(uc_info->id, PCM_PLAYBACK);
     pcm_dev_tx_id = platform_get_pcm_device_id(uc_info->id, PCM_CAPTURE);
 
@@ -287,6 +308,28 @@
         goto error_start_voice;
     }
 
+#ifdef PLATFORM_AUTO
+    voice_loopback_rx = pcm_open(adev->snd_card,
+                                 pcm_dev_loopback_rx_id,
+                                 PCM_OUT, &voice_config);
+    if (voice_loopback_rx < 0 || !pcm_is_ready(voice_loopback_rx)) {
+        ALOGE("%s: Either could not open pcm_dev_loopback_rx_id %d or %s",
+              __func__, pcm_dev_loopback_rx_id, pcm_get_error(voice_loopback_rx));
+        ret = -EIO;
+        goto error_start_voice;
+    }
+
+    voice_loopback_tx = pcm_open(adev->snd_card,
+                                 pcm_dev_loopback_tx_id,
+                                 PCM_IN, &voice_config);
+    if (voice_loopback_tx < 0 || !pcm_is_ready(voice_loopback_tx)) {
+         ALOGE("%s: Either could not open pcm_dev_loopback_tx_id %d or %s",
+               __func__, pcm_dev_loopback_tx_id, pcm_get_error(voice_loopback_tx));
+         ret = -EIO;
+         goto error_start_voice;
+    }
+#endif
+
     if(adev->mic_break_enabled)
         platform_set_mic_break_det(adev->platform, true);
 
@@ -302,6 +345,20 @@
         goto error_start_voice;
     }
 
+#ifdef PLATFORM_AUTO
+    ret = pcm_start(voice_loopback_tx);
+    if (ret != 0) {
+        ALOGE("%s: %s", __func__, pcm_get_error(voice_loopback_tx));
+        goto error_start_voice;
+    }
+
+    ret = pcm_start(voice_loopback_rx);
+    if (ret != 0) {
+        ALOGE("%s: %s", __func__, pcm_get_error(voice_loopback_rx));
+        goto error_start_voice;
+    }
+#endif
+
     /* Enable aanc only when no calls are active */
     if (!voice_is_call_state_active(adev))
         voice_check_and_update_aanc_path(adev, uc_info->out_snd_device, true);