Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Added a script which enables "DRC" with max samplerate detection
  • Loading branch information
yzyhk904 authored Jan 2, 2025
1 parent d1d7c3e commit 5ab2aaf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Usage_Samples/USB/USB__auto_max_drc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/system/bin/sh

MODDIR=${0%/*/*/*}

case "`getprop ro.board.platform`" in
gs* | zuma* )
# for Tensor devices (Internal speaker: 48kHz 32bit; offload USB driver: automatic max. detection (<=192kHz) for even non-HiRes. tracks)
# because they wouldn't run the USB HAL driver
Args="--offload-hifi-playback 48k 32"
;;
* )
if [ ! -e "/vendor/lib64/hw/audio.bluetooth.default.so" ]; then
# for old devices (under Android 10; various configurations)
Args="--safest-auto"
elif [ "`getprop persist.bluetooth.bluetooth_audio_hal.disabled`" = "true" ]; then
# for legacy configuration devices (using "a2dp" legacy Bluetooth module)
Args="--safest-auto"
elif [ "`getprop ro.hardware.lights`" = "qcom" -o "`getprop ro.hardware`" = "qcom" ]; then
# for Qcom devices (Internal speaker: 384kHz 32bit; the USB HAL & the BT HAL driver: automatic max. detection for even non-HiRes. tracks)
Args="--bypass-offload 384k 32"
else
# for MTK and other devices (Internal speaker: 48kHz 32bit; the USB HAL & the BT HAL driver: automatic max. detection for even non-HiRes. tracks)
Args="--bypass-offload 48k 32"
fi
;;
esac

su --mount-master -c "/system/bin/sh ${MODDIR}/USB_SampleRate_Changer.sh --drc $Args"

0 comments on commit 5ab2aaf

Please sign in to comment.