From 33a0dac7d73ba2925687751b615a74862f230e23 Mon Sep 17 00:00:00 2001
From: Andy Hung <hunga@google.com>
Date: Fri, 16 Dec 2022 13:46:36 -0800
Subject: [PATCH] Spatializer: Add tuning to reduce glitches and power.

Test: Instrumented
Test: adb shell 'uclampset -a -p $(pgrep -of android.hardware.audio.service)'
Bug: 261228892
Bug: 261686532
Bug: 262803152
Change-Id: I630da2a4a60e44c4fd045f1685481803ce258e83
---
 device-cheetah.mk | 4 ++++
 device-panther.mk | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/device-cheetah.mk b/device-cheetah.mk
index 8ab67d78..89e68fb3 100644
--- a/device-cheetah.mk
+++ b/device-cheetah.mk
@@ -188,6 +188,10 @@ PRODUCT_PACKAGES_DEBUG += \
 PRODUCT_PROPERTY_OVERRIDES += \
        ro.audio.spatializer_enabled=true
 
+# optimize spatializer effect
+PRODUCT_PROPERTY_OVERRIDES += \
+       audio.spatializer.effect.util_clamp_min=300
+
 # Keymaster HAL
 #LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service
 
diff --git a/device-panther.mk b/device-panther.mk
index 998d6e78..7b5b4f86 100644
--- a/device-panther.mk
+++ b/device-panther.mk
@@ -169,6 +169,10 @@ PRODUCT_PACKAGES_DEBUG += \
 PRODUCT_PROPERTY_OVERRIDES += \
        ro.audio.spatializer_enabled=true
 
+# optimize spatializer effect
+PRODUCT_PROPERTY_OVERRIDES += \
+       audio.spatializer.effect.util_clamp_min=300
+
 # Keymaster HAL
 #LOCAL_KEYMASTER_PRODUCT_PACKAGE ?= android.hardware.keymaster@4.1-service
 
-- 
GitLab