From a85c69a8b53b9582e1c09336e629f90a840fe224 Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Mon, 25 May 2020 11:15:11 +0800 Subject: [PATCH] sdm660-common: Switch to QTI bt stack and enable a2dp offload Change-Id: I8b3e7701a81ac92696d59c145e91351839048e39 --- BoardConfigCommon.mk | 1 + bluetooth/bdroid_buildcfg.h | 32 -- common_prop.mk | 13 +- configs/audio/audio_policy_configuration.xml | 67 ++-- ...cy_configuration_a2dp_offload_disabled.xml | 101 +----- ...onfiguration_a2dp_offload_disabled_qti.xml | 326 ++++++++++++++++++ ...uetooth_qti_audio_policy_configuration.xml | 44 +++ manifest.xml | 9 + .../apps/Bluetooth/res/values/config.xml | 35 ++ .../apps/Bluetooth/res/values/config.xml | 3 +- proprietary-files.txt | 18 +- sdm660.mk | 16 +- 12 files changed, 507 insertions(+), 158 deletions(-) create mode 100644 configs/audio/audio_policy_configuration_a2dp_offload_disabled_qti.xml create mode 100644 configs/audio/bluetooth_qti_audio_policy_configuration.xml create mode 100644 overlay-system/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml rename overlay/{ => vendor/qcom/opensource/commonsys}/packages/apps/Bluetooth/res/values/config.xml (97%) diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index ef40ae42..779e92b4 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -84,6 +84,7 @@ BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(COMMON_PATH)/bluetooth QCOM_BT_USE_BTNV := true QCOM_BT_USE_SMD_TTY := true TARGET_USE_QTI_BT_STACK := true +TARGET_FWK_SUPPORTS_FULL_VALUEADDS := true # Bootloader TARGET_BOOTLOADER_BOARD_NAME := sdm660 diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h index 2a3f2e9d..ee3141bc 100644 --- a/bluetooth/bdroid_buildcfg.h +++ b/bluetooth/bdroid_buildcfg.h @@ -1,5 +1,4 @@ /* - * * Copyright (c) 2013, The Linux Foundation. All rights reserved. * Not a Contribution, Apache license notifications and license are retained * for attribution purposes only. @@ -18,36 +17,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #ifndef _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H - -#include -#pragma push_macro("PROPERTY_VALUE_MAX") - -#include -#include - -static inline const char* BtmGetDefaultName() -{ - char product_model[PROPERTY_VALUE_MAX]; - property_get("ro.product.model", product_model, ""); - - if (strstr(product_model, "Mi A2")) - return "Mi A2"; - if (strstr(product_model, "MI 6X")) - return "MI 6X"; - if (strstr(product_model, "MI PAD 4")) - return "MI PAD 4"; - if (strstr(product_model, "MI PAD 4 PLUS")) - return "MI PAD 4 PLUS"; - - // Fallback to ro.product.model - return ""; -} -#undef PROPERTY_VALUE_MAX - -#define BTM_DEF_LOCAL_NAME BtmGetDefaultName() #define BLUETOOTH_QTI_SW TRUE // Disables read remote device feature #define MAX_ACL_CONNECTIONS 16 @@ -56,8 +27,5 @@ static inline const char* BtmGetDefaultName() #define GATT_MAX_PHY_CHANNEL 10 // skips conn update at conn completion #define BT_CLEAN_TURN_ON_DISABLED 1 - #define AVDT_NUM_SEPS 35 -#pragma pop_macro("PROPERTY_VALUE_MAX") - #endif diff --git a/common_prop.mk b/common_prop.mk index 87138f44..28117fbf 100644 --- a/common_prop.mk +++ b/common_prop.mk @@ -61,7 +61,6 @@ PRODUCT_PROPERTY_OVERRIDES += \ # Audio Feature PRODUCT_PROPERTY_OVERRIDES += \ - vendor.audio.feature.a2dp_offload.enable=false \ vendor.audio.feature.afe_proxy.enable=true \ vendor.audio.feature.anc_headset.enable=true \ vendor.audio.feature.audiozoom.enable=false \ @@ -113,15 +112,19 @@ endif # Bluetooth PRODUCT_PROPERTY_OVERRIDES += \ - persist.bluetooth.a2dp_offload.disabled=false \ - persist.bluetooth.bluetooth_audio_hal.disabled=false \ - persist.vendor.bt.a2dp_offload_cap=sbc-aac-aptx-aptxhd-ldac \ persist.vendor.bt.aac_frm_ctl.enabled=true \ - persist.vendor.qcom.bluetooth.enable.splita2dp=false \ + persist.bluetooth.bluetooth_audio_hal.disabled=false \ ro.vendor.bluetooth.wipower=false \ vendor.qcom.bluetooth.soc=cherokee PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + persist.vendor.bt.a2dp.aac_whitelist=false \ + persist.vendor.qcom.bluetooth.enable.splita2dp=true \ + persist.vendor.qcom.bluetooth.a2dp_offload_cap=sbc-aptx-aptxhd-aac-ldac \ + persist.bluetooth.a2dp_offload.disabled=false \ + ro.bluetooth.library_name=libbluetooth_qti.so \ + ro.bluetooth.a2dp_offload.supported=true \ + vendor.audio.feature.a2dp_offload.enable=true \ vendor.bluetooth.soc=cherokee # Camera diff --git a/configs/audio/audio_policy_configuration.xml b/configs/audio/audio_policy_configuration.xml index 6576c4af..5d17227b 100644 --- a/configs/audio/audio_policy_configuration.xml +++ b/configs/audio/audio_policy_configuration.xml @@ -3,27 +3,20 @@ Not a Contribution. --> - - - - + @@ -134,7 +127,9 @@ - + @@ -160,12 +155,21 @@ - + + + + + + - @@ -234,7 +237,21 @@ - + + + + + + + + + - @@ -295,33 +311,32 @@ + sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/> + + + + + - - - - - - - - - - - diff --git a/configs/audio/audio_policy_configuration_a2dp_offload_disabled.xml b/configs/audio/audio_policy_configuration_a2dp_offload_disabled.xml index b239564e..8267e656 100644 --- a/configs/audio/audio_policy_configuration_a2dp_offload_disabled.xml +++ b/configs/audio/audio_policy_configuration_a2dp_offload_disabled.xml @@ -3,27 +3,20 @@ Not a Contribution. --> - - - - @@ -241,15 +237,6 @@ - - - - - - - - - - - - @@ -309,83 +291,36 @@ sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx"/> - - + sources="Wired Headset Mic,BT SCO Headset Mic,FM Tuner,Telephony Rx"/> + sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic"/> - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + - - - - - diff --git a/configs/audio/audio_policy_configuration_a2dp_offload_disabled_qti.xml b/configs/audio/audio_policy_configuration_a2dp_offload_disabled_qti.xml new file mode 100644 index 00000000..05ca591d --- /dev/null +++ b/configs/audio/audio_policy_configuration_a2dp_offload_disabled_qti.xml @@ -0,0 +1,326 @@ + + + + + + + + + + + + + Earpiece + Speaker + Telephony Tx + Built-In Mic + Built-In Back Mic + FM Tuner + Telephony Rx + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/audio/bluetooth_qti_audio_policy_configuration.xml b/configs/audio/bluetooth_qti_audio_policy_configuration.xml new file mode 100644 index 00000000..f0b25062 --- /dev/null +++ b/configs/audio/bluetooth_qti_audio_policy_configuration.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manifest.xml b/manifest.xml index 2222692e..8fda5d79 100755 --- a/manifest.xml +++ b/manifest.xml @@ -80,6 +80,15 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. default + + vendor.qti.hardware.bluetooth_audio + hwbinder + 2.0 + + IBluetoothAudioProvidersFactory + default + + android.hardware.camera.provider hwbinder diff --git a/overlay-system/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml b/overlay-system/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml new file mode 100644 index 00000000..027ac613 --- /dev/null +++ b/overlay-system/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml @@ -0,0 +1,35 @@ + + + + true + false + diff --git a/overlay/packages/apps/Bluetooth/res/values/config.xml b/overlay/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml similarity index 97% rename from overlay/packages/apps/Bluetooth/res/values/config.xml rename to overlay/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml index 9624f83f..75ee104d 100755 --- a/overlay/packages/apps/Bluetooth/res/values/config.xml +++ b/overlay/vendor/qcom/opensource/commonsys/packages/apps/Bluetooth/res/values/config.xml @@ -32,6 +32,7 @@ true - false true + false + true diff --git a/proprietary-files.txt b/proprietary-files.txt index be7b49f8..d2bfe5ca 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -103,10 +103,20 @@ vendor/lib64/soundfx/libqcvirt.so|7b11552f1100a6b6146865ceba853d331946b913 # Bluetooth (aptX) - from jasmine-user-10-QKQ1.190910.002-V11.0.4.0.QDIMIXM product/lib64/libaptX_encoder.so|df1c89d7af1bb35808d5fe3496b04ba066c10cbc product/lib64/libaptXHD_encoder.so|e13fa70c97caaa24d061678bdee608eb8850a69e +vendor/lib/rfsa/adsp/capi_v2_aptX_Classic.so|8305c614ebf13f84f15989631b8fdfdb9828d9be +vendor/lib/rfsa/adsp/capi_v2_aptX_HD.so|eb0e912d25b06f977d5a89345c72d142b7ffb8ae + +# QTI-Bluetooth (Audio) - from LA.UM.8.2.r1-06700-sdm660.0 +vendor/lib/btaudio_offload_if.so|5b1c1d81aeaa39923b28196c84aa2269d318fcd6 +vendor/lib/hw/audio.bluetooth_qti.default.so|bbf5bed40ab75e0feed0753a40743dbf6979dfb9 +vendor/lib/hw/vendor.qti.hardware.bluetooth_audio@2.0-impl.so|87df9077916c6b9d4668c2156da165492a393386 +vendor/lib/libbluetooth_audio_session_qti.so|dcd45e11d85eb605b5f516961f88bf8b0a80c0eb +vendor/lib64/btaudio_offload_if.so|f9d7229e818a3044d56739d9d47462c4af726c02 +vendor/lib64/hw/audio.bluetooth_qti.default.so|102539a0013edf06790215b21bed68c704437a96 +vendor/lib64/hw/vendor.qti.hardware.bluetooth_audio@2.0-impl.so|93f09e7ee848e2d6fee7f0810ad8a3e57346b72c +vendor/lib64/libbluetooth_audio_session_qti.so|c2b100d5fbce3d219515f8c359c6990a08e9fa94 # Bluetooth - from LA.UM.8.2.r1-06700-sdm660.0 -lib/libbtconfigstore.so|b2765f77529c6bbad6eafc1e8b358ad9ce20d992 -lib64/libbtconfigstore.so|abbfd1a5e773fba69dccb3121861ef3fec2cdab9 vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti|5acf94f38e47c2ec43c95e132dfe7b5d71ec41c4 vendor/etc/init/android.hardware.bluetooth@1.0-service-qti.rc|a979981c55f3dcaf6cf2212e71b901ca4d58b959 vendor/lib/hw/android.hardware.bluetooth@1.0-impl-qti.so|cbf94b0e8de6a10c35d1d2e0d9537cad20b16f80 @@ -115,14 +125,12 @@ vendor/lib/hw/vendor.qti.hardware.btconfigstore@1.0-impl.so|10bddb86ecd1c7e0b0d4 vendor/lib/libbt-hidlclient.so|826a5101e2c36d7877bc924b53e22cd00bec6dd6 vendor/lib/libbtnv.so|a1b994bac9b746f51036fc829310cec4f773c621 vendor/lib/vendor.qti.hardware.bluetooth_sar@1.0.so|5d204b6e003932069782774dbae4f5f209848870 -vendor/lib/vendor.qti.hardware.btconfigstore@1.0.so|bd7fe72bf679acb93dd2945e8905ef0942f0fbb1 vendor/lib64/hw/android.hardware.bluetooth@1.0-impl-qti.so|d186d72139e0bfbb05d99125b777547950a454ca vendor/lib64/hw/vendor.qti.hardware.bluetooth_sar@1.0-impl.so|ebdfcc7064fc144acf6cba300486c6394af3d73b vendor/lib64/hw/vendor.qti.hardware.btconfigstore@1.0-impl.so|5e06b7b33d084975d6326875268cb237ad6d8559 vendor/lib64/libbt-hidlclient.so|0a0d0ac4e2f4e2e80f4ec488b53c18c96ff08dc6 vendor/lib64/libbtnv.so|a6793a7b93fa607fcec39da7479566f84ed39aa4 vendor/lib64/vendor.qti.hardware.bluetooth_sar@1.0.so|9b7ae20ce9d6d2a67fdac94268cec441278cca3d -vendor/lib64/vendor.qti.hardware.btconfigstore@1.0.so|e08969ef1897ec5958894323f7d6e730a1d7ce25 # Charger - from LA.UM.8.2.r1-06700-sdm660.0 vendor/bin/hvdcp_opti|31fe37f97728d257fdb8d34ba7bec6b308879bd5 @@ -196,8 +204,6 @@ vendor/etc/cne/wqeclient/VZW/VZW_profile6.xml|14d136e7fcc682311757d3edc0b9d3eaeb vendor/lib/soundfx/libdirac.so|f63826a905b520fa524e4c1b147be7cf65240953 vendor/lib/libDiracAPI_SHARED.so|42b49679d38eca93fead05ea06ddbdc8108fd4b1 vendor/etc/diracmobile.config|d781cd6798a7481a8f7128d144abfb2b8794212d -vendor/lib/rfsa/adsp/capi_v2_aptX_Classic.so|8305c614ebf13f84f15989631b8fdfdb9828d9be -vendor/lib/rfsa/adsp/capi_v2_aptX_HD.so|eb0e912d25b06f977d5a89345c72d142b7ffb8ae vendor/lib/rfsa/adsp/dirac_resource.dar|7728d5b2ee2927a01df5bd6d7edae3736186c844 vendor/lib/rfsa/adsp/libdirac-capiv2.so|e56031dfaee094d5267e3cc16625cfceaa07cc27 diff --git a/sdm660.mk b/sdm660.mk index 18c1d3ed..8f9d679f 100644 --- a/sdm660.mk +++ b/sdm660.mk @@ -99,14 +99,16 @@ PRODUCT_PACKAGES += \ libqcomvisualizer \ libqcomvoiceprocessing \ libvolumelistener \ - tinymix.vendor + tinymix # Audio Configs PRODUCT_COPY_FILES += \ $(COMMON_PATH)/configs/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \ $(COMMON_PATH)/configs/audio/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \ - $(COMMON_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ - $(COMMON_PATH)/configs/audio/audio_policy_configuration_a2dp_offload_disabled.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration_a2dp_offload_disabled.xml \ + $(COMMON_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/audio_policy_configuration.xml \ + $(COMMON_PATH)/configs/audio/audio_policy_configuration_a2dp_offload_disabled.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + $(COMMON_PATH)/configs/audio/audio_policy_configuration_a2dp_offload_disabled_qti.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/audio_policy_configuration_a2dp_offload_disabled.xml \ + $(COMMON_PATH)/configs/audio/bluetooth_qti_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_qti_audio_policy_configuration.xml \ $(COMMON_PATH)/configs/audio/audio_tuning_mixer.txt:$(TARGET_COPY_OUT_VENDOR)/etc/audio_tuning_mixer.txt \ $(COMMON_PATH)/configs/audio/graphite_ipc_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/graphite_ipc_platform_info.xml \ $(COMMON_PATH)/configs/audio/listen_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/listen_platform_info.xml \ @@ -143,15 +145,18 @@ PRODUCT_PACKAGES += \ # Bluetooth PRODUCT_PACKAGES += \ + BluetoothQti \ audio.bluetooth.default \ android.hardware.bluetooth.audio@2.0-impl \ liba2dpoffload \ + libbtconfigstore \ libbthost_if \ libhdmiedid \ libhfp \ libldacBT_dec \ libsndmonitor \ - vendor.qti.hardware.bluetooth_audio@2.0.vendor + vendor.qti.hardware.bluetooth_audio@2.0.vendor \ + vendor.qti.hardware.btconfigstore@1.0.vendor # Boot animation TARGET_BOOTANIMATION_SIZE := 1080p @@ -393,7 +398,8 @@ PRODUCT_PACKAGES += \ # Overlays DEVICE_PACKAGE_OVERLAYS += \ $(COMMON_PATH)/overlay \ - $(COMMON_PATH)/overlay-lineage + $(COMMON_PATH)/overlay-lineage \ + $(COMMON_PATH)/overlay-system # Permissions PRODUCT_COPY_FILES += \