Merge "configs: allocate dedicated pcm node for in call recording"
diff --git a/configs/atoll/audio_io_policy.conf b/configs/atoll/audio_io_policy.conf
index 7e00464..0f1f93e 100644
--- a/configs/atoll/audio_io_policy.conf
+++ b/configs/atoll/audio_io_policy.conf
@@ -102,4 +102,25 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
 }
diff --git a/configs/bengal/audio_io_policy.conf b/configs/bengal/audio_io_policy.conf
index 7e00464..0f1f93e 100644
--- a/configs/bengal/audio_io_policy.conf
+++ b/configs/bengal/audio_io_policy.conf
@@ -102,4 +102,25 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
 }
diff --git a/configs/holi/audio_io_policy.conf b/configs/holi/audio_io_policy.conf
index 7e00464..0f1f93e 100644
--- a/configs/holi/audio_io_policy.conf
+++ b/configs/holi/audio_io_policy.conf
@@ -102,4 +102,25 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
 }
diff --git a/configs/kona/audio_io_policy.conf b/configs/kona/audio_io_policy.conf
index 7e00464..c4a6f89 100644
--- a/configs/kona/audio_io_policy.conf
+++ b/configs/kona/audio_io_policy.conf
@@ -102,4 +102,39 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
+  voip_tx {
+    flags AUDIO_INPUT_FLAG_VOIP_TX
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|48000
+    bit_width 16
+    app_type 69946
+  }
+  low_latency_voip_tx {
+    flags AUDIO_INPUT_FLAG_FAST|AUDIO_INPUT_FLAG_VOIP_TX
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 48000
+    bit_width 16
+    app_type 69946
+  }
 }
diff --git a/configs/kona/audio_platform_info.xml b/configs/kona/audio_platform_info.xml
index c6ed1be..82b7214 100644
--- a/configs/kona/audio_platform_info.xml
+++ b/configs/kona/audio_platform_info.xml
@@ -102,6 +102,7 @@
         <usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
@@ -167,6 +168,7 @@
         <device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
+        <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" interface="TX_CDC_DMA_TX_3"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="WSA_CDC_DMA_RX_0"/>
diff --git a/configs/kona/audio_platform_info_intcodec.xml b/configs/kona/audio_platform_info_intcodec.xml
index 5f68228..d5e022e 100644
--- a/configs/kona/audio_platform_info_intcodec.xml
+++ b/configs/kona/audio_platform_info_intcodec.xml
@@ -83,6 +83,7 @@
         <usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
@@ -165,6 +166,7 @@
         <device name="SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_TTY_VCO_HEADSET" backend="headset" interface="RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
+        <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_1" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0"/>
diff --git a/configs/kona/audio_platform_info_qrd.xml b/configs/kona/audio_platform_info_qrd.xml
index d93c76c..f67096f 100644
--- a/configs/kona/audio_platform_info_qrd.xml
+++ b/configs/kona/audio_platform_info_qrd.xml
@@ -81,6 +81,7 @@
         <usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
@@ -185,6 +186,7 @@
         <device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET" backend="handset" interface="RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" backend="handset" interface="RX_CDC_DMA_RX_0"/>
+        <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" backend="handset" interface="RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" interface="TX_CDC_DMA_TX_3"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="WSA_CDC_DMA_RX_0"/>
diff --git a/configs/kona/mixer_paths.xml b/configs/kona/mixer_paths.xml
index 69e4981..582399a 100644
--- a/configs/kona/mixer_paths.xml
+++ b/configs/kona/mixer_paths.xml
@@ -512,6 +512,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2281,6 +2296,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/kona/mixer_paths_cdp.xml b/configs/kona/mixer_paths_cdp.xml
index 0b24ab3..1d946be 100644
--- a/configs/kona/mixer_paths_cdp.xml
+++ b/configs/kona/mixer_paths_cdp.xml
@@ -498,6 +498,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2123,6 +2138,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/kona/mixer_paths_qrd.xml b/configs/kona/mixer_paths_qrd.xml
index 71c7f03..fa3cc3a 100644
--- a/configs/kona/mixer_paths_qrd.xml
+++ b/configs/kona/mixer_paths_qrd.xml
@@ -492,6 +492,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="One"/>
@@ -2142,6 +2157,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lahaina/audio_io_policy.conf b/configs/lahaina/audio_io_policy.conf
index 7e00464..c5197b3 100644
--- a/configs/lahaina/audio_io_policy.conf
+++ b/configs/lahaina/audio_io_policy.conf
@@ -102,4 +102,39 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
+  voip_tx {
+    flags AUDIO_INPUT_FLAG_VOIP_TX
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|48000
+    bit_width 16
+    app_type 69946
+  }
+  low_latency_voip_tx {
+    flags AUDIO_INPUT_FLAG_VOIP_TX|AUDIO_INPUT_FLAG_FAST
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 48000
+    bit_width 16
+    app_type 69946
+  }
 }
diff --git a/configs/lahaina/audio_platform_info.xml b/configs/lahaina/audio_platform_info.xml
index fc1d0c7..dc1cbf1 100644
--- a/configs/lahaina/audio_platform_info.xml
+++ b/configs/lahaina/audio_platform_info.xml
@@ -104,6 +104,7 @@
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY2" type="in" id="42"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
@@ -169,6 +170,7 @@
         <device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
+        <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" interface="TX_CDC_DMA_TX_3"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="WSA_CDC_DMA_RX_0"/>
diff --git a/configs/lahaina/audio_platform_info_intcodec.xml b/configs/lahaina/audio_platform_info_intcodec.xml
index 3d95616..dca5e54 100644
--- a/configs/lahaina/audio_platform_info_intcodec.xml
+++ b/configs/lahaina/audio_platform_info_intcodec.xml
@@ -84,6 +84,7 @@
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY2" type="in" id="42"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
@@ -185,6 +186,7 @@
         <device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" interface="WSA_CDC_DMA_RX_0"/>
+        <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" interface="TX_CDC_DMA_TX_3"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="WSA_CDC_DMA_RX_0"/>
diff --git a/configs/lahaina/audio_platform_info_qrd.xml b/configs/lahaina/audio_platform_info_qrd.xml
index 9e1596e..4f2af32 100644
--- a/configs/lahaina/audio_platform_info_qrd.xml
+++ b/configs/lahaina/audio_platform_info_qrd.xml
@@ -84,6 +84,7 @@
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY2" type="in" id="42"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
@@ -185,6 +186,7 @@
         <device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" interface="WSA_CDC_DMA_RX_0"/>
+        <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" interface="TX_CDC_DMA_TX_3"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
         <device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="WSA_CDC_DMA_RX_0"/>
diff --git a/configs/lahaina/mixer_paths.xml b/configs/lahaina/mixer_paths.xml
index 82caaa6..5776744 100644
--- a/configs/lahaina/mixer_paths.xml
+++ b/configs/lahaina/mixer_paths.xml
@@ -530,6 +530,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2299,6 +2314,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lahaina/mixer_paths_cdp.xml b/configs/lahaina/mixer_paths_cdp.xml
index 789c6a0..943da4d 100644
--- a/configs/lahaina/mixer_paths_cdp.xml
+++ b/configs/lahaina/mixer_paths_cdp.xml
@@ -524,6 +524,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2149,6 +2164,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lahaina/mixer_paths_qrd.xml b/configs/lahaina/mixer_paths_qrd.xml
index ff3d0f9..13df7ba 100644
--- a/configs/lahaina/mixer_paths_qrd.xml
+++ b/configs/lahaina/mixer_paths_qrd.xml
@@ -523,6 +523,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2292,6 +2307,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lito/audio_io_policy.conf b/configs/lito/audio_io_policy.conf
index 7e00464..c4a6f89 100644
--- a/configs/lito/audio_io_policy.conf
+++ b/configs/lito/audio_io_policy.conf
@@ -102,4 +102,39 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
+  voip_tx {
+    flags AUDIO_INPUT_FLAG_VOIP_TX
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|48000
+    bit_width 16
+    app_type 69946
+  }
+  low_latency_voip_tx {
+    flags AUDIO_INPUT_FLAG_FAST|AUDIO_INPUT_FLAG_VOIP_TX
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 48000
+    bit_width 16
+    app_type 69946
+  }
 }
