Преглед изворни кода

haptics: enable hapitcs sink and slot setting

Bug: 220068530
Test: trigger audio coupled haptics via sound picker app
Change-Id: I08885ae97e6f47a2840680481c3f9fb56cbe3c47
Tai Kuo пре 3 година
родитељ
комит
1b93fdd730

+ 13 - 13
audio/lynx/config/audio_policy_configuration.xml

@@ -50,11 +50,11 @@
                              samplingRates="8000 16000 24000 32000 44100 48000"
                              channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
                 </mixPort-->
-                <!--mixPort name="haptic" role="source">
+                <mixPort name="haptic" role="source">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000"
                              channelMasks="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A" />
-                </mixPort-->
+                </mixPort>
                 <!--mixPort name="raw" role="source" flags="AUDIO_OUTPUT_FLAG_RAW AUDIO_OUTPUT_FLAG_FAST">
                     <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
@@ -185,27 +185,27 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT A2DP Out"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT A2DP Headphones"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT A2DP Speaker"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <!--route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" /-->
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>

+ 10 - 10
audio/lynx/config/audio_policy_configuration_a2dp_offload_disabled.xml

@@ -50,11 +50,11 @@
                              samplingRates="8000 16000 24000 32000 44100 48000"
                              channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
                 </mixPort-->
-                <!--mixPort name="haptic" role="source">
+                <mixPort name="haptic" role="source">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000"
                              channelMasks="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A" />
-                </mixPort-->
+                </mixPort>
                 <!--mixPort name="raw" role="source" flags="AUDIO_OUTPUT_FLAG_RAW AUDIO_OUTPUT_FLAG_FAST">
                     <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
@@ -170,21 +170,21 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <!--route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" /-->
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>

+ 10 - 10
audio/lynx/config/audio_policy_configuration_bluetooth_legacy_hal.xml

@@ -50,11 +50,11 @@
                              samplingRates="8000 16000 24000 32000 44100 48000"
                              channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/>
                 </mixPort-->
-                <!--mixPort name="haptic" role="source">
+                <mixPort name="haptic" role="source">
                     <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                              samplingRates="48000"
                              channelMasks="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A" />
-                </mixPort-->
+                </mixPort>
                 <!--mixPort name="raw" role="source" flags="AUDIO_OUTPUT_FLAG_RAW AUDIO_OUTPUT_FLAG_FAST">
                     <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
                              samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
@@ -170,21 +170,21 @@
             <!-- route declaration, i.e. list all available sources for a given sink -->
             <routes>
                 <route type="mix" sink="Speaker"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="Speaker Safe"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="Earpiece"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="USB Device Out"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="USB Headset Out"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO Headset"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <route type="mix" sink="BT SCO Car Kit"
-                       sources="primary output,deep buffer"/>
+                       sources="primary output,deep buffer,haptic"/>
                 <!--route type="mix" sink="Telephony Tx" sources="incall playback,voice call tx" /-->
                 <route type="mix" sink="primary input"
                        sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In,BT SCO Headset Mic"/>

+ 1 - 0
audio/lynx/config/mixer_paths.xml

@@ -39,6 +39,7 @@
     <ctl name="TDM_0_TX Sample Rate" value="SR_48K" />
 
     <!-- Haptic setting -->
+    <ctl name="Haptics Source" value="PCM"/>
     <ctl name="HAPTIC_RX Format" value="S32_LE"/>
     <ctl name="HAPTIC_RX SlotFmt" value="S32_LE"/>
     <ctl name="HAPTIC_RX Chan" value="Four"/>