[GUIDE] How to Make Audio Mods Work Amazingly Well

BenParz

Senior Member
Feb 4, 2019
702
203
0
I am an audiophile and I make it a point to use audio mods whenever possible. That being said, the audio mods that I've tried and worked amazingly well are Viper4Android and Ainur Sauron, but you will also need Audio Compatibility Patch and Audio Modification Library to make things work so seamlessly.

That being said, I get to see a lot of people complaining about Viper4Android being too buggy in that after every restart, it asks for the driver to be installed again, etc. Well, I have clean flashed/dirty flashed plenty of ROMs now so I can honestly say that my method works.

So, what is my method for installing all of the audio mods I mentioned earlier? Well here are the steps:

1. Install Busybox for Android (in Magisk Repo)
2. Install Audio Compatibility Patch. It now comes with a multi-option installer, so you want to Select NO to the first option then choose Vol + (Patch New Logic). Select NO to the second option and then use Vol - (remove Volume Listener Library). This is done so that your audio won't crackle. You can skip USB Dac if you're not using it and you should choose NO at the last option (library workaround).
3. After Installing ACP with the chosen options, proceed to install Ainur Sauron.
4. Once that is done, install Audio Modification Library. After AML, DO NOT REBOOT YET.
5. Download the Viper4Android 2.7.1 APK here: https://labs.xda-developers.com/store/app/com.pittvandewitt.viperfx . I find this to be the best iteration of the module since it is not buggy at all. Once that is installed, run the application and it will prompt you to install drivers for the first time, choose OK and then allow it to reboot. (Note: after installing this, a Magisk Module will be created automatically)

At this point, all of the audio mods should work in unison. Do not toggle anything else in Viper4Android but the main interface. This means that do not go to the settings and toggle anything. Just configure the audio options as per your liking.

6. Currently, the setup will bork BT audio which means that there is no sound that is going to come off of your BT speakers or headphones. What you need to do to fix this is as follows:

a. Rename "audio_policy_configuration.xml" in "/sbin/.magisk/img/aml/system/vendor/etc/audio" to "audio_policy_configuration.xml.bak".

b. Copy the audio policy configuration xml file from "/sbin/.magisk/img/aml/system/etc" to "/sbin/.magisk/img/aml/system/vendor/etc/audio".

c. Restart the device.

Additional Notes

a. When dirty flashing your custom ROM, allow the modules to recoup itself. In other words, do not touch anything until everything is back to normal (or after 5 minutes from dirty flashing).
b. If you happen to uninstall Ainur Sauron (or Narsil), I find that it usually uninstalls viper4android as well. If that is the case, uninstall Sauron and then click the viper4android app from the drawer and allow it to install drivers again.
c. In some devices, the BT workaround is no longer needed. However, I find that for the Pocophone, the workaround is still required. I guess you just have to test it for yourself if it works right off the bat or not.
d. Audio compatibility patch (remove patch logic) actually enhances the volume and the sound quality of the Poco F1. I cannot test this on other devices since I do not have another phone, but you can try and see if it works for you. (thanks to @Jonas G. Morsch for this).
e. If you are going to try Ainur Narsil, I suggest that you do not install viper4android anymore since it provides a great listening experience right off the bat. You can still install v4a, though if you really want it (The same procedure applies).
f. If you are using a custom ROM that has a built-in "AudioFX" app, you need to freeze it using Titanium Backup or similar apps for Viper4android to work. Thanks to @mikedavo for this tip.
g. If, after following all of the above instructions, and you still experience random driver issues or bugs, I suggest that you do a clean installation of your ROM and do the entire steps again. If it still presents the same error, I suggest that you hop on the Viper4android telegram channel to address your concern so that the dev can fix it.
h. Attached below is a profile converter, so if you're using the old version of Viper4android, you can use the attached file to convert all of your profiles to supported presets.

That's about it! If you have questions, feel free to drop them below. Happy listening!
 

Attachments

Last edited:

Nemuritor01

Senior Member
May 22, 2017
258
170
0
Point 6 should be fixed. Possible a failure in Poco firmware or something. Use latest AML from Magisk repo. Also install all modules via magisk manager by now. Seems there is an issue and we are working in it.
Also I would replace Viper with JamesDSP.
JamesDSP future is bright and expect a tone of new **** in future. ?
 
  • Like
Reactions: unikum111

mikedavo

Senior Member
Sep 16, 2017
108
34
28
Hmm, I just make sure to disable and freeze any inbuilt audio equaliser or fx from custom roms before installing viper and have never had a problem with vipers drivers installing or instability in viper. I also, after installing viper, activate enhanced sound at the bottom of the sound menu in settings and choose my headphones in the dropdpwn, mine are mi inear pro. If I happen to forget to do this, I'll get the drivers need installing message from viper.
 

SVR

Senior Member
May 29, 2014
887
364
63
Rajahmundry
it doesn't work for me at all, viper keeps asking to install driver and reboots the phone.. again and again
Edit:- This worked perfectly for me even in the Secondary ROM with the following changes. V4A 2.7.0 instead of Latest 2.7.1 probably because I'm using Magisk 18.1 and V4A kept on asking to install driver even after reboot so I had renamed the MusicFX.apk in the System to MusicFX.apk.bak.
@BenParz Thank you very much for the guide.

This trick doesn't work with MultiROM for sure.
 
Last edited:
  • Like
Reactions: ahdeean

hugolol