diff --git a/configs/lito/audio_platform_info.xml b/configs/lito/audio_platform_info.xml
index 8c440a7..410b6e9 100644
--- a/configs/lito/audio_platform_info.xml
+++ b/configs/lito/audio_platform_info.xml
@@ -94,6 +94,7 @@
         <usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
diff --git a/configs/lito/audio_platform_info_intcodec.xml b/configs/lito/audio_platform_info_intcodec.xml
index a73c388..d44127f 100644
--- a/configs/lito/audio_platform_info_intcodec.xml
+++ b/configs/lito/audio_platform_info_intcodec.xml
@@ -56,6 +56,7 @@
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
         <usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="12" />
diff --git a/configs/lito/audio_platform_info_lagoon_qrd.xml b/configs/lito/audio_platform_info_lagoon_qrd.xml
index 4201b74..bddb2c7 100644
--- a/configs/lito/audio_platform_info_lagoon_qrd.xml
+++ b/configs/lito/audio_platform_info_lagoon_qrd.xml
@@ -55,6 +55,7 @@
         <usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
diff --git a/configs/lito/audio_platform_info_qrd.xml b/configs/lito/audio_platform_info_qrd.xml
index 5d8efc5..391c2d1 100644
--- a/configs/lito/audio_platform_info_qrd.xml
+++ b/configs/lito/audio_platform_info_qrd.xml
@@ -55,6 +55,7 @@
         <usecase name="USECASE_AUDIO_PLAYBACK_AFE_PROXY" type="out" id="5"/>
         <usecase name="USECASE_AUDIO_RECORD_AFE_PROXY" type="in" id="6"/>
         <usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="13" />
+        <usecase name="USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY" type="in" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="13" />
         <usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="23" />
         <usecase name="USECASE_AUDIO_PLAYBACK_VOIP" type="out" id="12" />
diff --git a/configs/lito/mixer_paths.xml b/configs/lito/mixer_paths.xml
index 51cd6dd..ff26d4a 100644
--- a/configs/lito/mixer_paths.xml
+++ b/configs/lito/mixer_paths.xml
@@ -513,6 +513,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2567,6 +2582,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lito/mixer_paths_cdp.xml b/configs/lito/mixer_paths_cdp.xml
index 8665f0f..579fdcb 100644
--- a/configs/lito/mixer_paths_cdp.xml
+++ b/configs/lito/mixer_paths_cdp.xml
@@ -519,6 +519,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2568,6 +2583,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lito/mixer_paths_lagoonmtp.xml b/configs/lito/mixer_paths_lagoonmtp.xml
index 5cbd2ae..ba8246c 100644
--- a/configs/lito/mixer_paths_lagoonmtp.xml
+++ b/configs/lito/mixer_paths_lagoonmtp.xml
@@ -493,6 +493,21 @@
         <ctl name="EC Reference Channels" value="Two"/>
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="Two"/>
@@ -2502,6 +2517,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lito/mixer_paths_lagoonqrd.xml b/configs/lito/mixer_paths_lagoonqrd.xml
index fafb767..1adfaaa 100644
--- a/configs/lito/mixer_paths_lagoonqrd.xml
+++ b/configs/lito/mixer_paths_lagoonqrd.xml
@@ -492,6 +492,21 @@
         <ctl name="EC Reference Channels" value="Two"/>
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="One"/>
@@ -2508,6 +2523,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/lito/mixer_paths_qrd.xml b/configs/lito/mixer_paths_qrd.xml
index 1bcc0a3..fe372b3 100644
--- a/configs/lito/mixer_paths_qrd.xml
+++ b/configs/lito/mixer_paths_qrd.xml
@@ -513,6 +513,21 @@
         <path name="echo-reference bt-sco" />
     </path>
 
+    <path name="echo-reference-voip-low-latency">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency handset">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="One"/>
+    </path>
+
+    <path name="echo-reference-voip-low-latency headphones">
+        <ctl name="AUDIO_REF_EC_UL8 MUX" value="WSA_CDC_DMA_RX_0" />
+        <ctl name="EC Reference Channels" value="Two"/>
+    </path>
+
     <path name="echo-reference-voip">
         <ctl name="AUDIO_REF_EC_UL10 MUX" value="WSA_CDC_DMA_RX_0" />
         <ctl name="EC Reference Channels" value="One"/>
@@ -2593,6 +2608,10 @@
     </path>
 
     <!-- VoIP Tx settings -->
+    <path name="audio-record-voip-low-latency">
+        <ctl name="MultiMedia8 Mixer TX_CDC_DMA_TX_3" value="1" />
+    </path>
+
     <path name="audio-record-voip">
         <ctl name="MultiMedia10 Mixer TX_CDC_DMA_TX_3" value="1" />
     </path>
diff --git a/configs/msm8937/audio_policy_configuration.xml b/configs/msm8937/audio_policy_configuration.xml
index 0b2a31a..047a2a1 100644
--- a/configs/msm8937/audio_policy_configuration.xml
+++ b/configs/msm8937/audio_policy_configuration.xml
@@ -134,7 +134,7 @@
                 <mixPort name="voip_rx" role="source"
                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                             samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
+                             samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
 
                 <mixPort name="primary input" role="sink" maxOpenCount="2" maxActiveCount="2">
@@ -268,7 +268,7 @@
                 <route type="mix" sink="Telephony Tx"
                        sources="voice_tx"/>
                 <route type="mix" sink="primary input"
-                       sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
+                       sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="voice_rx"
diff --git a/configs/msm8953/audio_policy_configuration.xml b/configs/msm8953/audio_policy_configuration.xml
index 0b8b7f3..c552408 100644
--- a/configs/msm8953/audio_policy_configuration.xml
+++ b/configs/msm8953/audio_policy_configuration.xml
@@ -279,7 +279,7 @@
                 <route type="mix" sink="Telephony Tx"
                        sources="voice_tx"/>
                 <route type="mix" sink="primary input"
-                       sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/>
+                       sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic,FM Tuner"/>
                 <route type="mix" sink="surround_sound"
                        sources="Built-In Mic,Built-In Back Mic"/>
                 <route type="mix" sink="record_24"
diff --git a/configs/msmnile/audio_io_policy.conf b/configs/msmnile/audio_io_policy.conf
index 79540df..ee4f722 100644
--- a/configs/msmnile/audio_io_policy.conf
+++ b/configs/msmnile/audio_io_policy.conf
@@ -102,6 +102,27 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
   record_unprocessed {
     profile record_unprocessed
     formats AUDIO_FORMAT_PCM_24_BIT_PACKED
diff --git a/configs/msmnile_au/audio_io_policy.conf b/configs/msmnile_au/audio_io_policy.conf
index ee4e6aa..848f3f9 100644
--- a/configs/msmnile_au/audio_io_policy.conf
+++ b/configs/msmnile_au/audio_io_policy.conf
@@ -137,6 +137,27 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
   record_unprocessed {
     profile record_unprocessed
     formats AUDIO_FORMAT_PCM_24_BIT_PACKED
@@ -144,4 +165,4 @@
     bit_width 24
     app_type 69942
   }
-}
\ No newline at end of file
+}
diff --git a/configs/msmsteppe/audio_io_policy.conf b/configs/msmsteppe/audio_io_policy.conf
index 7e00464..0f1f93e 100644
--- a/configs/msmsteppe/audio_io_policy.conf
+++ b/configs/msmsteppe/audio_io_policy.conf
@@ -102,4 +102,25 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
 }
diff --git a/configs/msmsteppe_au/audio_io_policy.conf b/configs/msmsteppe_au/audio_io_policy.conf
index 502b632..0ecd592 100644
--- a/configs/msmsteppe_au/audio_io_policy.conf
+++ b/configs/msmsteppe_au/audio_io_policy.conf
@@ -137,4 +137,25 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
 }
diff --git a/configs/sdm660/audio_policy_configuration.xml b/configs/sdm660/audio_policy_configuration.xml
index c5872bb..aff987d 100644
--- a/configs/sdm660/audio_policy_configuration.xml
+++ b/configs/sdm660/audio_policy_configuration.xml
@@ -155,7 +155,7 @@
                 <mixPort name="voip_rx" role="source"
                          flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
-                             samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/>
+                             samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
 
                 <mixPort name="primary input" role="sink">
diff --git a/configs/trinket/audio_io_policy.conf b/configs/trinket/audio_io_policy.conf
index 7e00464..0f1f93e 100644
--- a/configs/trinket/audio_io_policy.conf
+++ b/configs/trinket/audio_io_policy.conf
@@ -102,4 +102,25 @@
     bit_width 32
     app_type 69949
   }
+  record_compress_16 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_16_BIT
+    sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000
+    bit_width 16
+    app_type 69938
+  }
+  record_compress_24 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 24
+    app_type 69948
+  }
+  record_compress_32 {
+    flags AUDIO_INPUT_FLAG_COMPRESS
+    formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT
+    sampling_rates 44100|48000|88200|96000|176400|192000
+    bit_width 32
+    app_type 69949
+  }
 }
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c
index 4bd9125..d0170db 100644
--- a/hal/audio_extn/a2dp.c
+++ b/hal/audio_extn/a2dp.c
@@ -255,7 +255,7 @@
 
 // --- external function dependency ---
 fp_platform_get_pcm_device_id_t fp_platform_get_pcm_device_id;
-fp_check_a2dp_restore_t fp_check_a2dp_restore;
+fp_check_a2dp_restore_t fp_check_a2dp_restore_l;
 
 /* PCM config for ABR Feedback hostless front end */
 static struct pcm_config pcm_config_abr = {
@@ -1303,6 +1303,14 @@
     return is_configured;
 }
 
+bool a2dp_set_source_backend_cfg()
+{
+    if (a2dp.a2dp_source_started && !a2dp.a2dp_source_suspended)
+        return a2dp_set_backend_cfg(SOURCE);
+
+    return false;
+}
+
 bool configure_aac_dec_format(audio_aac_dec_config_t *aac_bt_cfg)
 {
     struct mixer_ctl *ctl_dec_data = NULL, *ctrl_bit_format = NULL;
@@ -2809,141 +2817,138 @@
 
 int a2dp_set_parameters(struct str_parms *parms, bool *reconfig)
 {
-     int ret = 0, val, status = 0;
-     char value[32]={0};
-     struct audio_usecase *uc_info;
-     struct listnode *node;
+    int ret = 0, val, status = 0;
+    char value[32] = {0};
+    struct audio_usecase *uc_info;
+    struct listnode *node;
 
-     if (a2dp.is_a2dp_offload_supported == false) {
+    if (a2dp.is_a2dp_offload_supported == false) {
         ALOGV("no supported encoders identified,ignoring a2dp setparam");
         status = -EINVAL;
         goto param_handled;
-     }
+    }
 
-     ret = str_parms_get_str(parms, AUDIO_PARAMETER_DEVICE_CONNECT, value,
+    ret = str_parms_get_str(parms, AUDIO_PARAMETER_DEVICE_CONNECT, value,
                             sizeof(value));
-     if (ret >= 0) {
-         val = atoi(value);
-         if (audio_is_a2dp_out_device(val)) {
-             ALOGV("Received device connect request for A2DP source");
-             open_a2dp_source();
-         }
-         goto param_handled;
-     }
+    if (ret >= 0) {
+        val = atoi(value);
+        if (audio_is_a2dp_out_device(val)) {
+            ALOGV("Received device connect request for A2DP source");
+            open_a2dp_source();
+        }
+        goto param_handled;
+    }
 
-     ret = str_parms_get_str(parms, AUDIO_PARAMETER_DEVICE_DISCONNECT, value,
-                         sizeof(value));
+    ret = str_parms_get_str(parms, AUDIO_PARAMETER_DEVICE_DISCONNECT, value,
+                            sizeof(value));
 
-     if (ret >= 0) {
-         val = atoi(value);
-         if (audio_is_a2dp_out_device(val)) {
-             ALOGV("Received source device dis- connect request");
-             close_a2dp_output();
-             reset_a2dp_enc_config_params();
-             reset_a2dp_source_dec_config_params();
-             a2dp_reset_backend_cfg(SOURCE);
-         } else if (audio_is_a2dp_in_device(val)) {
-             ALOGV("Received sink device dis- connect request");
-             close_a2dp_input();
-             reset_a2dp_sink_dec_config_params();
-             a2dp_reset_backend_cfg(SINK);
-         }
-         goto param_handled;
-     }
+    if (ret >= 0) {
+        val = atoi(value);
+        if (audio_is_a2dp_out_device(val)) {
+            ALOGV("Received source device dis- connect request");
+            close_a2dp_output();
+            reset_a2dp_enc_config_params();
+            reset_a2dp_source_dec_config_params();
+            a2dp_reset_backend_cfg(SOURCE);
+        } else if (audio_is_a2dp_in_device(val)) {
+            ALOGV("Received sink device dis- connect request");
+            close_a2dp_input();
+            reset_a2dp_sink_dec_config_params();
+            a2dp_reset_backend_cfg(SINK);
+        }
+        goto param_handled;
+    }
 #ifndef LINUX_ENABLED
-     ret = str_parms_get_str(parms, "TwsChannelConfig", value, sizeof(value));
-     if (ret>=0) {
-         ALOGD("Setting tws channel mode to %s",value);
-         if (!(strncmp(value,"mono",strlen(value))))
+    ret = str_parms_get_str(parms, "TwsChannelConfig", value, sizeof(value));
+    if (ret >= 0) {
+        ALOGD("Setting tws channel mode to %s",value);
+        if (!(strncmp(value, "mono", strlen(value))))
             a2dp.is_tws_mono_mode_on = true;
-         else if (!(strncmp(value,"dual-mono",strlen(value))))
+        else if (!(strncmp(value, "dual-mono", strlen(value))))
             a2dp.is_tws_mono_mode_on = false;
-         audio_a2dp_update_tws_channel_mode();
-     goto param_handled;
-     }
+        audio_a2dp_update_tws_channel_mode();
+        goto param_handled;
+    }
 #endif
-     ret = str_parms_get_str(parms, "A2dpSuspended", value, sizeof(value));
-     if (ret >= 0) {
-         if (a2dp.bt_lib_source_handle) {
-             if ((!strncmp(value,"true",sizeof(value)))) {
-                if (a2dp.a2dp_source_suspended) {
-                    ALOGD("%s: A2DP is already suspended", __func__);
-                    goto param_handled;
+    ret = str_parms_get_str(parms, "A2dpSuspended", value, sizeof(value));
+    if (ret >= 0) {
+        if (a2dp.bt_lib_source_handle == NULL)
+            goto param_handled;
+
+        if ((!strncmp(value, "true", sizeof(value)))) {
+            if (a2dp.a2dp_source_suspended) {
+                ALOGD("%s: A2DP is already suspended", __func__);
+                goto param_handled;
+            }
+            ALOGD("Setting a2dp to suspend state");
+            a2dp.a2dp_source_suspended = true;
+            if (a2dp.bt_state_source == A2DP_STATE_DISCONNECTED)
+                goto param_handled;
+            list_for_each(node, &a2dp.adev->usecase_list) {
+                uc_info = node_to_item(node, struct audio_usecase, list);
+                if (uc_info->type == PCM_PLAYBACK &&
+                    (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP ||
+                     uc_info->out_snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP ||
+                     uc_info->out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP)) {
+                    fp_check_a2dp_restore_l(a2dp.adev, uc_info->stream.out, false);
                 }
-                ALOGD("Setting a2dp to suspend state");
-                a2dp.a2dp_source_suspended = true;
-                if (a2dp.bt_state_source == A2DP_STATE_DISCONNECTED)
-                    goto param_handled;
-                list_for_each(node, &a2dp.adev->usecase_list) {
-                    uc_info = node_to_item(node, struct audio_usecase, list);
-                    if (uc_info->type == PCM_PLAYBACK &&
-                        (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP ||
-                         uc_info->out_snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP ||
-                         uc_info->out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP)) {
-                        pthread_mutex_unlock(&a2dp.adev->lock);
-                        fp_check_a2dp_restore(a2dp.adev, uc_info->stream.out, false);
-                        pthread_mutex_lock(&a2dp.adev->lock);
+            }
+            if (!a2dp.swb_configured)
+                reset_codec_config();
+            if (a2dp.audio_source_suspend)
+                a2dp.audio_source_suspend();
+        } else if (a2dp.a2dp_source_suspended == true) {
+            ALOGD("Resetting a2dp suspend state");
+            struct audio_usecase *uc_info;
+            struct listnode *node;
+            if (a2dp.clear_source_a2dpsuspend_flag)
+                a2dp.clear_source_a2dpsuspend_flag();
+            a2dp.a2dp_source_suspended = false;
+            /*
+             * It is possible that before suspend,a2dp sessions can be active
+             * for example during music + voice activation concurrency
+             * a2dp suspend will be called & BT will change to sco mode
+             * though music is paused as a part of voice activation
+             * compress session close happens only after pause timeout(10secs)
+             * so if resume request comes before pause timeout as a2dp session
+             * is already active IPC start will not be called from APM/audio_hw
+             * Fix is to call a2dp start for IPC library post suspend
+             * based on number of active session count
+             */
+            if (a2dp.a2dp_source_total_active_session_requests > 0) {
+                ALOGD(" Calling IPC lib start post suspend state");
+                if (a2dp.audio_source_start) {
+                    ret =  a2dp.audio_source_start();
+                    if (ret != 0) {
+                        ALOGE("BT controller start failed");
+                        a2dp.a2dp_source_started = false;
                     }
                 }
-                if (!a2dp.swb_configured)
-                    reset_codec_config();
-                if (a2dp.audio_source_suspend)
-                   a2dp.audio_source_suspend();
-            } else if (a2dp.a2dp_source_suspended == true) {
-                ALOGD("Resetting a2dp suspend state");
-                struct audio_usecase *uc_info;
-                struct listnode *node;
-                if (a2dp.clear_source_a2dpsuspend_flag)
-                    a2dp.clear_source_a2dpsuspend_flag();
-                a2dp.a2dp_source_suspended = false;
-                /*
-                 * It is possible that before suspend,a2dp sessions can be active
-                 * for example during music + voice activation concurrency
-                 * a2dp suspend will be called & BT will change to sco mode
-                 * though music is paused as a part of voice activation
-                 * compress session close happens only after pause timeout(10secs)
-                 * so if resume request comes before pause timeout as a2dp session
-                 * is already active IPC start will not be called from APM/audio_hw
-                 * Fix is to call a2dp start for IPC library post suspend
-                 * based on number of active session count
-                 */
-                if (a2dp.a2dp_source_total_active_session_requests > 0) {
-                    ALOGD(" Calling IPC lib start post suspend state");
-                    if (a2dp.audio_source_start) {
-                        ret =  a2dp.audio_source_start();
-                        if (ret != 0) {
-                            ALOGE("BT controller start failed");
-                            a2dp.a2dp_source_started = false;
-                        }
-                    }
-                }
-                list_for_each(node, &a2dp.adev->usecase_list) {
-                    uc_info = node_to_item(node, struct audio_usecase, list);
-                    if (uc_info->stream.out && uc_info->type == PCM_PLAYBACK &&
-                        is_a2dp_out_device_type(&uc_info->stream.out->device_list)) {
-                        pthread_mutex_unlock(&a2dp.adev->lock);
-                        fp_check_a2dp_restore(a2dp.adev, uc_info->stream.out, true);
-                        pthread_mutex_lock(&a2dp.adev->lock);
-                    }
+            }
+            list_for_each(node, &a2dp.adev->usecase_list) {
+                uc_info = node_to_item(node, struct audio_usecase, list);
+                if (uc_info->stream.out && uc_info->type == PCM_PLAYBACK &&
+                    is_a2dp_out_device_type(&uc_info->stream.out->device_list)) {
+                    fp_check_a2dp_restore_l(a2dp.adev, uc_info->stream.out, true);
                 }
             }
         }
         goto param_handled;
-     }
+    }
 
-     ret = str_parms_get_str(parms, AUDIO_PARAMETER_RECONFIG_A2DP, value,
-                         sizeof(value));
-     if (ret >= 0) {
-         if (a2dp.is_a2dp_offload_supported &&
-                a2dp.bt_state_source != A2DP_STATE_DISCONNECTED) {
-             *reconfig = true;
-         }
-         goto param_handled;
-     }
+    ret = str_parms_get_str(parms, AUDIO_PARAMETER_RECONFIG_A2DP, value,
+                            sizeof(value));
+    if (ret >= 0) {
+        if (a2dp.is_a2dp_offload_supported &&
+            a2dp.bt_state_source != A2DP_STATE_DISCONNECTED) {
+            *reconfig = true;
+        }
+        goto param_handled;
+    }
 
 param_handled:
-     ALOGV("end of a2dp setparam");
-     return status;
+    ALOGV("end of a2dp setparam");
+    return status;
 }
 
 void a2dp_set_handoff_mode(bool is_on)
@@ -3014,7 +3019,7 @@
   // init function pointers
   fp_platform_get_pcm_device_id =
               init_config.fp_platform_get_pcm_device_id;
-  fp_check_a2dp_restore = init_config.fp_check_a2dp_restore;
+  fp_check_a2dp_restore_l = init_config.fp_check_a2dp_restore_l;
 
   reset_a2dp_enc_config_params();
   reset_a2dp_source_dec_config_params();
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index d53db94..04e7a55 100644
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -4641,6 +4641,9 @@
 typedef int (*a2dp_stop_capture_t)();
 static a2dp_stop_capture_t a2dp_stop_capture;
 
+typedef bool (*a2dp_set_source_backend_cfg_t)();
+static a2dp_set_source_backend_cfg_t a2dp_set_source_backend_cfg;
+
 typedef int (*sco_start_configuration_t)();
 static sco_start_configuration_t sco_start_configuration;
 
@@ -4695,7 +4698,10 @@
             !(a2dp_start_capture =
                  (a2dp_start_capture_t)dlsym(a2dp_lib_handle, "a2dp_start_capture")) ||
             !(a2dp_stop_capture =
-                 (a2dp_stop_capture_t)dlsym(a2dp_lib_handle, "a2dp_stop_capture"))) {
+                 (a2dp_stop_capture_t)dlsym(a2dp_lib_handle, "a2dp_stop_capture")) ||
+            !(a2dp_set_source_backend_cfg =
+                 (a2dp_set_source_backend_cfg_t)dlsym(
+                                     a2dp_lib_handle, "a2dp_set_source_backend_cfg"))) {
             ALOGE("%s: dlsym failed", __func__);
             goto feature_disabled;
         }
@@ -4733,6 +4739,7 @@
     a2dp_source_is_suspended = NULL;
     a2dp_start_capture = NULL;
     a2dp_stop_capture = NULL;
+    a2dp_set_source_backend_cfg = NULL;
 
     ALOGW(":: %s: ---- Feature A2DP_OFFLOAD is disabled ----", __func__);
     return -ENOSYS;
@@ -4743,7 +4750,7 @@
     if (a2dp_init) {
         a2dp_offload_init_config_t a2dp_init_config;
         a2dp_init_config.fp_platform_get_pcm_device_id = platform_get_pcm_device_id;
-        a2dp_init_config.fp_check_a2dp_restore = check_a2dp_restore;
+        a2dp_init_config.fp_check_a2dp_restore_l = check_a2dp_restore_l;
 
         a2dp_init(adev, a2dp_init_config);
     }
@@ -4831,6 +4838,12 @@
     return (a2dp_stop_capture ? a2dp_stop_capture() : 0);
 }
 
+bool audio_extn_a2dp_set_source_backend_cfg()
+{
+    return (a2dp_set_source_backend_cfg ?
+                a2dp_set_source_backend_cfg() : false);
+}
+
 int audio_extn_sco_start_configuration()
 {
     return (sco_start_configuration? sco_start_configuration() : 0);
@@ -6332,8 +6345,6 @@
 void audio_extn_set_parameters(struct audio_device *adev,
                                struct str_parms *parms)
 {
-   bool a2dp_reconfig = false;
-
    audio_extn_set_aanc_noise_level(adev, parms);
    audio_extn_set_anc_parameters(adev, parms);
    audio_extn_set_fluence_parameters(adev, parms);
@@ -6342,9 +6353,7 @@
    audio_extn_sound_trigger_set_parameters(adev, parms);
    audio_extn_listen_set_parameters(adev, parms);
    audio_extn_ssr_set_parameters(adev, parms);
-   audio_extn_hfp_set_parameters(adev, parms);
    audio_extn_dts_eagle_set_parameters(adev, parms);
-   audio_extn_a2dp_set_parameters(parms, &a2dp_reconfig);
    audio_extn_ddp_set_parameters(adev, parms);
    audio_extn_ds2_set_parameters(adev, parms);
    audio_extn_customstereo_set_parameters(adev, parms);
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 0e4b9b0..da986ad 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -327,6 +327,7 @@
 bool audio_extn_a2dp_source_is_suspended();
 int audio_extn_a2dp_start_capture();
 int audio_extn_a2dp_stop_capture();
+bool audio_extn_a2dp_set_source_backend_cfg();
 int audio_extn_sco_start_configuration();
 void audio_extn_sco_reset_configuration();
 
@@ -336,7 +337,7 @@
                                        struct stream_out *, bool);
 struct a2dp_offload_init_config {
     fp_platform_get_pcm_device_id_t fp_platform_get_pcm_device_id;
-    fp_check_a2dp_restore_t fp_check_a2dp_restore;
+    fp_check_a2dp_restore_t fp_check_a2dp_restore_l;
 };
 typedef struct a2dp_offload_init_config a2dp_offload_init_config_t;
 // END: A2DP_OFFLOAD FEATURE ====================================================
diff --git a/hal/audio_extn/usb.c b/hal/audio_extn/usb.c
index 95f8ea9..1eecd0c 100644
--- a/hal/audio_extn/usb.c
+++ b/hal/audio_extn/usb.c
@@ -377,62 +377,6 @@
     return 0;
 }
 
-int usb_get_service_interval(bool playback,
-                                        unsigned long *service_interval)
-{
-    const char *ctl_name = "USB_AUDIO_RX service_interval";
-    struct mixer_ctl *ctl = mixer_get_ctl_by_name(usbmod->adev->mixer,
-                                                  ctl_name);
-
-    if (!playback) {
-        ALOGE("%s not valid for capture", __func__);
-        return -1;
-    }
-
-    if (!ctl) {
-        ALOGV("%s: could not get mixer %s", __func__, ctl_name);
-        return -1;
-    }
-
-    *service_interval = mixer_ctl_get_value(ctl, 0);
-    return 0;
-}
-
-int usb_set_service_interval(bool playback,
-                                        unsigned long service_interval,
-                                        bool *reconfig)
-{
-    *reconfig = false;
-    unsigned long current_service_interval = 0;
-    const char *ctl_name = "USB_AUDIO_RX service_interval";
-    struct mixer_ctl *ctl = mixer_get_ctl_by_name(usbmod->adev->mixer,
-                                                  ctl_name);
-
-    if (!playback) {
-        ALOGE("%s not valid for capture", __func__);
-        return -1;
-    }
-
-    if (!ctl) {
-        ALOGV("%s: could not get mixer %s", __func__, ctl_name);
-        return -1;
-    }
-
-    if (usb_get_service_interval(playback,
-                                            &current_service_interval) != 0) {
-        ALOGE("%s Unable to get current service interval", __func__);
-        return -1;
-    }
-
-    if (current_service_interval != service_interval) {
-        mixer_ctl_set_value(ctl, 0, service_interval);
-        *reconfig = usbmod->usb_reconfig = true;
-    }
-    else
-        *reconfig = usbmod->usb_reconfig = false;
-    return 0;
-}
-
 static int get_usb_service_interval(const char *interval_str_start,
                                     struct usb_device_config *usb_device_info)
 {
@@ -640,7 +584,6 @@
         // Data packet interval is an optional field.
         // Assume 0ms interval if this cannot be read
         // LPASS USB and HLOS USB will figure out the default to use
-        bool reconfig = false;
         usb_device_info->service_interval_us = DEFAULT_SERVICE_INTERVAL_US;
         interval_str_start = strstr(str_start, DATA_PACKET_INTERVAL_STR);
         if (interval_str_start != NULL) {
@@ -651,9 +594,6 @@
                       __func__);
             }
         }
-        usb_set_service_interval(true /*playback*/,
-                                       usb_device_info->service_interval_us,
-                                       &reconfig);
         /* Add to list if every field is valid */
         list_add_tail(&usb_card_info->usb_device_conf_list,
                       &usb_device_info->list);
@@ -1452,6 +1392,62 @@
 #undef SET_OR_RETURN_ON_ERROR
 }
 
+int usb_get_service_interval(bool playback,
+                                        unsigned long *service_interval)
+{
+    const char *ctl_name = "USB_AUDIO_RX service_interval";
+    struct mixer_ctl *ctl = mixer_get_ctl_by_name(usbmod->adev->mixer,
+                                                  ctl_name);
+
+    if (!playback) {
+        ALOGE("%s not valid for capture", __func__);
+        return -1;
+    }
+
+    if (!ctl) {
+        ALOGV("%s: could not get mixer %s", __func__, ctl_name);
+        return -1;
+    }
+
+    *service_interval = mixer_ctl_get_value(ctl, 0);
+    return 0;
+}
+
+int usb_set_service_interval(bool playback,
+                                        unsigned long service_interval,
+                                        bool *reconfig)
+{
+    *reconfig = false;
+    unsigned long current_service_interval = 0;
+    const char *ctl_name = "USB_AUDIO_RX service_interval";
+    struct mixer_ctl *ctl = mixer_get_ctl_by_name(usbmod->adev->mixer,
+                                                  ctl_name);
+
+    if (!playback) {
+        ALOGE("%s not valid for capture", __func__);
+        return -1;
+    }
+
+    if (!ctl) {
+        ALOGV("%s: could not get mixer %s", __func__, ctl_name);
+        return -1;
+    }
+
+    if (usb_get_service_interval(playback,
+                                            &current_service_interval) != 0) {
+        ALOGE("%s Unable to get current service interval", __func__);
+        return -1;
+    }
+
+    if (current_service_interval != service_interval) {
+        mixer_ctl_set_value(ctl, 0, service_interval);
+        *reconfig = usbmod->usb_reconfig = true;
+    }
+    else
+        *reconfig = usbmod->usb_reconfig = false;
+    return 0;
+}
+
 int usb_check_and_set_svc_int(struct audio_usecase *uc_info,
                                          bool starting_output_stream)
 {
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 492519d..fa826f5 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -160,6 +160,10 @@
     STRING_TO_ENUM(AUDIO_INPUT_FLAG_TIMESTAMP),
     STRING_TO_ENUM(AUDIO_INPUT_FLAG_COMPRESS),
     STRING_TO_ENUM(AUDIO_INPUT_FLAG_PASSTHROUGH),
+    STRING_TO_ENUM(AUDIO_INPUT_FLAG_MMAP_NOIRQ),
+    STRING_TO_ENUM(AUDIO_INPUT_FLAG_VOIP_TX),
+    STRING_TO_ENUM(AUDIO_INPUT_FLAG_HW_AV_SYNC),
+    STRING_TO_ENUM(AUDIO_INPUT_FLAG_DIRECT),
 };
 
 const struct string_to_enum s_format_name_to_enum_table[] = {
@@ -243,6 +247,7 @@
             return table[i].value;
         }
     }
+    ALOGE("%s cound not find %s", __func__, name);
     return 0;
 }
 
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 12e89dc..4516448 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -515,7 +515,6 @@
 //cache last MBDRC cal step level
 static int last_known_cal_step = -1 ;
 
-static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool restore);
 static int out_set_compr_volume(struct audio_stream_out *stream, float left, float right);
 static int out_set_mmap_volume(struct audio_stream_out *stream, float left, float right);
 static int out_set_voip_volume(struct audio_stream_out *stream, float left, float right);
@@ -1385,6 +1384,11 @@
                                        new_snd_devices) != 0)) {
         ALOGV("%s: snd_device(%d: %s) is already active",
               __func__, snd_device, device_name);
+        /* Set backend config for A2DP to ensure slimbus configuration
+           is correct if A2DP is already active and backend is closed
+           and re-opened */
+        if (snd_device == SND_DEVICE_OUT_BT_A2DP)
+            audio_extn_a2dp_set_source_backend_cfg();
         return 0;
     }
 
@@ -3173,7 +3177,8 @@
     if (get_usecase_from_list(adev, in->usecase) != NULL) {
         ALOGE("%s: use case assigned already in use, stream(%p)usecase(%d: %s)",
             __func__, &in->stream, in->usecase, use_case_table[in->usecase]);
-        return -EINVAL;
+        ret = -EINVAL;
+        goto error_config;
     }
 
     in->pcm_device_id = platform_get_pcm_device_id(in->usecase, PCM_CAPTURE);
@@ -3322,6 +3327,8 @@
     stop_input_stream(in);
 
 error_config:
+    if (audio_extn_cin_attached_usecase(in))
+        audio_extn_cin_close_input_stream(in);
     /*
      * sleep 50ms to allow sufficient time for kernel
      * drivers to recover incases like SSR.
@@ -3364,7 +3371,7 @@
     return 0;
 }
 
-/* must be called iwth out->lock locked */
+/* must be called with out->lock and latch lock */
 static void stop_compressed_output_l(struct stream_out *out)
 {
     out->offload_state = OFFLOAD_STATE_IDLE;
@@ -3625,9 +3632,11 @@
 static int destroy_offload_callback_thread(struct stream_out *out)
 {
     lock_output_stream(out);
+    pthread_mutex_lock(&out->latch_lock);
     stop_compressed_output_l(out);
     send_offload_cmd_l(out, OFFLOAD_CMD_EXIT);
 
+    pthread_mutex_unlock(&out->latch_lock);
     pthread_mutex_unlock(&out->lock);
     pthread_join(out->offload_thread, (void **) NULL);
     pthread_cond_destroy(&out->offload_cond);
@@ -3700,6 +3709,9 @@
 
     list_remove(&uc_info->list);
     out->started = 0;
+    pthread_mutex_lock(&out->latch_lock);
+    out->muted = false;
+    pthread_mutex_unlock(&out->latch_lock);
     if (is_offload_usecase(out->usecase) &&
         (audio_extn_passthru_is_passthrough_stream(out))) {
         ALOGV("Disable passthrough , reset mixer to pcm");
@@ -4519,8 +4531,11 @@
         if (adev->adm_deregister_stream)
             adev->adm_deregister_stream(adev->adm_data, out->handle);
 
-        if (is_offload_usecase(out->usecase))
+        if (is_offload_usecase(out->usecase)) {
+            pthread_mutex_lock(&out->latch_lock);
             stop_compressed_output_l(out);
+            pthread_mutex_unlock(&out->latch_lock);
+        }
 
         pthread_mutex_lock(&adev->lock);
         out->standby = true;
@@ -4594,7 +4609,9 @@
     // is needed e.g. when SSR happens within compress_open
     // since the stream is active, offload_callback_thread is also active.
     if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
+        pthread_mutex_lock(&out->latch_lock);
         stop_compressed_output_l(out);
+        pthread_mutex_unlock(&out->latch_lock);
     }
     pthread_mutex_unlock(&out->lock);
 
@@ -4616,8 +4633,8 @@
 }
 
 /*
- *standby implementation without locks, assumes that the callee already
- *has taken adev and out lock.
+ * standby implementation without locks, assumes that the callee already
+ * has taken adev and out lock.
  */
 int out_standby_l(struct audio_stream *stream)
 {
@@ -4632,8 +4649,11 @@
         if (adev->adm_deregister_stream)
             adev->adm_deregister_stream(adev->adm_data, out->handle);
 
-        if (is_offload_usecase(out->usecase))
+        if (is_offload_usecase(out->usecase)) {
+            pthread_mutex_lock(&out->latch_lock);
             stop_compressed_output_l(out);
+            pthread_mutex_unlock(&out->latch_lock);
+        }
 
         out->standby = true;
         if (out->usecase == USECASE_COMPRESS_VOIP_CALL) {
@@ -4936,14 +4956,6 @@
             if (!voice_is_call_state_active(adev)) {
                 if (adev->mode == AUDIO_MODE_IN_CALL) {
                     adev->current_call_output = out;
-                    if (is_usb_out_device_type(&out->device_list)) {
-                        service_interval =
-                            audio_extn_usb_find_service_interval(true, true /*playback*/);
-                        audio_extn_usb_set_service_interval(true /*playback*/,
-                                                            service_interval,
-                                                            &reconfig);
-                        ALOGD("%s, svc_int(%ld),reconfig(%d)",__func__,service_interval, reconfig);
-                    }
                     ret = voice_start_call(adev);
                 }
             } else {
@@ -4952,6 +4964,14 @@
             }
         }
 
+        if (is_usb_out_device_type(&out->device_list)) {
+             service_interval = audio_extn_usb_find_service_interval(false, true /*playback*/);
+             audio_extn_usb_set_service_interval(true /*playback*/,
+                                                 service_interval,
+                                                 &reconfig);
+             ALOGD("%s, svc_int(%ld),reconfig(%d)",__func__,service_interval, reconfig);
+        }
+
         if (!out->standby) {
             if (!same_dev) {
                 ALOGV("update routing change");
@@ -4980,12 +5000,13 @@
                 audio_extn_perf_lock_release(&adev->perf_lock_handle);
             }
             if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
-                 out->a2dp_compress_mute &&
                  (!is_a2dp_out_device_type(&out->device_list) || audio_extn_a2dp_source_is_ready())) {
-                pthread_mutex_lock(&out->compr_mute_lock);
-                out->a2dp_compress_mute = false;
-                out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
-                pthread_mutex_unlock(&out->compr_mute_lock);
+                pthread_mutex_lock(&out->latch_lock);
+                if (out->a2dp_compress_mute) {
+                    out->a2dp_compress_mute = false;
+                    out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
+                }
+                pthread_mutex_unlock(&out->latch_lock);
             } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
                 out_set_voip_volume(&out->stream, out->volume_l, out->volume_r);
             }
@@ -5540,7 +5561,9 @@
     ALOGD("%s: called with left_vol=%f, right_vol=%f", __func__, left, right);
     if (out->usecase == USECASE_AUDIO_PLAYBACK_MULTI_CH) {
         /* only take left channel into account: the API is for stereo anyway */
+        pthread_mutex_lock(&out->latch_lock);
         out->muted = (left == 0.0f);
+        pthread_mutex_unlock(&out->latch_lock);
         return 0;
     } else if (is_offload_usecase(out->usecase)) {
         if (audio_extn_passthru_is_passthrough_stream(out)) {
@@ -5577,18 +5600,20 @@
                     out->volume_r = out_ctxt->output->volume_r;
                 }
             }
+            pthread_mutex_lock(&out->latch_lock);
             if (!out->a2dp_compress_mute) {
                 ret = out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
             }
+            pthread_mutex_unlock(&out->latch_lock);
             return ret;
         } else {
-            pthread_mutex_lock(&out->compr_mute_lock);
+            pthread_mutex_lock(&out->latch_lock);
             ALOGV("%s: compress mute %d", __func__, out->a2dp_compress_mute);
             if (!out->a2dp_compress_mute)
                 ret = out_set_compr_volume(stream, left, right);
             out->volume_l = left;
             out->volume_r = right;
-            pthread_mutex_unlock(&out->compr_mute_lock);
+            pthread_mutex_unlock(&out->latch_lock);
             return ret;
         }
     } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
