Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Stop Tensor device's AOC daemon for reducing significant jitter
  • Loading branch information
yzyhk904 authored Jun 25, 2023
1 parent 6de8202 commit fe5326d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This module,
<li>disables the effects framework of the mixer (to interface to equalizers, virtualizers, visualizers, echo cancelers, automatic gain controls, etc.) for obtaining a nearly direct low jitter audio pass,</li>
<li>disables the android built-in spatial audio feature (A13 or higher; especially Tensor devices) for obtaining a nearly direct low jitter audio pass too,</li>
<li>disables pre-installed Moto Dolby features and Digital Wellbeing (please uninstall this manually if remaining as a usual app) for the same as above,</li>
<li>stops Tensor device's AOC daemon for reducing significant jitter,</li>
<li>adjusts a USB transfer period of the USB HAL driver (not the recently common hardware offloading USB (tunneling) driver, but including Tensor device's offloading USB driver) for directly reducing the jitter of a PLL in a DAC (even in an asynchronous mode); Use <a href="https://github.com/yzyhk904/USB_SampleRate_Changer">"USB_SampleRate_Changer"</a> to switch from the usual hardware offloading USB (tunneling) driver to the USB HAL one,</li>
<li>sets a higher bitrate limit of bluetooth codec SBC (dual channel mode) for EDR 2Mbps entry class earphones (not for EDR 3Mbps performance ones, but including AV amplifiers and BT speakers),</li>
<li>sets an audio scheduling tunable "vendor.audio.adm.buffering.ms" "2" to reduce jitter on all audio outputs,</li>
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Change logs

# v1.3.3
* Stop Tensor device's AOC daemon for reducing significant jitter

# v1.3.2
* Hid preinstalled "Digital Wellbeing" feature for reducing significant jitter (please uninstall this manually if remaining as a usual app)

Expand Down
18 changes: 18 additions & 0 deletions customize-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,24 @@ function replaceSystemProps_MTK_Dimensity()
:
}

function replaceSystemProps_Tensor()
{
local freq="96000"
if [ $# -gt 0 ]; then
freq="$1"
fi

sed -i \
-e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2500/' \
-e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2500/' \
"$MODPATH/system.prop"
sed -i \
-e 's/vendor\.audio\.usb\.perio=.*$/vendor\.audio\.usb\.perio=2500/' \
-e 's/vendor\.audio\.usb\.out\.period_us=.*$/vendor\.audio\.usb\.out\.period_us=2500/' \
"$MODPATH/system.prop-workaround"

}

function replaceSystemProps_Others()
{
if [ -e "${MODPATH%/*/*}/modules/usb-samplerate-unlocker" -o -e "${MODPATH%/*/*}/modules_update/usb-samplerate-unlocker" ]; then
Expand Down
5 changes: 4 additions & 1 deletion customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ if "$IS64BIT"; then
"kona" | "kalama" | "shima" | "yupik" )
replaceSystemProps_Kona
;;
"sdm845" | gs* )
"sdm845" )
replaceSystemProps_SDM845
;;
gs* )
replaceSystemProps_Tensor
;;
"sdm660" | "bengal" | "holi" )
replaceSystemProps_SDM
;;
Expand Down
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=audio-misc-settings
name=Audio misc. settings
version=v1.3.2
versionCode=1302
version=v1.3.3
versionCode=1303
author=zyhk
description=Setting audio misc. configuration values (e.g. 100 volume steps, raising the resampling quality, disabling the effects framework, etc.)
8 changes: 4 additions & 4 deletions post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/system/bin/sh

# Do NOT assume where your module will be located.
# ALWAYS use $MODDIR if you need to know where this script and module is placed.
# This will make sure your module will still work if Magisk change its mount point in the future
MODDIR=${0%/*}
# Do NOT assume where your module will be located. ALWAYS use $MODDIR if you need to know where this script and module are placed.
# This will make sure your module will still work if Magisk changes its mount point in the future

MODDIR=${0%/*}

# This script will be executed in post-fs-data mode

Expand Down
8 changes: 7 additions & 1 deletion service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ function additionalSettings()
return 1
fi
fi


# Stop Tensor device's AOC daemon for reducing significant jitter
if [ "`getprop init.svc.aocd`" = "running" ]; then
setprop ctl.stop aocd
force_restart_server=1
fi

# Nullifying the volume listener for no compressing audio (maybe a peak limiter)
if [ "`getprop persist.sys.phh.disable_soundvolume_effect`" = "0" ]; then
if [ -r "/system/phh/empty" -a -r "/vendor/lib/soundfx/libvolumelistener.so" ]; then
Expand Down

0 comments on commit fe5326d

Please sign in to comment.