Skip to content

Commit

Permalink
high_perf_dac: Introduce Sound Boost
Browse files Browse the repository at this point in the history
Signed-off-by: akirasupr <vishal.rockstar7011@gmail.com>
  • Loading branch information
ahkehrah committed Aug 30, 2021
1 parent 8d717d2 commit 5c75a2e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ if $DEBUG; then
set -x
fi

# High Performance DAC
if [ ! -f $MODPATH/high_perf_dac ]; then
rm -rf $MODPATH
fi

# Extract files
ui_print "- Extracting module files"
unzip -o "$ZIPFILE" -x 'META-INF/*' 'common/functions.sh' -d $MODPATH >&2
Expand Down
1 change: 1 addition & 0 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ DEBUG=true
##########################################################################################

set_permissions() {
set_perm $MODPATH/high_perf_dac 0 0 0777 0777
}

##########################################################################################
Expand Down
15 changes: 15 additions & 0 deletions high_perf_dac
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/system/bin/sh
# Do not remove credit if you're using a part of this mod to your module.
# by akirasupr@github
MOUNT=/data
MODDIR=${0%/*}
LOG=$MOUNT/high_perf_dac
if [ ! -d /sys/kernel/sound_control ]; then
echo "10 10" > /sys/kernel/sound_control/headphone_gain
echo 5 > /sys/kernel/sound_control/mic_gain
echo 5 > /sys/kernel/sound_control/earpiece_gain
echo 5 > /sys/kernel/sound_control/speaker_gain
echo "Enabled Sound Boost Excecuted on $(date +"%d-%m-%Y %r" )" >> $LOG/akirasupr.log
else
echo "Disabled Sound Boost Excecuted on $(date +"%d-%m-%Y %r" )" >> $LOG/akirasupr.log
fi
2 changes: 2 additions & 0 deletions post-fs-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ else
echo 1 > $FILE3
echo "Enabled Impedance Detect EN Excecuted on $(date +"%d-%m-%Y %r" )" >> $LOG/akirasupr.log
fi
# Sound Boost
$MODDIR/high_perf_dac

0 comments on commit 5c75a2e

Please sign in to comment.