Skip to content

A Magisk module changing audio samplerates at the system-wide mixer for the best Hi-Fi experience.

License

Notifications You must be signed in to change notification settings

yzyhk904/audio-samplerate-changer

Repository files navigation

A Magisk module for changing audio samplerates at the system-wide mixer for the best Hi-Fi experience

This module has been developed for casual music lovers to be able to experience the essence of my root script "USB SampleRate Changer" by the automation of Magisk.

Its features:

  1. Setting the samplerate of the USB HAL audio driver to be maximum automatically (up to 768 kHz & 32 bits; but 192 kHz & 32 bits for Tensor devices only)
  2. Setting its USB data transfer period to be 2000 usec for reducing jitter, instead of usual 5000 usec
  3. Setting the samplerate of the AOSP Bluetooth audio driver automatically depending upon a selected codec without double re-sampling unlike offload drivers
  4. Setting the samplerate of internal speakers to be maximum; 384 kHz & 32 bits for Qcom devices, 48 kHz & 32 bits for others
  5. Default re-sampling parameters are the same as "Resampling for cheapies" (can be overridden by other modules)
  6. Optimizing I/O kernel tunables for reducing jitter (most effective and almost safe as kernel tuning)
  7. Designed for using "Audio Msic. Settings" or "Hifi maximizer" together, but can be used by itself only
  8. Since the above two modules override re-sampling parameters, use "Resampling for cheapies" in addition if you use cheapie devices (Bluetooth LDAC earphones, cheap USB DAC's, and internal speakers, etc.)
  9. Including "DRC remover" and "USB Samplerate Unlocker"; Don't try installing them together


Notes:

  • This module can run only on devices using a 7.0 audio policy configuration prevailing since Android 14 or so including custom ROM's supporting relatively old ones (especially phh GSI's doing since Android 12), excluding recent AIDL only ones like Pixel 9 series.
  • This module has been tested on LineageOS and crDroid ROM's, and phh GSI's (Android 14, and Qualcomm SoC & MediaTek SoC & Tensors combinations).
  • Don't forget to install "Audio jitter silencer" together and uninstall "Digital Wellbeing" app (for reducing very large jitters which this module cannot reduce by itself)!
  • Also don't forget disabling "Absolute Volume" of Bluetooth devices in developer settings and setting a volume at the device side to be maximum for the best audio quality.
  • Almost all equalizers and some apps (using a much worse internal re-sampler to output; e.g. old Am@zon music app, some VOIP apps, etc.) cannot work for greater than 192 kHz audio outputs (but of which quality is far better sometimes). And the latest Am@zon music app re-samples to 192 kHz for such high frequency audio output, i.e. incurs much worse double re-sampling. If you prefer such ones, modify SampleRatePrimary="384000" to SampleRatePrimary="192000" or even SampleRatePrimary="48000" and also the third argument of patchClearLock command from "max" (up to 768 kHz) to "default" (up to 192 kHz) in "customize.sh" in a ZIP file of this module and install (or update) the modified one.

DISCLAIMER

  • I am not responsible for any damage that may occur to your device, so it is your own choice whether to attempt this module or not.

About

A Magisk module changing audio samplerates at the system-wide mixer for the best Hi-Fi experience.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages