audio: add to support raw and mmap

Add to support raw-playback and mmap-playback

Bug: 165737390
Test: OboeTester->Test Output
Signed-off-by: millerliang <millerliang@google.com>
Change-Id: I2e9f530bd5d4c6d1f8d6bc3504d2fd0472631fcb
diff --git a/audio/oriole/config/audio_platform_configuration.xml b/audio/oriole/config/audio_platform_configuration.xml
index 146401d..ee21759 100644
--- a/audio/oriole/config/audio_platform_configuration.xml
+++ b/audio/oriole/config/audio_platform_configuration.xml
@@ -111,9 +111,11 @@
 
     <usecase_attr>
         <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 4 * 10ms buffer -->
-        <usecase id="UC_RAW_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <usecase id="UC_RAW_PLAYBACK" dev1="3" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
         <usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->
+	<usecase id="UC_MMAP_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="80"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_DEEP_BUFFER, 4 * 10ms buffer -->
         <usecase id="UC_DEEP_BUFFER_PLAYBACK" dev1="5" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- dev1: voice-call downlink dev2: voice-clal uplink -->
diff --git a/audio/oriole/config/audio_policy_configuration.xml b/audio/oriole/config/audio_policy_configuration.xml
index b7ee8a8..0112ac5 100644
--- a/audio/oriole/config/audio_policy_configuration.xml
+++ b/audio/oriole/config/audio_policy_configuration.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -150,11 +154,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -162,21 +166,21 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="BT A2DP Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT A2DP Headphones"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT A2DP Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/oriole/config/audio_policy_configuration_a2dp_offload_disabled.xml b/audio/oriole/config/audio_policy_configuration_a2dp_offload_disabled.xml
index 19794e1..b0ddcdf 100644
--- a/audio/oriole/config/audio_policy_configuration_a2dp_offload_disabled.xml
+++ b/audio/oriole/config/audio_policy_configuration_a2dp_offload_disabled.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -135,11 +139,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -147,15 +151,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/oriole/config/audio_policy_configuration_bluetooth_legacy_hal.xml b/audio/oriole/config/audio_policy_configuration_bluetooth_legacy_hal.xml
index 0c36d06..b42f3e2 100644
--- a/audio/oriole/config/audio_policy_configuration_bluetooth_legacy_hal.xml
+++ b/audio/oriole/config/audio_policy_configuration_bluetooth_legacy_hal.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -135,11 +139,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -147,15 +151,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/oriole/config/mixer_paths.xml b/audio/oriole/config/mixer_paths.xml
index 6197d2d..a029f01 100644
--- a/audio/oriole/config/mixer_paths.xml
+++ b/audio/oriole/config/mixer_paths.xml
@@ -372,7 +372,7 @@
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="0"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+        <ctl name="TDM_0_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP hac-handset">
@@ -382,14 +382,14 @@
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="2"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="BT_RX Mixer EP1" value="1"/>
+        <ctl name="BT_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-headphone">
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="4"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="USB_RX Mixer EP1" value="1"/>
+        <ctl name="USB_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-tty-full">
@@ -404,6 +404,42 @@
     <path name="raw-playbackP hearing-aid">
     </path>
 
+    <path name="mmap-playbackP">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="0"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP hac-handset">
+    </path>
+
+    <path name="mmap-playbackP bt">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="2"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="BT_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-headphone">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="4"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="USB_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-tty-full">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-hco">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-vco">
+    </path>
+
+    <path name="mmap-playbackP hearing-aid">
+    </path>
+
     <path name="compress-offload-playback">
         <ctl name="PCM Playback Volume" value="1000" />
         <ctl name="LVM Enable" value="1" />
diff --git a/audio/raven/config/audio_platform_configuration.xml b/audio/raven/config/audio_platform_configuration.xml
index 146401d..ee21759 100644
--- a/audio/raven/config/audio_platform_configuration.xml
+++ b/audio/raven/config/audio_platform_configuration.xml
@@ -111,9 +111,11 @@
 
     <usecase_attr>
         <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 4 * 10ms buffer -->
-        <usecase id="UC_RAW_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <usecase id="UC_RAW_PLAYBACK" dev1="3" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
         <usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->
+	<usecase id="UC_MMAP_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="80"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_DEEP_BUFFER, 4 * 10ms buffer -->
         <usecase id="UC_DEEP_BUFFER_PLAYBACK" dev1="5" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- dev1: voice-call downlink dev2: voice-clal uplink -->
