Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

All USB Audio Class (USB HAL) drivers on Android have a limiter of sample rates at 96kHz. This magisk module unlocks the limiter.

License

Notifications You must be signed in to change notification settings

yzyhk904/usb-samplerate-unlocker

Repository files navigation

This repository has been moved to "Magisk-Modules-Alt-Repo".


Unlocker for the USB audio class (USB HAL) driver's limitation (upto 96kHz lock) on Android devices

This magisk module has been developed for recent music streaming services which output greater than 96kHz high resolution sound, and behaves as follows:

    1. hexdump "/vendor/{lib, lib64}/libalsautils.so" to "tempfile-{lib, lib64}"
    1. edit "tempfile-{lib, lib64}" to replace
hexdumped "std_sample_rates[]={96000, 88200, 192000, 176400, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000}" (upto 96kHz lock)

  with

hexdumped "std_sample_rates[]={192000, 176400, 96000, 88200, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000}" (upto 192kHz lock)	

  or

hexdumped "std_sample_rates[]={384000, 352800, 192000, 176400, 96000, 88200, 48000, 44100, 32000, 24000, 16000, 12000, 8000}" (upto 384kHz lock)

  or

hexdumped "std_sample_rates[]={768000, 705600, 384000, 352800, 192000, 176400, 96000, 88200, 48000, 44100, 24000, 16000, 8000}" (upto 768kHz lock).
    1. Revert "tempfile-{lib, lib64}" to binary files in "$MODDIR/system/vendor/{lib, lib64}/libalsautils.so".
    1. Overlay "$MODDIR/system/vendor/{lib, lib64}/libalsautils.so" onto "/vendor/{lib, lib64}/libalsautils.so"
  • Remark: This module unlocks upto 384kHz unless you have modified "post-fs-data.sh" in its zip file or its "$MODDIR" on your device. Upto 768kHz unlocking may stutter sound on your device. If you need to automatically connect 192kHz (instead of 384kHz) to your USB DAC, please modify the "post-fs-data.sh" (in this file, "max", "full" and "default" mean "upto 768kHz", "upto 384kHz" and "upto 192kHz" unlocking, respectively).

This module has been tested on LineageOS based ROMs (Android 10 & 11) and ArrowOS (Android 11 & 12). See also my companion script "USB_SampleRate_Changer" to change the sample rate of the USB audio class driver and a 3.5mm jack on the fly like Bluetooth LDAC or Windows mixer.

DISCLAIMER

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

Change logs

v1.0

  • Initial Release

v1.1

  • Recent higher sample rates added

v1.2

  • arm (32bit) bug fixed ("/vendor/lib64/libalsautils.so" phantom overlay makes stutters on arm devices)

About

All USB Audio Class (USB HAL) drivers on Android have a limiter of sample rates at 96kHz. This magisk module unlocks the limiter.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages