From 9766c2b1c7044a781ef87fdf8be9eda4bc8c41ab Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 26 Apr 2020 14:47:17 +0200 Subject: [PATCH 1/3] audio_policy: Move common "primary" configuration to separate file This will reduce duplication when the new audio HAL and A2DP offloading come online, that both require duplication of the toplevel audio policy file extended with the appropriate routes. Signed-off-by: Marijn Suijten --- platform.mk | 3 +- .../vendor/etc/audio_policy_configuration.xml | 137 ++---------------- ...mon_primary_audio_policy_configuration.xml | 112 ++++++++++++++ 3 files changed, 124 insertions(+), 128 deletions(-) create mode 100644 rootdir/vendor/etc/common_primary_audio_policy_configuration.xml diff --git a/platform.mk b/platform.mk index 29052b7..28e9380 100644 --- a/platform.mk +++ b/platform.mk @@ -39,7 +39,8 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ $(SONY_ROOT)/vendor/etc/audio_tuning_mixer_tasha.txt:$(TARGET_COPY_OUT_VENDOR)/etc/audio_tuning_mixer_tasha.txt \ $(SONY_ROOT)/vendor/etc/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \ - $(SONY_ROOT)/vendor/etc/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml + $(SONY_ROOT)/vendor/etc/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + $(SONY_ROOT)/vendor/etc/common_primary_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/common_primary_audio_policy_configuration.xml # Media PRODUCT_COPY_FILES += \ diff --git a/rootdir/vendor/etc/audio_policy_configuration.xml b/rootdir/vendor/etc/audio_policy_configuration.xml index 344c0ef..5c0c942 100644 --- a/rootdir/vendor/etc/audio_policy_configuration.xml +++ b/rootdir/vendor/etc/audio_policy_configuration.xml @@ -14,12 +14,12 @@ limitations under the License. --> - + - - + - + - - Speaker - Earpiece - Telephony Tx - Built-In Mic - Built-In Back Mic - Telephony Rx - - Speaker - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - - + + diff --git a/rootdir/vendor/etc/common_primary_audio_policy_configuration.xml b/rootdir/vendor/etc/common_primary_audio_policy_configuration.xml new file mode 100644 index 0000000..127c132 --- /dev/null +++ b/rootdir/vendor/etc/common_primary_audio_policy_configuration.xml @@ -0,0 +1,112 @@ + + + + + Speaker + Earpiece + Telephony Tx + Built-In Mic + Built-In Back Mic + Telephony Rx + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From f3f556382341f0eecdccc745ee77ffec0660535d Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 12 Sep 2019 11:53:52 +0200 Subject: [PATCH 2/3] audio_policy: Create fallback policy for legacy HAL This is a convenience commit that contains a pure copy of audio_policy_configuration.xml. Actual modifications to our audio configuration will be done in a separate commit, making the changes much more obvious. The fallback policy is used to circumvent bluetooth.audio@2.0. While no issues are expected nor found during prolonged testing (+/- one year) AOSP provides this feature and we might as well use it. The legacy HAL can be used by setting: persist.bluetooth.bluetooth_audio_hal.disabled=true See the policy selection changes for more info: https://android.googlesource.com/platform/frameworks/av/+/e598545cb84723da4878c503ac54ca1426fa920b Signed-off-by: Marijn Suijten --- platform.mk | 1 + ...icy_configuration_bluetooth_legacy_hal.xml | 70 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 rootdir/vendor/etc/audio_policy_configuration_bluetooth_legacy_hal.xml diff --git a/platform.mk b/platform.mk index 28e9380..ff9ff55 100644 --- a/platform.mk +++ b/platform.mk @@ -40,6 +40,7 @@ PRODUCT_COPY_FILES += \ $(SONY_ROOT)/vendor/etc/audio_tuning_mixer_tasha.txt:$(TARGET_COPY_OUT_VENDOR)/etc/audio_tuning_mixer_tasha.txt \ $(SONY_ROOT)/vendor/etc/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \ $(SONY_ROOT)/vendor/etc/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + $(SONY_ROOT)/vendor/etc/audio_policy_configuration_bluetooth_legacy_hal.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_bluetooth_legacy_hal.xml \ $(SONY_ROOT)/vendor/etc/common_primary_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/common_primary_audio_policy_configuration.xml # Media diff --git a/rootdir/vendor/etc/audio_policy_configuration_bluetooth_legacy_hal.xml b/rootdir/vendor/etc/audio_policy_configuration_bluetooth_legacy_hal.xml new file mode 100644 index 0000000..5c0c942 --- /dev/null +++ b/rootdir/vendor/etc/audio_policy_configuration_bluetooth_legacy_hal.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7280ec6c2a3c8bd61ac709b302bbbe084c5449f8 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sun, 26 Apr 2020 15:29:33 +0200 Subject: [PATCH 3/3] audio_policy: Migrate to bluetooth.audio@2.0 policy The audio.bluetooth.default.so audio module, configured by bluetooth_audio_policy_configuration.xml, utilizes the new HAL-based mechanism to register a BT audio endpoint and transfer audio data. Update our policy to route audio properly to this module, while retaining a2dp input compatibility through the old mechanism. See the identical change in crosshatch: https://android.googlesource.com/device/google/crosshatch/+/c05ccdbed6c7c74d450e7149969c6c3431155628 audio_policy_configuration_bluetooth_legacy_hal.xml remains unchanged to reflect the old variant of the system (using sockets between the BT stack and audioserver), usable with persist.bluetooth.bluetooth_audio_hal.disabled=true. NOTE: This relies on device-sony-common to add the new files to PRODUCT_COPY_FILES. Signed-off-by: Marijn Suijten --- rootdir/vendor/etc/audio_policy_configuration.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rootdir/vendor/etc/audio_policy_configuration.xml b/rootdir/vendor/etc/audio_policy_configuration.xml index 5c0c942..6088717 100644 --- a/rootdir/vendor/etc/audio_policy_configuration.xml +++ b/rootdir/vendor/etc/audio_policy_configuration.xml @@ -48,8 +48,8 @@ - - + + @@ -57,6 +57,9 @@ + + +