audio: configuration for spatial audio

Update audio configuration to enable spatial audio:
- build with spatial audio feature enabled and rondo library
- list spatializer effect in audio effect configuration file
- update audio policy configuration files to declare spatializer output
- declare immersive end point in audio platform configuration

Bug: 237677573
Test: spatial audio playback
Change-Id: Ic9c32d813a19ba2789425e12ee9016d53ab30678
This commit is contained in:
Eric Laurent 2022-05-09 15:44:59 +02:00
parent e6dfb9ebb9
commit f28274c131
16 changed files with 220 additions and 40 deletions

View file

@ -24,7 +24,7 @@ PRODUCT_COPY_FILES += \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/audio_policy_configuration_a2dp_offload_disabled.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_a2dp_offload_disabled.xml \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/audio_platform_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_configuration.xml \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/sound_trigger_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_configuration.xml \
frameworks/av/services/audiopolicy/config/bluetooth_with_le_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \
$(LOCAL_PATH)/audio/$(AUDIO_TABLE_FOLDER)/config/bluetooth_with_le_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml
# AudioEffectHAL Configuration

View file

@ -10,6 +10,7 @@
<library name="proxy" path="libeffectproxy.so"/>
<library name="offload_effect" path="liboffloadeffect.so"/>
<library name="haptic_generator" path="libhapticgenerator.so"/>
<library name="spatializer" path="libspatialaudio.so"/>
</libraries>
<effects>
<effectProxy name="bassboost" library="proxy" uuid="2f0871a2-c93c-4824-9664-42eb2909f2ef">
@ -54,6 +55,7 @@
<effect name="aec" library="offload_effect" uuid="28c28780-ec8b-48b6-8590-8c84557d797d"/>
<effect name="ns" library="offload_effect" uuid="62ff2836-d050-43c3-9c2d-94a73dad2c64"/>
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="spatializer" library="spatializer" uuid="cc4677de-ff72-11eb-9a03-0242ac130003"/>
</effects>
<postprocess>
</postprocess>

View file

@ -183,6 +183,8 @@
<usecase id="UC_DEEP_BUFFER_PLAYBACK" dev1="5" dyn_path="true" dsp_vol="false" mmap="false" period="20" period_num="4"/>
<!-- dev1: voice-call downlink dev2: voice-clal uplink -->
<usecase id="UC_VOICE_CALL" dev1="4" dev2="11"/>
<!-- for output with flag AUDIO_OUTPUT_SPATIALIZER -->
<usecase id="UC_IMMERSIVE_PLAYBACK" dev1="3"/>
<!-- for output with AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD, 4 * 128KB buffer -->
<usecase id="UC_COMPRESSED_OFFLOAD_PLAYBACK" dev1="6" dyn_path="true" dsp_vol="true" mmap="false" period="131072" period_num="4" pre_proc_id="14"/>
<!-- dev1: audio dev2: haptic -->

View file

@ -64,6 +64,10 @@
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
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"
@ -198,25 +202,25 @@
<!-- 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,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload,immersive_out"/>
<route type="mix" sink="Speaker Safe"
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,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Out"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Headphones"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Speaker"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT BLE Headset"
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT BLE Speaker"
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
<route type="mix" sink="BT SCO Headset"

View file

@ -64,6 +64,10 @@
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
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"
@ -171,15 +175,15 @@
<!-- 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,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload,immersive_out"/>
<route type="mix" sink="Speaker Safe"
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,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
<route type="mix" sink="BT SCO Headset"

View file

@ -64,6 +64,10 @@
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
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"
@ -186,21 +190,21 @@
<!-- 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,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload,immersive_out"/>
<route type="mix" sink="Speaker Safe"
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,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Out"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Headphones"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Speaker"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
<route type="mix" sink="BT SCO Headset"

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Bluetooth Audio HAL Audio Policy Configuration file -->
<module name="bluetooth" halVersion="2.0">
<mixPorts>
<!-- A2DP Audio Ports -->
<mixPort name="a2dp output" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER"/>
<!-- Hearing AIDs Audio Ports -->
<mixPort name="hearing aid output" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="24000 16000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<!-- Le Audio Audio Ports -->
<mixPort name="le audio output" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="le audio input" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000 16000 24000 32000 44100 48000"
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
samplingRates="8000 16000 24000 32000 44100 48000"
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
samplingRates="8000 16000 24000 32000 44100 48000"
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
</mixPort>
</mixPorts>
<devicePorts>
<!-- A2DP Audio Ports -->
<devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000 88200 96000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000 88200 96000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000 88200 96000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<!-- Hearing AIDs Audio Ports -->
<devicePort tagName="BT Hearing Aid Out" type="AUDIO_DEVICE_OUT_HEARING_AID" role="sink"/>
<!-- BLE Audio Ports -->
<devicePort tagName="BLE Headset Out" type="AUDIO_DEVICE_OUT_BLE_HEADSET" role="sink"/>
<devicePort tagName="BLE Speaker Out" type="AUDIO_DEVICE_OUT_BLE_SPEAKER" role="sink"/>
<devicePort tagName="BLE Headset In" type="AUDIO_DEVICE_IN_BLE_HEADSET" role="source"/>
</devicePorts>
<routes>
<route type="mix" sink="BT A2DP Out"
sources="a2dp output"/>
<route type="mix" sink="BT A2DP Headphones"
sources="a2dp output"/>
<route type="mix" sink="BT A2DP Speaker"
sources="a2dp output"/>
<route type="mix" sink="BT Hearing Aid Out"
sources="hearing aid output"/>
<route type="mix" sink="BLE Headset Out"
sources="le audio output"/>
<route type="mix" sink="le audio input"
sources="BLE Headset In"/>
<route type="mix" sink="BLE Speaker Out"
sources="le audio output"/>
</routes>
</module>

View file

@ -24,7 +24,7 @@ PRODUCT_COPY_FILES += \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/audio_policy_configuration_a2dp_offload_disabled.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_a2dp_offload_disabled.xml \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/audio_platform_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_configuration.xml \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/sound_trigger_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_configuration.xml \
frameworks/av/services/audiopolicy/config/bluetooth_with_le_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \
$(LOCAL_PATH)/audio/$(AUDIO_TABLE_FOLDER)/config/bluetooth_with_le_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \
device/google/pantah/audio/$(AUDIO_TABLE_FOLDER)/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml
# AudioEffectHAL Configuration

View file

@ -10,6 +10,7 @@
<library name="proxy" path="libeffectproxy.so"/>
<library name="offload_effect" path="liboffloadeffect.so"/>
<library name="haptic_generator" path="libhapticgenerator.so"/>
<library name="spatializer" path="libspatialaudio.so"/>
</libraries>
<effects>
<effectProxy name="bassboost" library="proxy" uuid="2f0871a2-c93c-4824-9664-42eb2909f2ef">
@ -54,6 +55,7 @@
<effect name="aec" library="offload_effect" uuid="28c28780-ec8b-48b6-8590-8c84557d797d"/>
<effect name="ns" library="offload_effect" uuid="62ff2836-d050-43c3-9c2d-94a73dad2c64"/>
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="spatializer" library="spatializer" uuid="cc4677de-ff72-11eb-9a03-0242ac130003"/>
</effects>
<postprocess>
</postprocess>

View file

@ -183,6 +183,8 @@
<usecase id="UC_DEEP_BUFFER_PLAYBACK" dev1="5" dyn_path="true" dsp_vol="false" mmap="false" period="20" period_num="4"/>
<!-- dev1: voice-call downlink dev2: voice-clal uplink -->
<usecase id="UC_VOICE_CALL" dev1="4" dev2="11"/>
<!-- for output with flag AUDIO_OUTPUT_SPATIALIZER -->
<usecase id="UC_IMMERSIVE_PLAYBACK" dev1="3"/>
<!-- for output with AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD, 4 * 128KB buffer -->
<usecase id="UC_COMPRESSED_OFFLOAD_PLAYBACK" dev1="6" dyn_path="true" dsp_vol="true" mmap="false" period="131072" period_num="4" pre_proc_id="14"/>
<!-- dev1: audio dev2: haptic -->

View file

@ -64,6 +64,10 @@
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
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"
@ -198,25 +202,25 @@
<!-- 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,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload,immersive_out"/>
<route type="mix" sink="Speaker Safe"
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,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Out"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Headphones"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Speaker"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT BLE Headset"
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT BLE Speaker"
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,compressed_offload,voip_rx,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
<route type="mix" sink="BT SCO Headset"