@@ -5999,7 +6024,9 @@
             }
             audio_extn_dts_eagle_fade(adev, true, out);
             out->playback_started = 1;
+            pthread_mutex_lock(&out->latch_lock);
             out->offload_state = OFFLOAD_STATE_PLAYING;
+            pthread_mutex_unlock(&out->latch_lock);
 
             audio_extn_dts_notify_playback_state(out->usecase, 0, out->sample_rate,
                                                      popcount(out->channel_mask),
@@ -6011,8 +6038,10 @@
     } else {
         if (out->pcm) {
             size_t bytes_to_write = bytes;
+            pthread_mutex_lock(&out->latch_lock);
             if (out->muted)
                 memset((void *)buffer, 0, bytes);
+            pthread_mutex_unlock(&out->latch_lock);
             ALOGV("%s: frames=%zu, frame_size=%zu, bytes_to_write=%zu",
                      __func__, frames, frame_size, bytes_to_write);
 
@@ -6386,6 +6415,7 @@
         ALOGD("copl(%p):pause compress driver", out);
         status = -ENODATA;
         lock_output_stream(out);
+        pthread_mutex_lock(&out->latch_lock);
         if (out->compr != NULL && out->offload_state == OFFLOAD_STATE_PLAYING) {
             if (out->card_status != CARD_STATUS_OFFLINE)
                 status = compress_pause(out->compr);
@@ -6402,6 +6432,7 @@
                                                  out->sample_rate, popcount(out->channel_mask),
                                                  0);
         }
+        pthread_mutex_unlock(&out->latch_lock);
         pthread_mutex_unlock(&out->lock);
     }
     return status;