diff --git a/audio/raven/config/audio_policy_configuration.xml b/audio/raven/config/audio_policy_configuration.xml
index b7ee8a8..0112ac5 100644
--- a/audio/raven/config/audio_policy_configuration.xml
+++ b/audio/raven/config/audio_policy_configuration.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -150,11 +154,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -162,21 +166,21 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="BT A2DP Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT A2DP Headphones"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT A2DP Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/raven/config/audio_policy_configuration_a2dp_offload_disabled.xml b/audio/raven/config/audio_policy_configuration_a2dp_offload_disabled.xml
index 19794e1..b0ddcdf 100644
--- a/audio/raven/config/audio_policy_configuration_a2dp_offload_disabled.xml
+++ b/audio/raven/config/audio_policy_configuration_a2dp_offload_disabled.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -135,11 +139,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -147,15 +151,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/raven/config/audio_policy_configuration_bluetooth_legacy_hal.xml b/audio/raven/config/audio_policy_configuration_bluetooth_legacy_hal.xml
index 0c36d06..b42f3e2 100644
--- a/audio/raven/config/audio_policy_configuration_bluetooth_legacy_hal.xml
+++ b/audio/raven/config/audio_policy_configuration_bluetooth_legacy_hal.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -135,11 +139,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -147,15 +151,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/raven/config/mixer_paths.xml b/audio/raven/config/mixer_paths.xml
index 656523b..5f7cb59 100644
--- a/audio/raven/config/mixer_paths.xml
+++ b/audio/raven/config/mixer_paths.xml
@@ -372,7 +372,7 @@
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="0"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+        <ctl name="TDM_0_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP hac-handset">
@@ -382,14 +382,14 @@
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="2"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="BT_RX Mixer EP1" value="1"/>
+        <ctl name="BT_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-headphone">
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="4"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="USB_RX Mixer EP1" value="1"/>
+        <ctl name="USB_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-tty-full">
@@ -404,6 +404,42 @@
     <path name="raw-playbackP hearing-aid">
     </path>
 
+    <path name="mmap-playbackP">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="0"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP hac-handset">
+    </path>
+
+    <path name="mmap-playbackP bt">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="2"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="BT_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-headphone">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="4"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="USB_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-tty-full">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-hco">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-vco">
+    </path>
+
+    <path name="mmap-playbackP hearing-aid">
+    </path>
+
     <path name="compress-offload-playback">
         <ctl name="PCM Playback Volume" value="1000" />
         <ctl name="LVM Enable" value="1" />
diff --git a/audio/slider/config/audio_platform_configuration.xml b/audio/slider/config/audio_platform_configuration.xml
index 23d4955..d903af4 100644
--- a/audio/slider/config/audio_platform_configuration.xml
+++ b/audio/slider/config/audio_platform_configuration.xml
@@ -111,9 +111,11 @@
 
     <usecase_attr>
         <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 4 * 10ms buffer -->
-        <usecase id="UC_RAW_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <usecase id="UC_RAW_PLAYBACK" dev1="3" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
         <usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->
+	<usecase id="UC_MMAP_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="80"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_DEEP_BUFFER, 4 * 10ms buffer -->
         <usecase id="UC_DEEP_BUFFER_PLAYBACK" dev1="5" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- dev1: voice-call downlink dev2: voice-clal uplink -->
diff --git a/audio/slider/config/audio_policy_configuration.xml b/audio/slider/config/audio_policy_configuration.xml
index b7ee8a8..0112ac5 100644
--- a/audio/slider/config/audio_policy_configuration.xml
+++ b/audio/slider/config/audio_policy_configuration.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -150,11 +154,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -162,21 +166,21 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="BT A2DP Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT A2DP Headphones"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT A2DP Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/slider/config/audio_policy_configuration_a2dp_offload_disabled.xml b/audio/slider/config/audio_policy_configuration_a2dp_offload_disabled.xml
index 19794e1..b0ddcdf 100644
--- a/audio/slider/config/audio_policy_configuration_a2dp_offload_disabled.xml
+++ b/audio/slider/config/audio_policy_configuration_a2dp_offload_disabled.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -135,11 +139,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -147,15 +151,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/slider/config/audio_policy_configuration_bluetooth_legacy_hal.xml b/audio/slider/config/audio_policy_configuration_bluetooth_legacy_hal.xml
index 0c36d06..b42f3e2 100644
--- a/audio/slider/config/audio_policy_configuration_bluetooth_legacy_hal.xml
+++ b/audio/slider/config/audio_policy_configuration_bluetooth_legacy_hal.xml
@@ -57,6 +57,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -135,11 +139,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -147,15 +151,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,haptic,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,haptic,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/slider/config/mixer_paths.xml b/audio/slider/config/mixer_paths.xml
index 58d68cf..460cb39 100644
--- a/audio/slider/config/mixer_paths.xml
+++ b/audio/slider/config/mixer_paths.xml
@@ -336,7 +336,7 @@
         <ctl name="PCM Playback Volume" value="250"/>
         <ctl name="SINK_IDS" id="0" value="0"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+        <ctl name="TDM_0_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP hac-handset">
@@ -346,14 +346,14 @@
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="2"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="BT_RX Mixer EP1" value="1"/>
+        <ctl name="BT_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-headphone">
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="4"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="USB_RX Mixer EP1" value="1"/>
+        <ctl name="USB_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-tty-full">
@@ -368,6 +368,42 @@
     <path name="raw-playbackP hearing-aid">
     </path>
 
