haptics: enable hapitcs sink and slot setting

Bug: 199578214
Test: trigger audio coupled haptics via sound picker app
Change-Id: I2c20f75d5df59e5d72800878c76c5ad3c1709079
This commit is contained in:
Tai Kuo 2022-02-16 18:56:52 +08:00 committed by TreeHugger Robot
parent 9adc062bcc
commit e6f34d946a
10 changed files with 72 additions and 66 deletions

View file

@ -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,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Speaker Safe"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Earpiece"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Out"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Headphones"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Speaker"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Headset"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Car Kit"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<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"/>

View file

@ -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,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Speaker Safe"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Earpiece"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Headset"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Car Kit"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<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"/>

View file

@ -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,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Speaker Safe"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Earpiece"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Headset"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Car Kit"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<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"/>

View file

@ -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"/>

View file

@ -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,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Speaker Safe"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Earpiece"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Out"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Headphones"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Speaker"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Headset"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Car Kit"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<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"/>

View file

@ -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,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Speaker Safe"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Earpiece"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Headset"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Car Kit"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<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"/>

View file

@ -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,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Speaker Safe"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="Earpiece"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Headset"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<route type="mix" sink="BT SCO Car Kit"
sources="primary output,deep buffer,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload"/>
<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"/>

View file

@ -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"/>

View file

@ -10,7 +10,9 @@ modprobe|bcmdhd4389.ko
modprobe|snd-soc-cs35l41-spi.ko
modprobe|ftm5.ko
modprobe|sec_touch.ko
modprobe|cl_dsp.ko
modprobe|input-cs40l26-i2c.ko
modprobe|snd-soc-cs40l26.ko
# All device specific modules loaded
setprop|vendor.device.modules.ready

View file

@ -10,7 +10,9 @@ modprobe|bcmdhd4389.ko
modprobe|snd-soc-cs35l41-spi.ko
modprobe|ftm5.ko
modprobe|sec_touch.ko
modprobe|cl_dsp.ko
modprobe|input-cs40l26-i2c.ko
modprobe|snd-soc-cs40l26.ko
# All device specific modules loaded
setprop|vendor.device.modules.ready