From 66cc06b0a9e4de8489b4bd93f68b0d3d9f51ee0a Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Thu, 2 Dec 2021 09:52:32 +0000 Subject: [PATCH] Disable soundvolume effect on Xiaomi Mi 11 Lite 5G Fixes audio distorsion on this device and may fix on other Qualcomm devices --- phh-prop-handler.sh | 16 ++++++++++++++++ vndk.rc | 3 +++ 2 files changed, 19 insertions(+) diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh index a6c9765..8b65a68 100644 --- a/phh-prop-handler.sh +++ b/phh-prop-handler.sh @@ -184,3 +184,19 @@ if [ "$1" == "persist.sys.phh.backlight.scale" ];then fi exit fi + +if [ "$1" == "persist.sys.phh.disable_soundvolume_effect" ];then + if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then + exit 1 + fi + + if [[ "$prop_value" == 1 ]];then + mount /system/phh/empty /vendor/lib/soundfx/libvolumelistener.so + mount /system/phh/empty /vendor/lib64/soundfx/libvolumelistener.so + else + umount /vendor/lib/soundfx/libvolumelistener.so + umount /vendor/lib64/soundfx/libvolumelistener.so + fi + restartAudio + exit +fi diff --git a/vndk.rc b/vndk.rc index 4adfe9e..d7cc703 100644 --- a/vndk.rc +++ b/vndk.rc @@ -47,6 +47,9 @@ on property:persist.sys.phh.vsmart.dt2w=* on property:persist.sys.phh.backlight.scale=* exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.backlight.scale" +on property:persist.sys.phh.disable_soundvolume_effect=* + exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.disable_soundvolume_effect" + on property:ro.sf.lcd_density=* restart surfaceflinger