+    <path name="mmap-playbackP">
+        <ctl name="PCM Playback Volume" value="250"/>
+        <ctl name="SINK_IDS" id="0" value="0"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP hac-handset">
+    </path>
+
+    <path name="mmap-playbackP bt">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="2"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="BT_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-headphone">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="4"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="USB_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-tty-full">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-hco">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-vco">
+    </path>
+
+    <path name="mmap-playbackP hearing-aid">
+    </path>
+
     <path name="compress-offload-playback">
         <ctl name="PCM Playback Volume" value="1000" />
         <ctl name="LVM Enable" value="1" />
diff --git a/audio/whitefin/config/audio_platform_configuration.xml b/audio/whitefin/config/audio_platform_configuration.xml
index 23d4955..d903af4 100644
--- a/audio/whitefin/config/audio_platform_configuration.xml
+++ b/audio/whitefin/config/audio_platform_configuration.xml
@@ -111,9 +111,11 @@
 
     <usecase_attr>
         <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 4 * 10ms buffer -->
-        <usecase id="UC_RAW_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <usecase id="UC_RAW_PLAYBACK" dev1="3" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
         <usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
+        <!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->
+	<usecase id="UC_MMAP_PLAYBACK" dev1="0" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="80"/>
         <!-- for output with AUDIO_OUTPUT_FLAG_DEEP_BUFFER, 4 * 10ms buffer -->
         <usecase id="UC_DEEP_BUFFER_PLAYBACK" dev1="5" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
         <!-- dev1: voice-call downlink dev2: voice-clal uplink -->
diff --git a/audio/whitefin/config/audio_policy_configuration.xml b/audio/whitefin/config/audio_policy_configuration.xml
index 31f5c57..c501061 100644
--- a/audio/whitefin/config/audio_policy_configuration.xml
+++ b/audio/whitefin/config/audio_policy_configuration.xml
@@ -52,6 +52,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -130,11 +134,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -142,15 +146,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/whitefin/config/audio_policy_configuration_a2dp_offload_disabled.xml b/audio/whitefin/config/audio_policy_configuration_a2dp_offload_disabled.xml
index 4b62caa..a83de6d 100644
--- a/audio/whitefin/config/audio_policy_configuration_a2dp_offload_disabled.xml
+++ b/audio/whitefin/config/audio_policy_configuration_a2dp_offload_disabled.xml
@@ -52,6 +52,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -130,11 +134,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -142,15 +146,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/whitefin/config/audio_policy_configuration_bluetooth_legacy_hal.xml b/audio/whitefin/config/audio_policy_configuration_bluetooth_legacy_hal.xml
index d4955f4..f661328 100644
--- a/audio/whitefin/config/audio_policy_configuration_bluetooth_legacy_hal.xml
+++ b/audio/whitefin/config/audio_policy_configuration_bluetooth_legacy_hal.xml
@@ -52,6 +52,10 @@
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                 </mixPort>
+                <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ">
+                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
+                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
+                </mixPort>
                 <mixPort name="incall playback" role="source"
                          flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
@@ -130,11 +134,11 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>
                 <route type="mix" sink="hotword input"
@@ -142,15 +146,15 @@
                 <route type="mix" sink="incall capture" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="voice call rx" sources="Voice Call And Telephony Rx" />
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer,raw,compressed_offload"/>
+                       sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out"/>
                 <route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" />
             </routes>
         </module>
diff --git a/audio/whitefin/config/mixer_paths.xml b/audio/whitefin/config/mixer_paths.xml
index e7899b2..03a9f5e 100644
--- a/audio/whitefin/config/mixer_paths.xml
+++ b/audio/whitefin/config/mixer_paths.xml
@@ -373,7 +373,7 @@
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="0"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+        <ctl name="TDM_0_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP hac-handset">
@@ -383,14 +383,14 @@
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="2"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="BT_RX Mixer EP1" value="1"/>
+        <ctl name="BT_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-headphone">
         <ctl name="PCM Playback Volume" value="1000"/>
         <ctl name="SINK_IDS" id="0" value="4"/>
         <ctl name="SINK_IDS" id="1" value="-1"/>
-        <ctl name="USB_RX Mixer EP1" value="1"/>
+        <ctl name="USB_RX Mixer EP4" value="1"/>
     </path>
 
     <path name="raw-playbackP usb-tty-full">
@@ -405,6 +405,42 @@
     <path name="raw-playbackP hearing-aid">
     </path>
 
+    <path name="mmap-playbackP">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="0"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="TDM_0_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP hac-handset">
+    </path>
+
+    <path name="mmap-playbackP bt">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="2"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="BT_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-headphone">
+        <ctl name="PCM Playback Volume" value="1000"/>
+        <ctl name="SINK_IDS" id="0" value="4"/>
+        <ctl name="SINK_IDS" id="1" value="-1"/>
+        <ctl name="USB_RX Mixer EP1" value="1"/>
+    </path>
+
+    <path name="mmap-playbackP usb-tty-full">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-hco">
+    </path>
+
+    <path name="mmap-playbackP usb-tty-vco">
+    </path>
+
+    <path name="mmap-playbackP hearing-aid">
+    </path>
+
     <path name="compress-offload-playback">
         <ctl name="PCM Playback Volume" value="1000" />
         <ctl name="LVM Enable" value="1" />