Member
Nov 30, 2017
30
3
0
Will viper work with a bitrate of over 48k? My headphones us 96k which doesnt work with the buggy v4a i use, but its the only version of v4a that actually works at all for me (will try your way of installing later)
 
Jun 9, 2015
7
10
0
BenParz, i can't thank you enough for this! the choppy audio after installing Viper was making me crazy.
I'm running Lineage OS 05/18/2019 + nano gaaps

After mess around with this modules i got other way:

1 . Install Audio Compatibility Patch. It now comes with a multi-option installer, so you want to Select NO to the first option then choose Vol + (Patch New Logic). Select NO to the second option and then use Vol - (remove Volume Listener Library). This is done so that your audio won't crackle. You can skip USB Dac if you're not using it and you should choose NO at the last option (library workaround).

2. Download and install Viper4Android 2.7.1 Magisk Module here: https://zackptg5.com/downloads/v4afx_v2.7.1.0.zip .
More info : https://forum.xda-developers.com/android/apps-games/app-viper4android-fx-2-6-0-0-t3774651

3. Fix BT:

a. Rename "audio_policy_configuration.xml" in "/sbin/.magisk/img/acp/system/vendor/etc/audio" to "audio_policy_configuration.xml.bak".

b. Copy the audio policy configuration xml file from "/sbin/.magisk/img/acp/system/etc" to "/sbin/.magisk/img/acp/system/vendor/etc/audio".

4. Go to ViperFx and install drivers, Viper will auto Reboot!

I'm probably cutting some corners here, but i got no problems at all this far.
 

slimshouki

Senior Member
Dec 5, 2012
709
142
63
BenParz, i can't thank you enough for this! the choppy audio after installing Viper was making me crazy.
I'm running Lineage OS 05/18/2019 + nano gaaps

After mess around with this modules i got other way:

1 . Install Audio Compatibility Patch. It now comes with a multi-option installer, so you want to Select NO to the first option then choose Vol + (Patch New Logic). Select NO to the second option and then use Vol - (remove Volume Listener Library). This is done so that your audio won't crackle. You can skip USB Dac if you're not using it and you should choose NO at the last option (library workaround).

2. Download and install Viper4Android 2.7.1 Magisk Module here: https://zackptg5.com/downloads/v4afx_v2.7.1.0.zip .
More info : https://forum.xda-developers.com/android/apps-games/app-viper4android-fx-2-6-0-0-t3774651

3. Fix BT:

a. Rename "audio_policy_configuration.xml" in "/sbin/.magisk/img/acp/system/vendor/etc/audio" to "audio_policy_configuration.xml.bak".

b. Copy the audio policy configuration xml file from "/sbin/.magisk/img/acp/system/etc" to "/sbin/.magisk/img/acp/system/vendor/etc/audio".

4. Go to ViperFx and install drivers, Viper will auto Reboot!

I'm probably cutting some corners here, but i got no problems at all this far.
Have you tried whatsapp voice notes?
Are they making crackling sound when app is minimized or screen is off while playing voice note?
 

BenParz

Senior Member
Feb 4, 2019
702
203
0
Will viper work with a bitrate of over 48k? My headphones us 96k which doesnt work with the buggy v4a i use, but its the only version of v4a that actually works at all for me (will try your way of installing later)
Well, you can actually change the Bluetooth bitrate setting in developer options. Doing that allows me to use V4a on my sony BT speaker (which uses LDAC).
 
Jun 9, 2015
7
10
0
Have you tried whatsapp voice notes?
Are they making crackling sound when app is minimized or screen is off while playing voice note?
Yeah, Whatsapp on Lineage crackles no matter what.

I'm dealing with this problem since my Zenfone 2 with Lineage 14 and no audio mod whatsoever, but never cared too much, because when i rarely listen Whatsapp audio files i do in foreground, and using the earpiece, . I also use telegram for 95+% off my conversations this days.
 
Jun 9, 2015
7
10
0
Hi Again!
After some time of testing, i think i got it how to use Audio Compatibility Patch (1.7.3+) with Lineage OS properly on our device:

Skip audio_policy patching?
- No

Patch flags or remove selections?
- Remove (old logic)
If patched the audio gets worse/lower on speaker/jack.

Would you like to skip notification helper?
- No

Remove notification helper effect or volume listener library?
- Remove volume listener library

Would you like to skip usb policy patching for usb dacs?
- Whatever

Use library workaround?
- No
If used causes bluetooth routing problems.

No Audio Modification Library needed.
After this sequence, my earphones,bluetooth and speaker worked fine with ViperFX 2.7.1, especially the jack, witch was really quieter and muffed before.
Can you guys try it out?
 

Nemuritor01

Senior Member
May 22, 2017
258
170
0
AudioModificationLibrary (AML) has been updated to 2.4. we've also updated unity modules. Everything should work now. Viper, James, Sauron and DTS.

At least on latest MIUI pie betas there should be no Bluetooth bug or anything.

There was a question regarding viper and above 48k.
Viper can just process up to 48. We've released yesterday the new module with DTSultra port. This is capable of up to 96k.
 

unikum111

New member
Aug 13, 2014
2
0
0
AudioModificationLibrary (AML) has been updated to 2.4. we've also updated unity modules. Everything should work now. Viper, James, Sauron and DTS.

At least on latest MIUI pie betas there should be no Bluetooth bug or anything.

There was a question regarding viper and above 48k.
Viper can just process up to 48. We've released yesterday the new module with DTSultra port. This is capable of up to 96k.
What about bluetooth on PE and other custom ROMs?
 
Last edited: