From 082d1b6417f343e789674bf3fe8216016c8b3343 Mon Sep 17 00:00:00 2001 From: Yung Ti Su Date: Thu, 10 Nov 2022 17:22:48 +0800 Subject: [PATCH] Enable the spatial audio function Bug: 254771189 Test: manual Change-Id: I8fa9864103879efc10362695254e887629c46e10 Signed-off-by: Yung Ti Su --- audio/husky/audio-tables.mk | 2 +- audio/husky/config/audio_effects.xml | 2 + .../config/audio_platform_configuration.xml | 4 + .../config/audio_policy_configuration.xml | 20 +- ...cy_configuration_a2dp_offload_disabled.xml | 8 +- ...licy_configuration_le_offload_disabled.xml | 255 ++++++++++++++++++ ...with_le_audio_policy_configuration_7_0.xml | 71 +++++ audio/ripcurrent/audio-tables.mk | 2 +- audio/ripcurrent/config/audio_effects.xml | 2 + .../config/audio_platform_configuration.xml | 4 + .../config/audio_policy_configuration.xml | 20 +- ...cy_configuration_a2dp_offload_disabled.xml | 8 +- ...licy_configuration_le_offload_disabled.xml | 255 ++++++++++++++++++ ...with_le_audio_policy_configuration_7_0.xml | 71 +++++ audio/shiba/audio-tables.mk | 2 +- audio/shiba/config/audio_effects.xml | 2 + .../config/audio_platform_configuration.xml | 4 + .../config/audio_policy_configuration.xml | 20 +- ...cy_configuration_a2dp_offload_disabled.xml | 8 +- ...licy_configuration_le_offload_disabled.xml | 255 ++++++++++++++++++ ...with_le_audio_policy_configuration_7_0.xml | 71 +++++ device-husky.mk | 10 +- device-ripcurrent.mk | 10 +- device-shiba.mk | 10 +- 24 files changed, 1080 insertions(+), 36 deletions(-) create mode 100644 audio/husky/config/audio_policy_configuration_le_offload_disabled.xml create mode 100644 audio/husky/config/bluetooth_with_le_audio_policy_configuration_7_0.xml create mode 100644 audio/ripcurrent/config/audio_policy_configuration_le_offload_disabled.xml create mode 100644 audio/ripcurrent/config/bluetooth_with_le_audio_policy_configuration_7_0.xml create mode 100644 audio/shiba/config/audio_policy_configuration_le_offload_disabled.xml create mode 100644 audio/shiba/config/bluetooth_with_le_audio_policy_configuration_7_0.xml diff --git a/audio/husky/audio-tables.mk b/audio/husky/audio-tables.mk index 0fbac2d..f860ba8 100644 --- a/audio/husky/audio-tables.mk +++ b/audio/husky/audio-tables.mk @@ -23,7 +23,7 @@ PRODUCT_COPY_FILES += \ device/google/shusky/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/shusky/audio/$(AUDIO_TABLE_FOLDER)/config/audio_platform_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_configuration.xml \ device/google/shusky/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 + device/google/shusky/audio/$(AUDIO_TABLE_FOLDER)/config/bluetooth_with_le_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_with_le_audio_policy_configuration_7_0.xml # AudioEffectHAL Configuration PRODUCT_COPY_FILES += \ diff --git a/audio/husky/config/audio_effects.xml b/audio/husky/config/audio_effects.xml index 1718057..e35bfbd 100644 --- a/audio/husky/config/audio_effects.xml +++ b/audio/husky/config/audio_effects.xml @@ -10,6 +10,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/audio/husky/config/audio_platform_configuration.xml b/audio/husky/config/audio_platform_configuration.xml index dee8e62..febcf7b 100644 --- a/audio/husky/config/audio_platform_configuration.xml +++ b/audio/husky/config/audio_platform_configuration.xml @@ -227,6 +227,10 @@ + + + + diff --git a/audio/husky/config/audio_policy_configuration.xml b/audio/husky/config/audio_policy_configuration.xml index 1960e69..3fdeb3f 100644 --- a/audio/husky/config/audio_policy_configuration.xml +++ b/audio/husky/config/audio_policy_configuration.xml @@ -63,6 +63,10 @@ + + + + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> @@ -191,15 +195,15 @@ + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + + + + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + + + + + + + + Speaker + Speaker Safe + Earpiece + Built-In Mic + Built-In Back Mic + Telephony Tx + Voice Call And Telephony Rx + Echo Ref In + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/husky/config/bluetooth_with_le_audio_policy_configuration_7_0.xml b/audio/husky/config/bluetooth_with_le_audio_policy_configuration_7_0.xml new file mode 100644 index 0000000..8b2af59 --- /dev/null +++ b/audio/husky/config/bluetooth_with_le_audio_policy_configuration_7_0.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/audio/ripcurrent/audio-tables.mk b/audio/ripcurrent/audio-tables.mk index 68ea4e4..f194a3d 100644 --- a/audio/ripcurrent/audio-tables.mk +++ b/audio/ripcurrent/audio-tables.mk @@ -23,7 +23,7 @@ PRODUCT_COPY_FILES += \ device/google/shusky/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/shusky/audio/$(AUDIO_TABLE_FOLDER)/config/audio_platform_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_configuration.xml \ device/google/shusky/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 + device/google/shusky/audio/$(AUDIO_TABLE_FOLDER)/config/bluetooth_with_le_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_with_le_audio_policy_configuration_7_0.xml # AudioEffectHAL Configuration PRODUCT_COPY_FILES += \ diff --git a/audio/ripcurrent/config/audio_effects.xml b/audio/ripcurrent/config/audio_effects.xml index 1718057..e35bfbd 100644 --- a/audio/ripcurrent/config/audio_effects.xml +++ b/audio/ripcurrent/config/audio_effects.xml @@ -10,6 +10,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/audio/ripcurrent/config/audio_platform_configuration.xml b/audio/ripcurrent/config/audio_platform_configuration.xml index dee8e62..febcf7b 100644 --- a/audio/ripcurrent/config/audio_platform_configuration.xml +++ b/audio/ripcurrent/config/audio_platform_configuration.xml @@ -227,6 +227,10 @@ + + + + diff --git a/audio/ripcurrent/config/audio_policy_configuration.xml b/audio/ripcurrent/config/audio_policy_configuration.xml index 1960e69..3fdeb3f 100644 --- a/audio/ripcurrent/config/audio_policy_configuration.xml +++ b/audio/ripcurrent/config/audio_policy_configuration.xml @@ -63,6 +63,10 @@ + + + + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> @@ -191,15 +195,15 @@ + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + + + + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + + + + + + + + Speaker + Speaker Safe + Earpiece + Built-In Mic + Built-In Back Mic + Telephony Tx + Voice Call And Telephony Rx + Echo Ref In + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/ripcurrent/config/bluetooth_with_le_audio_policy_configuration_7_0.xml b/audio/ripcurrent/config/bluetooth_with_le_audio_policy_configuration_7_0.xml new file mode 100644 index 0000000..8b2af59 --- /dev/null +++ b/audio/ripcurrent/config/bluetooth_with_le_audio_policy_configuration_7_0.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/audio/shiba/audio-tables.mk b/audio/shiba/audio-tables.mk index 7425a44..fa9208e 100644 --- a/audio/shiba/audio-tables.mk +++ b/audio/shiba/audio-tables.mk @@ -23,7 +23,7 @@ PRODUCT_COPY_FILES += \ device/google/shusky/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/shusky/audio/$(AUDIO_TABLE_FOLDER)/config/audio_platform_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_configuration.xml \ device/google/shusky/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 + device/google/shusky/audio/$(AUDIO_TABLE_FOLDER)/config/bluetooth_with_le_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_with_le_audio_policy_configuration_7_0.xml # AudioEffectHAL Configuration PRODUCT_COPY_FILES += \ diff --git a/audio/shiba/config/audio_effects.xml b/audio/shiba/config/audio_effects.xml index 1718057..e35bfbd 100644 --- a/audio/shiba/config/audio_effects.xml +++ b/audio/shiba/config/audio_effects.xml @@ -10,6 +10,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/audio/shiba/config/audio_platform_configuration.xml b/audio/shiba/config/audio_platform_configuration.xml index dee8e62..febcf7b 100644 --- a/audio/shiba/config/audio_platform_configuration.xml +++ b/audio/shiba/config/audio_platform_configuration.xml @@ -227,6 +227,10 @@ + + + + diff --git a/audio/shiba/config/audio_policy_configuration.xml b/audio/shiba/config/audio_policy_configuration.xml index 1960e69..3fdeb3f 100644 --- a/audio/shiba/config/audio_policy_configuration.xml +++ b/audio/shiba/config/audio_policy_configuration.xml @@ -63,6 +63,10 @@ + + + + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> + encodedFormats="AUDIO_FORMAT_OPUS AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> @@ -191,15 +195,15 @@ + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,voip_rx,compressed_offload,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + + + + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + sources="primary output,deep buffer,haptic,raw,mmap_no_irq_out,voip_rx,hifi_playback,compressed_offload,immersive_out"/> + + + + + + + + Speaker + Speaker Safe + Earpiece + Built-In Mic + Built-In Back Mic + Telephony Tx + Voice Call And Telephony Rx + Echo Ref In + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/shiba/config/bluetooth_with_le_audio_policy_configuration_7_0.xml b/audio/shiba/config/bluetooth_with_le_audio_policy_configuration_7_0.xml new file mode 100644 index 0000000..8b2af59 --- /dev/null +++ b/audio/shiba/config/bluetooth_with_le_audio_policy_configuration_7_0.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/device-husky.mk b/device-husky.mk index b59433b..36e92ea 100644 --- a/device-husky.mk +++ b/device-husky.mk @@ -91,7 +91,15 @@ PRODUCT_COPY_FILES += \ PRODUCT_PROPERTY_OVERRIDES += \ ro.bluetooth.a2dp_offload.supported=true \ persist.bluetooth.a2dp_offload.disabled=false \ - persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac + persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac-opus + +# Spatial Audio +PRODUCT_PACKAGES += \ + libspatialaudio + +# declare use of spatial audio +PRODUCT_PROPERTY_OVERRIDES += \ + ro.audio.spatializer_enabled=true # Bluetooth hci_inject test tool PRODUCT_PACKAGES_DEBUG += \ diff --git a/device-ripcurrent.mk b/device-ripcurrent.mk index 150d815..de7e172 100644 --- a/device-ripcurrent.mk +++ b/device-ripcurrent.mk @@ -92,7 +92,15 @@ PRODUCT_COPY_FILES += \ PRODUCT_PROPERTY_OVERRIDES += \ ro.bluetooth.a2dp_offload.supported=true \ persist.bluetooth.a2dp_offload.disabled=false \ - persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac + persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac-opus + +# Spatial Audio +PRODUCT_PACKAGES += \ + libspatialaudio + +# declare use of spatial audio +PRODUCT_PROPERTY_OVERRIDES += \ + ro.audio.spatializer_enabled=true # Bluetooth hci_inject test tool PRODUCT_PACKAGES_DEBUG += \ diff --git a/device-shiba.mk b/device-shiba.mk index 393f5e9..2e5b391 100644 --- a/device-shiba.mk +++ b/device-shiba.mk @@ -92,7 +92,15 @@ PRODUCT_COPY_FILES += \ PRODUCT_PROPERTY_OVERRIDES += \ ro.bluetooth.a2dp_offload.supported=true \ persist.bluetooth.a2dp_offload.disabled=false \ - persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac + persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac-opus + +# Spatial Audio +PRODUCT_PACKAGES += \ + libspatialaudio + +# declare use of spatial audio +PRODUCT_PROPERTY_OVERRIDES += \ + ro.audio.spatializer_enabled=true # Bluetooth hci_inject test tool PRODUCT_PACKAGES_DEBUG += \