diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 54f2d00..aeeb495 100755 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -63,41 +63,10 @@ TARGET_BOARD_PLATFORM_GPU := qcom-adreno530 BOARD_ANT_WIRELESS_DEVICE := "qualcomm-hidl" # Audio -AUDIO_FEATURE_ENABLED_A2DP_OFFLOAD := true -AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true -AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true -AUDIO_FEATURE_ENABLED_ANC_HEADSET := true -AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true -AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true -AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true -AUDIO_FEATURE_ENABLED_DEV_ARBI := true -AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := false -AUDIO_FEATURE_ENABLED_DTS_EAGLE := false -AUDIO_FEATURE_ENABLED_DYNAMIC_ECNS := false -AUDIO_FEATURE_ENABLED_EXTENDED_COMPRESS_FORMAT := true -AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true -AUDIO_FEATURE_ENABLED_FFV := false -AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true -AUDIO_FEATURE_ENABLED_FLUENCE := true -AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false -AUDIO_FEATURE_ENABLED_KEEP_ALIVE_ARM_FFV := false -AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true -AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true -AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true -AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true -AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true +AUDIO_FEATURE_ENABLED_INSTANCE_ID := true AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true -AUDIO_FEATURE_ENABLED_RECORD_PLAY_CONCURRENCY := true -AUDIO_FEATURE_ENABLED_SND_MONITOR := true -AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true -AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY :=true -AUDIO_FEATURE_ENABLED_VORBIS_OFFLOAD := true -AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true -BOARD_SUPPORTS_SOUND_TRIGGER := false -BOARD_USES_ALSA_AUDIO := true USE_CUSTOM_AUDIO_POLICY := 1 -USE_XML_AUDIO_POLICY_CONF := 1 # Bluetooth BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(COMMON_PATH)/bluetooth @@ -209,7 +178,8 @@ SELINUX_IGNORE_NEVERALLOWS := true # Shims TARGET_LD_SHIM_LIBS := \ /vendor/lib/libbauthserver.so|libbauthtzcommon_shim.so \ - /vendor/lib64/libbauthserver.so|libbauthtzcommon_shim.so + /vendor/lib64/libbauthserver.so|libbauthtzcommon_shim.so \ + /vendor/lib/hw/audio.primary.msm8996.so|libaudioprimary_shim.so # Wifi BOARD_HAVE_SAMSUNG_WIFI := true diff --git a/audio/audio/audio_policy_configuration.xml b/audio/audio/audio_policy_configuration.xml new file mode 100644 index 0000000..f1f7ef6 --- /dev/null +++ b/audio/audio/audio_policy_configuration.xml @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + Earpiece + Speaker + + Built-In Mic + Built-In Back Mic + FM Tuner + + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio/audio_platform_info.xml b/audio/audio_platform_info.xml index 395a126..203b3dc 100644 --- a/audio/audio_platform_info.xml +++ b/audio/audio_platform_info.xml @@ -47,7 +47,6 @@ - diff --git a/audio/audio_platform_info_diff.xml b/audio/audio_platform_info_diff.xml index 0276541..fe60775 100644 --- a/audio/audio_platform_info_diff.xml +++ b/audio/audio_platform_info_diff.xml @@ -27,6 +27,7 @@ + diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml index 9b0234b..8d12a8b 100644 --- a/audio/audio_policy_configuration.xml +++ b/audio/audio_policy_configuration.xml @@ -49,22 +49,14 @@ - Earpiece Speaker - Telephony Tx Built-In Mic Built-In Back Mic - FM Tuner - Telephony Rx Speaker - - - - + @@ -73,32 +65,11 @@ - - - - - - - - @@ -108,15 +79,6 @@ - - - @@ -129,48 +91,25 @@ + samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_OUT_MONO"/> - - - - - + - - - - - - - - + samplingRates="8000,16000" channelMasks="AUDIO_CHANNEL_IN_MONO"/> - - + @@ -182,10 +121,6 @@ - - - @@ -198,27 +133,6 @@ - - - - - - - - - - - - - - - - - - - - - - + sources="primary output,deep_buffer,BT SCO Headset Mic"/> + sources="primary output,deep_buffer,compressed_offload,BT SCO Headset Mic"/> + sources="primary output,deep_buffer,compressed_offload,BT SCO Headset Mic"/> - - - - - - + sources="primary output,deep_buffer,compressed_offload,BT SCO Headset Mic"/> - - - + sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic"/> - + - + - + - - + + diff --git a/gts3l.mk b/gts3l.mk index be7a52b..de49a33 100755 --- a/gts3l.mk +++ b/gts3l.mk @@ -83,16 +83,16 @@ PRODUCT_PACKAGES += \ # Audio PRODUCT_PACKAGES += \ - android.hardware.audio@6.0 \ - android.hardware.audio@6.0-impl \ - android.hardware.audio.common@6.0 \ - android.hardware.audio.common@6.0-util \ - android.hardware.audio.effect@6.0 \ - android.hardware.audio.effect@6.0-impl \ + android.hardware.audio@2.0-impl \ + android.hardware.audio@4.0-impl \ + android.hardware.audio.effect@2.0-impl \ + android.hardware.audio.effect@4.0-impl \ android.hardware.audio.service \ android.hardware.bluetooth.audio@2.0-impl \ + android.hardware.soundtrigger@2.0-impl:32 \ + android.hardware.soundtrigger@2.1-impl \ audio.bluetooth.default \ - audio.primary.msm8996 \ + audio.primary.msm8996:32 \ audio.r_submix.default \ audio.usb.default \ libaacwrapper \ @@ -102,19 +102,18 @@ PRODUCT_PACKAGES += \ libqcomvisualizer \ libqcomvoiceprocessing \ libvolumelistener \ - tinymix + tinymix \ + libaudioprimary_shim PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/audio/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/audio_policy_configuration.xml \ $(LOCAL_PATH)/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \ $(LOCAL_PATH)/audio/audio_tuning_mixer.txt:$(TARGET_COPY_OUT_VENDOR)/etc/audio_tuning_mixer.txt \ $(LOCAL_PATH)/audio/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \ $(LOCAL_PATH)/audio/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \ $(LOCAL_PATH)/audio/audio_platform_info_diff.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_diff.xml \ - $(LOCAL_PATH)/audio/audio_platform_info_i2s.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_i2s.xml \ $(LOCAL_PATH)/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ - $(LOCAL_PATH)/audio/listen_platform_info.xml:system/etc/listen_platform_info.xml \ - $(LOCAL_PATH)/audio/mixer_paths_tasha.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_tasha.xml \ - $(LOCAL_PATH)/audio/mixer_paths_i2s.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_i2s.xml + $(LOCAL_PATH)/audio/mixer_paths_tasha.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_tasha.xml PRODUCT_COPY_FILES += \ frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \ diff --git a/manifest.xml b/manifest.xml index 2f76bd6..e0c39ae 100644 --- a/manifest.xml +++ b/manifest.xml @@ -2,7 +2,7 @@ android.hardware.audio hwbinder - 6.0 + 4.0 IDevicesFactory default @@ -11,7 +11,7 @@ android.hardware.audio.effect hwbinder - 6.0 + 4.0 IEffectsFactory default diff --git a/proprietary-files.txt b/proprietary-files.txt index 7d35abd..3143c45 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -18,6 +18,16 @@ vendor/lib/hw/com.qualcomm.qti.ant@1.0-impl.so vendor/lib64/hw/com.qualcomm.qti.ant@1.0-impl.so # Audio +lib/librecordalive.so +lib/libSamsungPostProcess.so +lib/libSamsungPostProcessConvertor.so +lib/libsamsungVoipResampler.so +lib/lib_SamsungRec_06002.so +lib/lib_SoundAlive_SRC384_ver320.so +lib/lib_soundaliveresampler.so +lib/lib_SoundBooster_ver_Quad_710.so +vendor/etc/SoundBoosterParam.txt +vendor/lib/hw/audio.primary.msm8996.so vendor/lib/libacdb-fts.so vendor/lib/libacdbloader.so vendor/lib/libacdbrtac.so @@ -28,6 +38,8 @@ vendor/lib/libaudioalsa.so vendor/lib/libaudio_log_utils.so vendor/lib/libaudio_soundtrigger.so vendor/lib/libqtigef.so +vendor/lib/libsamsungSoundbooster_plus.so +vendor/lib/libsecaudioinfo.so vendor/lib/libsurround_3mic_proc.so vendor/lib/libtinycompress_vendor.so vendor/lib64/libacdb-fts.so diff --git a/shims/libaudioprimary/Android.mk b/shims/libaudioprimary/Android.mk new file mode 100644 index 0000000..4120dd6 --- /dev/null +++ b/shims/libaudioprimary/Android.mk @@ -0,0 +1,28 @@ +# Copyright (C) 2021 Deokgyu Yang +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + libaudioprimary.c + +LOCAL_SHARED_LIBRARIES := liblog + +LOCAL_MODULE := libaudioprimary_shim +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES + +include $(BUILD_SHARED_LIBRARY) diff --git a/shims/libaudioprimary/libaudioprimary.c b/shims/libaudioprimary/libaudioprimary.c new file mode 100644 index 0000000..29ee581 --- /dev/null +++ b/shims/libaudioprimary/libaudioprimary.c @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2021 Deokgyu Yang + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "libaudioprimary_shim" +#define LOG_NDEBUG 0 + +#include + +void direct_mixer_set_value(int arg0, int arg1) +{ + ALOGW("SHIM: hijacking %s!", __func__); + + /* + * This function is supposed to invoke the `mixer_ctl_set_value` + * function directly by some libraries. + * But no libraries from AOSP call this function. + */ +} diff --git a/system.prop b/system.prop index 011f16f..67ecba1 100755 --- a/system.prop +++ b/system.prop @@ -1,41 +1,31 @@ # Audio af.fast_track_multiplier=1 -audio.offload.video=true audio.deep_buffer.media=true -ro.af.client_heap_size_kbyte=7168 -ro.audio.monitorRotation=true -ro.config.media_vol_steps=25 -ro.vendor.audio.sdk.fluencetype=none -ro.vendor.audio.sdk.ssr=false +audio.offload.video=true +persist.vendor.audio.fluence.speaker=true persist.vendor.audio.fluence.voicecall=true persist.vendor.audio.fluence.voicerec=false -persist.vendor.audio.fluence.speaker=true persist.vendor.audio.hw.binder.size_kbyte=1024 -vendor.audio.feature.a2dp_offload.enable=true -vendor.audio.feature.anc_headset.enable=true -vendor.audio.feature.afe_proxy.enable=true -vendor.audio.feature.custom_stereo.enable=true -vendor.audio.feature.kpi_optimize.enable=true -vendor.audio.feature.maxx_audio.enable=false -vendor.audio.feature.multi_voice_session.enable=true -vendor.audio.feature.record_play_concurency.enable=false -vendor.audio.feature.snd_mon.enable=true -vendor.audio_hal.period_size=192 -vendor.audio.tunnel.encode=false -vendor.audio.offload.buffer.size.kb=64 -vendor.audio.offload.track.enable=true -vendor.audio.offload.multiaac.enable=true +ro.af.client_heap_size_kbyte=7168 +ro.config.media_vol_steps=25 +ro.config.vc_call_vol_steps=5 +ro.vendor.audio.sdk.fluencetype=none +ro.vendor.audio.sdk.ssr=false vendor.audio.dolby.ds2.enabled=false vendor.audio.dolby.ds2.hardbypass=false +vendor.audio.flac.sw.decoder.24bit=true +vendor.audio_hal.period_size=192 +vendor.audio.hw.aac.encoder=true +vendor.audio.offload.buffer.size.kb=64 +vendor.audio.offload.gapless.enabled=true +vendor.audio.offload.multiaac.enable=true vendor.audio.offload.multiple.enabled=false vendor.audio.offload.passthrough=false -vendor.audio.offload.gapless.enabled=true -vendor.audio.safx.pbe.enabled=true +vendor.audio.offload.track.enable=true vendor.audio.parser.ip.buffer.size=262144 -vendor.audio.hw.aac.encoder=true +vendor.audio.safx.pbe.enabled=true +vendor.audio.tunnel.encode=false vendor.audio.use.sw.alac.decoder=true -vendor.audio.use.sw.ape.decoder=true -vendor.audio.flac.sw.decoder.24bit=true vendor.voice.path.for.pcm.voip=true # Bluetooth