View file

@ -64,6 +64,10 @@
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
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"
@ -171,15 +175,15 @@
<!-- 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,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload,immersive_out"/>
<route type="mix" sink="Speaker Safe"
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,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
<route type="mix" sink="BT SCO Headset"

View file

@ -64,6 +64,10 @@
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="immersive_out" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_FLOAT"
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"
@ -186,21 +190,21 @@
<!-- 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,mmap_no_irq_out,voip_rx,compressed_offload"/>
sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload,immersive_out"/>
<route type="mix" sink="Speaker Safe"
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,haptic,raw,mmap_no_irq_out,voip_rx,compressed_offload"/>
<route type="mix" sink="BT A2DP Out"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Headphones"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="BT A2DP Speaker"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/>
<route type="mix" sink="USB Device Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="USB Headset Out"
sources="primary output,deep buffer,haptic,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,immersive_out"/>
<route type="mix" sink="BT SCO"
sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out"/>
<route type="mix" sink="BT SCO Headset"

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Bluetooth Audio HAL Audio Policy Configuration file -->
<module name="bluetooth" halVersion="2.0">
<mixPorts>
<!-- A2DP Audio Ports -->
<mixPort name="a2dp output" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER"/>
<!-- Hearing AIDs Audio Ports -->
<mixPort name="hearing aid output" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="24000 16000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<!-- Le Audio Audio Ports -->
<mixPort name="le audio output" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<mixPort name="le audio input" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000 16000 24000 32000 44100 48000"
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
<profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
samplingRates="8000 16000 24000 32000 44100 48000"
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
<profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
samplingRates="8000 16000 24000 32000 44100 48000"
channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/>
</mixPort>
</mixPorts>
<devicePorts>
<!-- A2DP Audio Ports -->
<devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000 88200 96000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000 88200 96000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="44100 48000 88200 96000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</devicePort>
<!-- Hearing AIDs Audio Ports -->
<devicePort tagName="BT Hearing Aid Out" type="AUDIO_DEVICE_OUT_HEARING_AID" role="sink"/>
<!-- BLE Audio Ports -->
<devicePort tagName="BLE Headset Out" type="AUDIO_DEVICE_OUT_BLE_HEADSET" role="sink"/>
<devicePort tagName="BLE Speaker Out" type="AUDIO_DEVICE_OUT_BLE_SPEAKER" role="sink"/>
<devicePort tagName="BLE Headset In" type="AUDIO_DEVICE_IN_BLE_HEADSET" role="source"/>
</devicePorts>
<routes>
<route type="mix" sink="BT A2DP Out"
sources="a2dp output"/>
<route type="mix" sink="BT A2DP Headphones"
sources="a2dp output"/>
<route type="mix" sink="BT A2DP Speaker"
sources="a2dp output"/>
<route type="mix" sink="BT Hearing Aid Out"
sources="hearing aid output"/>
<route type="mix" sink="BLE Headset Out"
sources="le audio output"/>
<route type="mix" sink="le audio input"
sources="BLE Headset In"/>
<route type="mix" sink="BLE Speaker Out"
sources="le audio output"/>
</routes>
</module>

View file

@ -146,8 +146,7 @@ PRODUCT_PROPERTY_OVERRIDES += \
# Spatial Audio
PRODUCT_PACKAGES += \
libspatialaudio \
librondo
libspatialaudio
# Bluetooth hci_inject test tool
PRODUCT_PACKAGES_DEBUG += \
@ -167,6 +166,10 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES_DEBUG += \
sar_test
# declare use of spatial audio
PRODUCT_PROPERTY_OVERRIDES += \
ro.audio.spatializer_enabled=true
# Keymaster HAL
#LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service

View file

@ -130,8 +130,7 @@ PRODUCT_PROPERTY_OVERRIDES += \
# Spatial Audio
PRODUCT_PACKAGES += \
libspatialaudio \
librondo
libspatialaudio
# Bluetooth hci_inject test tool
PRODUCT_PACKAGES_DEBUG += \
@ -151,6 +150,10 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES_DEBUG += \
sar_test
# declare use of spatial audio
PRODUCT_PROPERTY_OVERRIDES += \
ro.audio.spatializer_enabled=true
# Keymaster HAL
#LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service