From edce5a7940f48b20a6a9f967e68444f1bbc2e015 Mon Sep 17 00:00:00 2001 From: kuanyuhuang Date: Mon, 28 Nov 2022 15:04:01 +0000 Subject: [PATCH] Add audio Spatializer and support OPUS codec Add spatializer, immersive playback and OPUS codec at audio config. Enable Spatializer and Bluetooth OPUS codec. Bug: 261660037 Test: play dynamic spatial audio content Change-Id: I8b25eacdd804017a882b26cab13be69d403b6dc9 --- audio/tangorpro/config/audio_effects.xml | 2 ++ .../config/audio_platform_configuration.xml | 6 ++++++ .../config/audio_policy_configuration.xml | 20 +++++++++++-------- ...cy_configuration_a2dp_offload_disabled.xml | 8 ++++++-- audio/tangorpro/config/mixer_paths.xml | 9 ++++++--- bluetooth/syna_default.mk | 2 +- device-tangorpro.mk | 16 +++++++++++++++ 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/audio/tangorpro/config/audio_effects.xml b/audio/tangorpro/config/audio_effects.xml index 9c2ba29..11e66e5 100644 --- a/audio/tangorpro/config/audio_effects.xml +++ b/audio/tangorpro/config/audio_effects.xml @@ -10,6 +10,7 @@ + @@ -54,6 +55,7 @@ + diff --git a/audio/tangorpro/config/audio_platform_configuration.xml b/audio/tangorpro/config/audio_platform_configuration.xml index f8fb665..76c4136 100644 --- a/audio/tangorpro/config/audio_platform_configuration.xml +++ b/audio/tangorpro/config/audio_platform_configuration.xml @@ -187,6 +187,8 @@ + + @@ -223,6 +225,10 @@ + + + + diff --git a/audio/tangorpro/config/audio_policy_configuration.xml b/audio/tangorpro/config/audio_policy_configuration.xml index 78c8ea3..65c3907 100644 --- a/audio/tangorpro/config/audio_policy_configuration.xml +++ b/audio/tangorpro/config/audio_policy_configuration.xml @@ -58,6 +58,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"> @@ -193,17 +197,17 @@ + sources="primary output,deep buffer,compressed_offload,voip_rx,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,compressed_offload,voip_rx,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,compressed_offload,voip_rx,raw,mmap_no_irq_out,immersive_out"/> + sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out,voip_rx,hifi_playback,immersive_out"/> + sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out,voip_rx,hifi_playback,immersive_out"/> + + + + sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out,voip_rx,hifi_playback,immersive_out"/> + sources="primary output,deep buffer,raw,compressed_offload,mmap_no_irq_out,voip_rx,hifi_playback,immersive_out"/> + @@ -177,6 +178,7 @@ + @@ -188,6 +190,7 @@ + @@ -516,15 +519,15 @@ - + - + - + diff --git a/bluetooth/syna_default.mk b/bluetooth/syna_default.mk index 72a3015..a7bb878 100644 --- a/bluetooth/syna_default.mk +++ b/bluetooth/syna_default.mk @@ -55,7 +55,7 @@ PRODUCT_PROPERTY_OVERRIDES += \ 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 PRODUCT_PRODUCT_PROPERTIES += \ persist.bluetooth.firmware.selection="BTFW.hcd" diff --git a/device-tangorpro.mk b/device-tangorpro.mk index 0c526e7..e294354 100644 --- a/device-tangorpro.mk +++ b/device-tangorpro.mk @@ -104,6 +104,22 @@ PRODUCT_SOONG_NAMESPACES += device/google/tangorpro/powerstats # Bluetooth HAL and Pixel extension include device/google/tangorpro/bluetooth/syna_default.mk +# Spatial Audio +PRODUCT_PACKAGES += \ + libspatialaudio + +# optimize spatializer effect +PRODUCT_PROPERTY_OVERRIDES += \ + audio.spatializer.effect.util_clamp_min=300 + +# declare use of spatial audio +PRODUCT_PROPERTY_OVERRIDES += \ + ro.audio.spatializer_enabled=true + +# Bluetooth OPUS codec +PRODUCT_PRODUCT_PROPERTIES += \ + persist.bluetooth.opus.enabled=true + # Keymaster HAL #LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service