Coder Social home page Coder Social logo

magisk-modules-alt-repo / drc-remover Goto Github PK

View Code? Open in Web Editor NEW
75.0 0.0 0.0 49 KB

A remover of DRC (Dynamic Range Control, i.e., compression) sticking to all audio outputs on some major devices

License: GNU Affero General Public License v3.0

Shell 100.00%
audio drc compression magisk-module disabler

drc-remover's Introduction

DRC (Dynamic Range Control) remover

This simple module disables DRC (Dynamic Range Control, i.e., a kind of compression) on all audio outputs (a 3.5mm jack, an internal speaker, bluetooth earphones, USB DAC's, etc.; You cannot bypass this DRC feature activated in a DAC chip itself even by using a proprietary pseudo USB driver) if DRC has been enabled on a stock firmware. For example, smart phones and tablets whose SoC's have an SDM??? or SM???? model number usually enable DRC on all audio outputs, but those whose SoC's have an MT???? model number don't enable DRC on any audio output.

This module behaves as follows:

  1. Checks whether this device enables DRC or not. If so, then continues below, else exits.
  2. Copies the active main audio policy XML configuration file (e.g. /vendor/etc/audio_policy_configuration.xml, /vendor/etc/audio/audio_policy_configuration_a2dp_offload_disabled.xml, etc.) to a folder under $MODDIR/system/vendor
  3. Edits the copied file under $MODDIR/system/vendor to replace 'speaker_drc_enabled="true"' with 'speaker_drc_enabled="false"'.
  4. Overlays this modified file on its original one.


  • Remark: There may be several main audio policy configuration XML files, but only one file being currently active will be copied, modified and overlaid on its original one. If you changed the active main audio policy configuration XML file by using a special settings menu or the like (e.g., "disable a2dp hardware offload" in developer options) after installing this module, please re-install or update this module to reflect the change.

  • This module has been tested on LineageOS and crDroid ROM's, and phh GSI's (Android 10 ~ 14, Qualcomm & MediaTek SoC, and Arm32 & Arm64 combinations). But some custom ROM's (not stocks and GSI's) intendedly invert or change the meaning of 'speaker_drc_enabled' switch on context, then this module cannot disable DRC.

  • See also my companion magisk module "Audio misc. settings" for simply improving audio quality with respect to the number of media volume steps and resampling distortion of the Android OS mixer (AudioFlinger), and my root script "USB_SampleRate_Changer" to change the sample rate of the USB (HAL) audio class driver and a 3.5mm jack on the fly like Bluetooth LDAC or Windows mixer to enjoy high resolution sound or to reduce resampling distortion (actually pre-echo, ringing and intermodulation) ultimately.

DISCLAIMER

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

drc-remover's People

Contributors

yzyhk904 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drc-remover's Issues

Bootloop on Android 14 Kernel 4.14.343

When I flash it with Magisk, I goes into bootloop (stucks in loading screen)

Phone: Xiaomi Mi 11 Lite 4G (courbet)
Android Verison: 14.0.0_r35
Kernel: 4.14.343-openela-AlfaKernel
Security Update: May 5, 2024
Baseband Version: SS.AT.4.3.c5-00165-SM6150_GEN_PACK-1.35003.10
Build Number: AP1A.240505.005 release-keys

It happened to me in EvolutionX, AlphaDroid and LineageOS roms. They all use the same kernels. Had to remove the module manually, using OrangeFox recovery. (My bootloop protector module was enabled)

I believe there is an issue with the newest kernel. Thanks for help!

Edit: I installed CRDroid 10.5, still has the same issue. There were no issues in version 10.4. Please fix.

Only one policy file changed when multiple exist

Device: OnePlus 9 Pro
OS: Android 13 (crDroid v9) with Magisk 25.2
Version: drc-remover 1.0, Magisk module

Expected result:
There are three audio_policy_configuration*.xml files under /vendor/etc/, in different subdirectories, all with speaker_drc_enabled="true". The readme is unclear, but implies that all three should be copied to the drc-remover module directory, modified, and overlaid on the originals.

Actual result:
Only one file is copied and modified. The other two files are not copied and still have speaker_drc_enabled="true".

Notes:
If the module is intended to intelligently retrieve the current active audio policy file, and only patch that, I would suggest adding that to the readme. Not a coder, so I haven't examined the module to try to see how it works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.