@@ -6416,6 +6447,7 @@
         ALOGD("copl(%p):resume compress driver", out);
         status = -ENODATA;
         lock_output_stream(out);
+        pthread_mutex_lock(&out->latch_lock);
         if (out->compr != NULL && out->offload_state == OFFLOAD_STATE_PAUSED) {
             if (out->card_status != CARD_STATUS_OFFLINE) {
                 status = compress_resume(out->compr);
@@ -6427,6 +6459,7 @@
             audio_extn_dts_notify_playback_state(out->usecase, 0, out->sample_rate,
                                                      popcount(out->channel_mask), 1);
         }
+        pthread_mutex_unlock(&out->latch_lock);
         pthread_mutex_unlock(&out->lock);
     }
     return status;
@@ -6455,12 +6488,14 @@
     if (is_offload_usecase(out->usecase)) {
         ALOGD("copl(%p):calling compress flush", out);
         lock_output_stream(out);
+        pthread_mutex_lock(&out->latch_lock);
         if (out->offload_state == OFFLOAD_STATE_PAUSED) {
             stop_compressed_output_l(out);
         } else {
             ALOGW("%s called in invalid state %d", __func__, out->offload_state);
         }
         out->written = 0;
+        pthread_mutex_unlock(&out->latch_lock);
         pthread_mutex_unlock(&out->lock);
         ALOGD("copl(%p):out of compress flush", out);
         return 0;
@@ -7735,7 +7770,7 @@
 
     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->compr_mute_lock, (const pthread_mutexattr_t *) NULL);
+    pthread_mutex_init(&out->latch_lock, (const pthread_mutexattr_t *) NULL);
     pthread_mutex_init(&out->position_query_lock, (const pthread_mutexattr_t *) NULL);
     pthread_cond_init(&out->cond, (const pthread_condattr_t *) NULL);
 
@@ -8650,6 +8685,9 @@
 
     pthread_cond_destroy(&out->cond);
     pthread_mutex_destroy(&out->lock);
+    pthread_mutex_destroy(&out->pre_lock);
+    pthread_mutex_destroy(&out->latch_lock);
+    pthread_mutex_destroy(&out->position_query_lock);
 
     pthread_mutex_lock(&adev->lock);
     streams_output_ctxt_t *out_ctxt = out_get_stream(adev, out->handle);
@@ -8712,7 +8750,7 @@
     }
 
     ret = str_parms_get_str(parms, "A2dpSuspended", value, sizeof(value));
-    if (ret>=0) {
+    if (ret >= 0) {
         if (!strncmp(value, "false", 5) &&
             audio_extn_a2dp_source_is_suspended()) {
             struct audio_usecase *usecase;
@@ -8860,7 +8898,6 @@
         }
     }
 
-    audio_extn_hfp_set_parameters(adev, parms);
     audio_extn_qdsp_set_parameters(adev, parms);
 
     status = audio_extn_a2dp_set_parameters(parms, &a2dp_reconfig);
@@ -8874,30 +8911,30 @@
 
             if (is_a2dp_out_device_type(&usecase->device_list)) {
                 ALOGD("reconfigure a2dp... forcing device switch");
-                pthread_mutex_unlock(&adev->lock);
-                lock_output_stream(usecase->stream.out);
-                pthread_mutex_lock(&adev->lock);
                 audio_extn_a2dp_set_handoff_mode(true);
                 ALOGD("Switching to speaker and muting the stream before select_devices");
                 check_a2dp_restore_l(adev, usecase->stream.out, false);
                 //force device switch to re configure encoder
                 select_devices(adev, usecase->id);
                 ALOGD("Unmuting the stream after select_devices");
+                pthread_mutex_lock(&usecase->stream.out->latch_lock);
                 usecase->stream.out->a2dp_compress_mute = false;
-                out_set_compr_volume(&usecase->stream.out->stream, usecase->stream.out->volume_l, usecase->stream.out->volume_r);
+                out_set_compr_volume(&usecase->stream.out->stream,
+                                     usecase->stream.out->volume_l,
+                                     usecase->stream.out->volume_r);
+                pthread_mutex_unlock(&usecase->stream.out->latch_lock);
                 audio_extn_a2dp_set_handoff_mode(false);
-                pthread_mutex_unlock(&usecase->stream.out->lock);
                 break;
-            } else if ((usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
-                        usecase->stream.out->a2dp_compress_mute) {
-                pthread_mutex_unlock(&adev->lock);
-                lock_output_stream(usecase->stream.out);
-                pthread_mutex_lock(&adev->lock);
-                reassign_device_list(&usecase->stream.out->device_list,
-                                     AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, "");
-                check_a2dp_restore_l(adev, usecase->stream.out, true);
-                pthread_mutex_unlock(&usecase->stream.out->lock);
-                break;
+            } else if (usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
+                pthread_mutex_lock(&usecase->stream.out->latch_lock);
+                if (usecase->stream.out->a2dp_compress_mute) {
+                    pthread_mutex_unlock(&usecase->stream.out->latch_lock);
+                    reassign_device_list(&usecase->stream.out->device_list,
+                                         AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, "");
+                    check_a2dp_restore_l(adev, usecase->stream.out, true);
+                    break;
+                }
+                pthread_mutex_unlock(&usecase->stream.out->latch_lock);
             }
         }
     }
@@ -9073,7 +9110,7 @@
         ALOGD("%s: mode %d , prev_mode %d \n", __func__, mode , adev->mode);
         adev->prev_mode = adev->mode; /* prev_mode is kept to handle voip concurrency*/
         adev->mode = mode;
-        if( mode == AUDIO_MODE_CALL_SCREEN ){
+        if (mode == AUDIO_MODE_CALL_SCREEN) {
             adev->current_call_output = adev->primary_output;
             voice_start_call(adev);
         } else if (voice_is_in_call_or_call_screen(adev) &&
@@ -9717,6 +9754,9 @@
     } else
         in_standby(&stream->common);
 
+    pthread_mutex_destroy(&in->lock);
+    pthread_mutex_destroy(&in->pre_lock);
+
     pthread_mutex_lock(&adev->lock);
     if (in->usecase == USECASE_AUDIO_RECORD) {
         adev->pcm_record_uc_state = 0;
@@ -10321,8 +10361,8 @@
     return;
 }
 
-/* out and adev lock held */
-static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool restore)
+/* adev lock held */
+int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *out, bool restore)
 {
     struct audio_usecase *uc_info;
     float left_p;
@@ -10341,23 +10381,26 @@
           out->usecase, use_case_table[out->usecase]);
 
     if (restore) {
+        pthread_mutex_lock(&out->latch_lock);
         // restore A2DP device for active usecases and unmute if required
         if (is_a2dp_out_device_type(&out->device_list)) {
             ALOGD("%s: restoring A2dp and unmuting stream", __func__);
             if (uc_info->out_snd_device != SND_DEVICE_OUT_BT_A2DP)
                 select_devices(adev, uc_info->id);
-            pthread_mutex_lock(&out->compr_mute_lock);
             if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
-                (out->a2dp_compress_mute) && (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP)) {
-                out->a2dp_compress_mute = false;
-                out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
+                (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP)) {
+                if (out->a2dp_compress_mute) {
+                    out->a2dp_compress_mute = false;
+                    out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
+                }
             }
-            pthread_mutex_unlock(&out->compr_mute_lock);
         }
+        out->muted = false;
+        pthread_mutex_unlock(&out->latch_lock);
     } else {
+        pthread_mutex_lock(&out->latch_lock);
         if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
             // mute compress stream if suspended
-            pthread_mutex_lock(&out->compr_mute_lock);
             if (!out->a2dp_compress_mute && !out->standby) {
                 ALOGD("%s: selecting speaker and muting stream", __func__);
                 assign_devices(&devices, &out->device_list);
@@ -10375,31 +10418,18 @@
                 out->volume_l = left_p;
                 out->volume_r = right_p;
             }
-            pthread_mutex_unlock(&out->compr_mute_lock);
         } else {
-            // tear down a2dp path for non offloaded streams
-            if (audio_extn_a2dp_source_is_suspended())
-                out_standby_l(&out->stream.common);
+            // mute for non offloaded streams
+            if (audio_extn_a2dp_source_is_suspended()) {
+                out->muted = true;
+            }
         }
+        pthread_mutex_unlock(&out->latch_lock);
     }
     ALOGV("%s: exit", __func__);
     return 0;
 }
 
-int check_a2dp_restore(struct audio_device *adev, struct stream_out *out, bool restore)
-{
-    int ret = 0;
-
-    lock_output_stream(out);
-    pthread_mutex_lock(&adev->lock);
-
-    ret = check_a2dp_restore_l(adev, out, restore);
-
-    pthread_mutex_unlock(&adev->lock);
-    pthread_mutex_unlock(&out->lock);
-    return ret;
-}
-
 void adev_on_battery_status_changed(bool charging)
 {
     pthread_mutex_lock(&adev->lock);
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 6931d8d..f1e8672 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -362,13 +362,18 @@
     stream_callback_t client_callback;
     void *client_cookie;
 };
+
 struct stream_out {
     struct audio_stream_out stream;
     pthread_mutex_t lock; /* see note below on mutex acquisition order */
     pthread_mutex_t pre_lock; /* acquire before lock to avoid DOS by playback thread */
-    pthread_mutex_t compr_mute_lock; /* acquire before setting compress volume */
-    pthread_mutex_t position_query_lock; /* acquire before updating/getting position of track offload*/
     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
+     */
+    pthread_mutex_t latch_lock;
+    pthread_mutex_t position_query_lock; /* sychronize frame written */
     struct pcm_config config;
     struct compr_config compr_config;
     struct pcm *pcm;
@@ -778,7 +783,7 @@
 audio_usecase_t get_usecase_id_from_usecase_type(const struct audio_device *adev,
                                                  usecase_type_t type);
 
-int check_a2dp_restore(struct audio_device *adev, struct stream_out *out, bool restore);
+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,
                             audio_io_handle_t handle,
diff --git a/hal/voice.c b/hal/voice.c
index 72c3372..586247f 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -231,6 +231,11 @@
         return -EINVAL;
     }
 
+    if (!adev->current_call_output) {
+        ALOGE("start_call: invalid current call output");
+        return -EINVAL;
+    }
+
     uc_info = (struct audio_usecase *)calloc(1, sizeof(struct audio_usecase));
     if (!uc_info) {
         ALOGE("start_call: couldn't allocate mem for audio_usecase");