From 963ddb3eb3430468f3a6409b1ef6eaa5ffc4a607 Mon Sep 17 00:00:00 2001 From: yzyhk904 <86816519+yzyhk904@users.noreply.github.com> Date: Sun, 28 Jul 2024 15:31:10 +0900 Subject: [PATCH] Add files via upload * Added disabling Dolby control support for USB DAC's on HyperOS not to reboot * Excluded "MotorolaSettingsProvider" on Motorala devices only for avoiding their bootloop * Changed the USB period_us from 2250 usec to 2000 usec to optimize for 48 kHz Opus tracks (recent majority) --- README.md | 6 +++--- changelog.md | 5 +++++ customize-functions.sh | 45 +++++++++++++++++++++--------------------- customize.sh | 26 +++++++++++++++++++----- module.prop | 4 ++-- service.sh | 15 ++++++++++++++ system.prop | 6 ++++-- system.prop-workaround | 6 ++++-- 8 files changed, 76 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 20e69d3..d11d55f 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ This module, | External examples: | - | - | - | - | | 100 | 29 | (91) | 109 | AK4493 (Sharp roll-off N-fold over-sampling) | | 150 | 42 | (91) | 109 | AK4191EQ (Sharp roll-off N-fold over-sampling) | - | 120 | 35 | (97) | 110 | ESS 9038PRO (Fast roll-off N-fold over-sampling) | - | 50 ~ 118 | 34 | 96 | (398) | ESS 9039PRO (Fast roll-off N-fold over-sampling) | - | 110 | 40 | (96) | 109 | CX43131 (Fast roll-off N-fold over-sampling) | + | 120 | 35 | (97) | 110 | ES9038PRO (Fast roll-off N-fold over-sampling) | + | vary 50 ~ 118 | 34 | 96 | (398) | ES9039PRO (Fast roll-off N-fold over-sampling) | + | 110 | 40 | (96) | 109 | CS43131 (Fast roll-off N-fold over-sampling) | | 98 | 130 | 98.5 | | MacOS Leopard (guess) | | 159 | 240 | | 99 | iZotope, No-Alias (guess) | | 100 | 64 | | 99 | SoX HQ linear phase (guess) | diff --git a/changelog.md b/changelog.md index 469583f..668a04e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ ## Change logs +# v1.3.8 +* Added disabling Dolby control support for USB DAC's on HyperOS not to reboot +* Excluded "MotorolaSettingsProvider" on Motorala devices only for avoiding their bootloop +* Changed the USB period_us from 2250 usec to 2000 usec to optimize for 48 kHz Opus tracks (recent majority) + # v1.3.7 * Added "compatible Magisk-mirroring" message for incompatible Magisk variants * Adjusted re-sampling parameters for old devices diff --git a/customize-functions.sh b/customize-functions.sh index 5f1f5fd..3792772 100644 --- a/customize-functions.sh +++ b/customize-functions.sh @@ -234,10 +234,9 @@ function replaceSystemProps_S4() "$MODPATH/system.prop-workaround" } -function replaceSystemProps_kona() +function replaceSystemProps_Kona() { - if [ ! "`getprop ro.vendor.build.version.release_or_codename`" -ge "12" -a \ - \( -e "${MODPATH%/*/*}/modules/usb-samplerate-unlocker" -o -e "${MODPATH%/*/*}/modules_update/usb-samplerate-unlocker" \) ]; then + if [ -e "${MODPATH%/*/*}/modules/usb-samplerate-unlocker" -o -e "${MODPATH%/*/*}/modules_update/usb-samplerate-unlocker" ]; then sed -i \ -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2750/' \ -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2750/' \ @@ -251,12 +250,12 @@ function replaceSystemProps_kona() else sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop" sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop-workaround" fi @@ -265,12 +264,12 @@ function replaceSystemProps_kona() function replaceSystemProps_SDM845() { sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop" sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop-workaround" } @@ -283,24 +282,24 @@ function replaceSystemProps_SDM() function replaceSystemProps_MTK_Dimensity() { sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop" sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop-workaround" } function replaceSystemProps_Tensor() { sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop" sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop-workaround" } @@ -308,12 +307,12 @@ function replaceSystemProps_Others() { if [ -e "${MODPATH%/*/*}/modules/usb-samplerate-unlocker" -o -e "${MODPATH%/*/*}/modules_update/usb-samplerate-unlocker" ]; then sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop" sed -i \ - -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2250/' \ - -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2250/' \ + -e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2000/' \ + -e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2000/' \ "$MODPATH/system.prop-workaround" loosenedMessage diff --git a/customize.sh b/customize.sh index 3cdfe97..66dfb8e 100644 --- a/customize.sh +++ b/customize.sh @@ -9,20 +9,34 @@ if ! isMagiskMountCompatible; then Aborted by no Magisk-mirrors: try again either a.) with official Magisk (mounting mirrors), or - b.) after installing "Compatible Magisk-mirroring" Magisk module + b.) after installing "Compatible Magisk-mirroring" Magisk module and rebooting ***' fi REPLACE="" -# making patched ALSA utility and Tensor's offload libraries for "ro.audio.usb.period_us" +# Make patched ALSA utility and Tensor's offload libraries for "ro.audio.usb.period_us" makeLibraries -# removing post-A13 (especially Tensor's) spatial audio flags in an audio configuration file for avoiding errors +# Remove post-A13 (especially Tensor's) spatial audio flags in an audio configuration file for avoiding errors deSpatializeAudioPolicyConfig "/vendor/etc/bluetooth_audio_policy_configuration_7_0.xml" -# disabling pre-installed Moto Dolby faetures and Wellbeing for reducing very large jitter caused by them -disablePrivApps " +# Disable pre-installed Moto Dolby faetures and Wellbeing for reducing very large jitter caused by them +# Excluded "MotorolaSettingsProvider" on Motorala devices only for avoiding their bootloop +if [ "`getprop ro.product.manufacturer`" = "Motorola" ]; then + disablePrivApps " +/system_ext/priv-app/MotoDolbyDax3 +/system_ext/priv-app/daxService +/system_ext/priv-app/DaxUI +/system_ext/app/MotoSignatureApp +/product/priv-app/WellbeingPrebuilt +/product/priv-app/Wellbeing +/system_ext/priv-app/WellbeingPrebuilt +/system_ext/priv-app/Wellbeing +" + +else + disablePrivApps " /system_ext/priv-app/MotoDolbyDax3 /system_ext/priv-app/MotorolaSettingsProvider /system_ext/priv-app/daxService @@ -34,6 +48,8 @@ disablePrivApps " /system_ext/priv-app/Wellbeing " +fi + if "$IS64BIT"; then board="`getprop ro.board.platform`" case "$board" in diff --git a/module.prop b/module.prop index e7d1eff..888b8aa 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=audio-misc-settings name=Audio misc. settings -version=v1.3.7 -versionCode=1307 +version=v1.3.8 +versionCode=1308 author=zyhk description=Setting audio misc. configuration values (e.g. 100 volume steps, raising the resampling quality, disabling the effects framework, etc.) diff --git a/service.sh b/service.sh index a2eeeb9..fc26fd0 100644 --- a/service.sh +++ b/service.sh @@ -65,6 +65,21 @@ function additionalSettings() fi fi + + # Force disabling spatializer if OS reverted the spatializer setting during the booting process + if [ "`getprop ro.audio.spatializer_enabled`" = "true" ]; then + resetprop_command="`which_resetprop_command`" + if [ -n "$resetprop_command" ]; then + # Workaround for recent Pixel Firmwares (not to reboot when resetprop'ing) + "$resetprop_command" --delete ro.audio.spatializer_enabled 1>"/dev/null" 2>&1 + # End of workaround + "$resetprop_command" ro.audio.spatializer_enabled false + force_restart_server=1 + else + return 1 + fi + fi + if [ "$force_restart_server" = "1" -o "`getprop ro.system.build.version.release`" -ge "12" ]; then if [ -n "`getprop init.svc.audioserver`" ]; then diff --git a/system.prop b/system.prop index be2e080..e6d9714 100644 --- a/system.prop +++ b/system.prop @@ -2,8 +2,10 @@ ro.config.media_vol_steps=100 audio.safemedia.bypass=true ro.audio.ignore_effects=true ro.audio.spatializer_enabled=false -vendor.audio.usb.perio=2250 -vendor.audio.usb.out.period_us=2250 +ro.vendor.audio.dolby.dax.support=false +vendor.audio.dolby.control.support=false +vendor.audio.usb.perio=2000 +vendor.audio.usb.out.period_us=2000 vendor.audio.usb.out.period_count=2 vendor.audio_hal.period_size=120 vendor.audio_hal.period_multiplier=1 diff --git a/system.prop-workaround b/system.prop-workaround index 78a8a5d..6ed8a38 100644 --- a/system.prop-workaround +++ b/system.prop-workaround @@ -2,8 +2,10 @@ ro.config.media_vol_steps=100 audio.safemedia.bypass=true ro.audio.ignore_effects=true ro.audio.spatializer_enabled=false -vendor.audio.usb.perio=2250 -vendor.audio.usb.out.period_us=2250 +ro.vendor.audio.dolby.dax.support=false +vendor.audio.dolby.control.support=false +vendor.audio.usb.perio=2000 +vendor.audio.usb.out.period_us=2000 vendor.audio.usb.out.period_count=2 vendor.audio_hal.period_size=120 vendor.audio_hal.period_multiplier=1