Related
Guide to get rid of audio distortion on CM13 and Lineage OS 14.1
I have told quite a few people in the cm13 thread how to get rid of the audio distortion, I figured it was relevant to enough people that I should make a little guide on how to set it up although it is pretty straightforward.
[Disclaimer] I am not responsible if you manage to break your phone using this guide
What does this guide accomplish? This guide will help you install Viper4Arise which is a wonderful sound mod that I use on any phone or rom. Viper4Arise will allow you to eliminate audio distortion in media playback on your Axon 7 running CM13 or LOS14.1, by lowering the output gain which is not capped properly in these Roms
What does this guide fail to accomplish? This guide will not fix mic issues, in call volume, the left channel being missing on speakers, or any other sound related problem present in CM13 or LOS14.1, however most bugs are gone now in LOS14.1
Now that that's out of the way, lets get to the fun stuff!
Step 1
First thing you want to do is grab the Viper4Arise flashable zip
Download Viper4Arise 2.3.3
however if you want the newest version
Download Viper4Arise 2.4
once you have this you can boot into TWRP and flash it, then reboot into system
Step 1.5
This step is only necessary on the newest builds of lineage OS 14.1
lineage OS does not have root built in. we will download the root addon package from lineageOS
Download root addon
flash this in twrp, it doesnt matter if it is done before or after installing the Viper4Arise package
Step 2
SeLinux must be permissive and by default it is enforcing so we are going to grab this apk and install it
Download SeLinux Switcher
once installed, open the app, allow root access (you may need to enable root in developer options) and set SeLinux to Permissive. if Viper4Arise stops working always check to make sure Selinux is still in permissive as changing it back to enforcing will stop Viper4Arise from working.
Step 3
Next we will configure Viper4Arise to eliminate Audio distortion.
Start by going to the phone speaker and Headset tabs and Switching master power to on
Now press the menu button on the top left and press Driver status. as long as SeLinux is permissive it should say
NEON Enabled: Yes
Enabled: Yes
Status: Normal
the other things are not relevant. if the above message read "No" or "Abnormal" you may not have set SeLinux to permissive, please go back to step 2!
do this twice, once with the Headset tab Selected and once with the Phone Speaker tab selected
There are allot of awesome setting to mess with they can make you audio amazing, I encourage you to try them out. to make the audio distortion go away simply scroll to the bottom and find the "Master Gate (Limiter)" tab. Set the output gain to -10.5 dB on both the Headset and Phone Speaker. this level seems pretty good in my opinion however you may find you prefer a slightly lower or higher level.
That's it! I hope I have helped you guys out, feel free to ask questions or make suggestions on how to improve this guide and be sure to leave Thanks!
Thread created: 1/31/17
Last updated: 2/2/17
This won't make audio playback through the phone speakers stereo again, would it?
Does this work for LineageOS 14.1?
Abiram26 said:
This won't make audio playback through the phone speakers stereo again, would it?
Click to expand...
Click to collapse
Nope... Sorry. I will add that to the list of things it doesn't do.
borijess said:
Does this work for LineageOS 14.1?
Click to expand...
Click to collapse
I have only tested it in CM13 as I haven't made the jump. But the audio distortion problem is the same in Lineage OS as CM13.
It will work in Lineage OS.
masong397 said:
I have only tested it in CM13 as I haven't made the jump. But the audio distortion problem is the same in Lineage OS as CM13.
It will work in Lineage OS.
Click to expand...
Click to collapse
Nice job worked on LineageOS 14.1.
Thanks for the guide. My YouTube videos are no longer distorted and sound good enough, for not having stereo capability on LOS. However, all of my notifications that come in are still very distorted, is there a fix for this?
cms062407 said:
Thanks for the guide. My YouTube videos are no longer distorted and sound good enough, for not having stereo capability on LOS. However, all of my notifications that come in are still very distorted, is there a fix for this?
Click to expand...
Click to collapse
Glad the guide helped you! Unfortunately I don't know how to get rid of distortion when notifications come in. I do believe Unjustified Dev said that all audio distortion will be gone in the near future, of course this guide won't be important at that point. At least audio quality isn't really important for notifications...
Alrighty, no big deal. You're right, it isn't a huge problem...Just a little annoying. I may have to flash back to stock, the main reason most people bought this phone was for the speakers....And I'm starting to miss the immersive sound that I had from stock
cms062407 said:
Alrighty, no big deal. You're right, it isn't a huge problem...Just a little annoying. I may have to flash back to stock, the main reason most people bought this phone was for the speakers....And I'm starting to miss the immersive sound that I had from stock
Click to expand...
Click to collapse
Yeah the left and right channel bug really degrades the speaker experience... And weird sounding notifications is annoying. I listen to lots of music but always with headphones or with an aux in the car so I don't really care too much...
Hijacking this thread to ask specifically. I do not care about my speakers I literally only use Headphones.
Is media with headphones played via the AK DAC? Is the quality as good as "super" mode on the stock ROM ? (Again, asking for Media Playback with headphones!)
Question, is the audio on LOS 14.1 with speakers good enough to listen to podcasts and some music with this mod?
Doesnt work anymore on LineageOS 14.1 latest version. I cant change back to permissive.
borijess said:
Doesnt work anymore on LineageOS 14.1 latest version. I cant change back to permissive.
Click to expand...
Click to collapse
Flashing the latest build right now. I will let you know how it goes
borijess said:
Doesnt work anymore on LineageOS 14.1 latest version. I cant change back to permissive.
Click to expand...
Click to collapse
You need root to use SeLinux mode changer. check the OP I updated how to get root.
masong397 said:
You need root to use SeLinux mode changer. check the OP I updated how to get root.
Click to expand...
Click to collapse
My fault.
I didn't realize I lost root after I dirty flashed.
iNaruX said:
Hijacking this thread to ask specifically. I do not care about my speakers I literally only use Headphones.
Is media with headphones played via the AK DAC? Is the quality as good as "super" mode on the stock ROM ? (Again, asking for Media Playback with headphones!)
Click to expand...
Click to collapse
I use headphones all the time. I love it. If you are worried about the quality compared to stock I believe you will not be disappointed. Of course I am not an audio expert and do not have the means to compare the quality side by side. I am not sure if the HiFi DAC is used, that is more of a general lineage os question.
borijess said:
My fault.
I didn't realize I lost root after I dirty flashed.
Click to expand...
Click to collapse
I just flashed SuperSU again now I have root again.
spacemanvt said:
Question, is the audio on LOS 14.1 with speakers good enough to listen to podcasts and some music with this mod?
Click to expand...
Click to collapse
The speakers are not as good as stock, the mod works perfectly but I believe only right channel is played. Its a problem that the lineage os devs have to fix. It is good for listening to pretty Mich anything, oy won't have distortion or anything
spacemanvt said:
Question, is the audio on LOS 14.1 with speakers good enough to listen to podcasts and some music with this mod?
Click to expand...
Click to collapse
Yes works great for podcasts.
Hi All. The sound is fixed as you know but not on all ROM. So i've made a Fix zip. Tried on US and G version.
Edit: working on A2017 (Chinese version)
IMPORTANT: I'm not responsible for anything which could be happen. I suggest to make a backup from TWRP.
First of all i didn't fix it. Thanks @Unjustified Dev , @DrakenFX and Anynomous Dev
Instruction:
Flash zip via TWRP.
Download:
v4.1
https://www.androidfilehost.com/?fid=457095661767153882
v4
https://www.androidfilehost.com/?fid=457095661767152958
v2
https://www.androidfilehost.com/?fid=529152257862718359
WesTD said:
Hi All. The sound is fixed as you know but not on all ROM. So i've made a Fix zip. Tried on US and G versions.
IMPORTANT: I'm not responsible for anything which could be happen. I suggest to make a backup from TWRP.
First of all i didn't fix it. Thanks @Unjustified Dev , @DrakenFX and Anynomous Dev
Instruction:
Flash zip via TWRP.
Download:
uploading.
Click to expand...
Click to collapse
Thanks for that.
Do correct me if I'm wrong, but this still does not make use of the AKM DAC, right? This still uses the Qualcomm inbuilt DAC?
Thanks in any case!
joaste said:
Thanks for that.
Do correct me if I'm wrong, but this still does not make use of the AKM DAC, right? This still uses the Qualcomm inbuilt DAC?
Thanks in any case!
Click to expand...
Click to collapse
It's wired for it's AKM DAC the issue was we were dependent on ZTE crappy patch that made us bypass and force audio on. Now the amplifier HAL correctly calls to the NXP driver to properly calibrate and initialize audio in all usecases. It's more so the developer is trying to recreate how stock handles stuff like voice speaker, speaker reversing, mono + stereo, etc.
Unjustified Dev said:
It's wired for it's AKM DAC the issue was we were dependent on ZTE crappy patch that made us bypass and force audio on. Now the amplifier HAL correctly calls to the NXP driver to properly calibrate and initialize audio in all usecases. It's more so the developer is trying to recreate how stock handles stuff like voice speaker, speaker reversing, mono + stereo, etc.
Click to expand...
Click to collapse
How was this fix done exactly? Was it just fiddling with some configuration files or did you have to completely rewrite the way android works the audio so it calls the driver correctly? And if so, is it the same way Dolby does? I'm so curious how you guys and the anonymous dev managed to fix it
Also, I can't wait for this to upload. This + LOS based roms and this phone would be absolutely perfect. Too bad it's not mainstream enough to get more attention
If we flash this, will it cause any issues once it's officially merged into LOS and we update LOS on the phone?
WesTD said:
Hi All. The sound is fixed as you know but not on all ROM. So i've made a Fix zip. Tried on US and G versions.
IMPORTANT: I'm not responsible for anything which could be happen. I suggest to make a backup from TWRP.
First of all i didn't fix it. Thanks @Unjustified Dev , @DrakenFX and Anynomous Dev
Instruction:
Flash zip via TWRP.
Download:
uploading.
Click to expand...
Click to collapse
The download is not available.
Teet1 said:
How was this fix done exactly? Was it just fiddling with some configuration files or did you have to completely rewrite the way android works the audio so it calls the driver correctly? And if so, is it the same way Dolby does? I'm so curious how you guys and the anonymous dev managed to fix it
Also, I can't wait for this to upload. This + LOS based roms and this phone would be absolutely perfect. Too bad it's not mainstream enough to get more attention
Click to expand...
Click to collapse
Has nothing to do with dolby. There's a file libtfa9890.so stock audio hal calls this file does it's magic. On lineage we don't have the amp source which is packed into the audio hal on stock. We use an amplifier hal all this hal does it try to produce whatever the heck the stock audio hal did when it loaded libtfa9890.so. It basically allows you to instrument custom calls without touching the audio hal of the ROM therefore keeping it clean. ZTE gave us a patch that force loaded libtfa9890 and immediately said ignore all cases turn on the speaker. What the dev did is rewrite the patch to properly call all functions such as calibrate, set mode , speaker on , speaker off ,etc. This way we don't just force speaker we actually start saying if in call handle the speakers this way. If music is playing handle them this way. We don't just say if need sound ramp up the amp and make sound.
link added.
Has anyone who flashed it have a decrease in system performance?
Sent from my ZTE A2017U using Tapatalk
WesTD said:
link added.
Click to expand...
Click to collapse
Just installed this fix.
It works, it works, Hallelujah!.
Ya so this zip works on the Chinese version, so you can update the op
Also passed the stereo test. Left and right channels are both working independently and awesomely.
The distortion has nearly disappeared.
Calls work.
Thanks to all the devs especially unjustified dev and anonymous dev.
Thanks also to drakenfx and westd.
Also now that patch 3 is out, can we expect another zip in the future!
Unjustified Dev said:
Has nothing to do with dolby. There's a file libtfa9890.so stock audio hal calls this file does it's magic. On lineage we don't have the amp source which is packed into the audio hal on stock. We use an amplifier hal all this hal does it try to produce whatever the heck the stock audio hal did when it loaded libtfa9890.so. It basically allows you to instrument custom calls without touching the audio hal of the ROM therefore keeping it clean. ZTE gave us a patch that force loaded libtfa9890 and immediately said ignore all cases turn on the speaker. What the dev did is rewrite the patch to properly call all functions such as calibrate, set mode , speaker on , speaker off ,etc. This way we don't just force speaker we actually start saying if in call handle the speakers this way. If music is playing handle them this way. We don't just say if need sound ramp up the amp and make sound.
Click to expand...
Click to collapse
Genius. Didn't mean to say Dolby, meant zte I had Dolby Atmos on the mind. But if it's nothing to do with Dolby, how come they didn't release the source for a direct fix instead of releasing a half assed patch for devs to work with? Then there wasn't be an issue of it being closed or open source
WesTD said:
link added.
Click to expand...
Click to collapse
My latest Gerrit patch?
Sent from my ZTE A2017U using Tapatalk
FIGURES!!! I just went back to stock (but still have unlocked bootloader)....
Looks like I know what I'll be doing, at some point, this week!
GREAT WORK @DrakenFX
Unjustified Dev said:
My latest Gerrit patch?
Sent from my ZTE A2017U using Tapatalk
Click to expand...
Click to collapse
not latest, 2nd one. @DrakenFX will upload it soon.
WesTD said:
not latest, 2nd one. @DrakenFX will upload it soon.
Click to expand...
Click to collapse
Yeah, I sent him the libraries a few hours ago. Let me know if you need anything else.
Sent from my ZTE A2017U using Tapatalk
Unjustified Dev said:
Yeah, I sent him the libraries a few hours ago. Let me know if you need anything else.
Sent from my ZTE A2017U using Tapatalk
Click to expand...
Click to collapse
Okay man. thanks for your works.
TWRP Flashable Stereo Sound Patch 3.
https://www.androidfilehost.com/?fid=457095661767152906
Thanks to Anonymous Dev. & @Unjustified Dev for all of this.
DrakenFX said:
TWRP Flashable Stereo Sound Patch 3.
https://www.androidfilehost.com/?fid=457095661767152906
Thanks to Anonymous Dev. & @Unjustified Dev for all of this.
Click to expand...
Click to collapse
Can users that already have the audio fix install this (NucleaROM)??
aLexzkter said:
Can users that already have the audio fix install this (NucleaROM)??
Click to expand...
Click to collapse
Yep this would work on any rom that uses amplifier hal which is all of them
Sent from my ZTE A2017U using Tapatalk
What's the improvement of V3 over V2 ?
PS : THX to every1 involved who made this possible !
Hello, I'm trying to disable noise cancellation, because recording music sounds awful.
Despite all the instructions I have found on the internet, nothing seems to work. Either sound is still supressed, or the mic doesn't work at all. Has anyone had success with this issue?
I tried something that solved the problem, but the audio was way too low. Check my profile to find the solution
gianluca212 said:
I tried something that solved the problem, but the audio was way too low. Check my profile to find the solution
Click to expand...
Click to collapse
did you apply the patch or edit the system files manually? The patch makes no difference for me. When I followed the steps, the mic doesn't work at all (I get an error when trying to record audio).
I have applied the patch.
gianluca212 said:
I have applied the patch.
Click to expand...
Click to collapse
which ROM are you using?
I also face same problem
When WhatsApp Voice Call use Bluetooth always delay n awful sound and Reconnecting, but when turn to Loudspeaker and earspeaker everything smoothly,
Is there any patch to fix this?
I try many roms, like ViperOS, AEX, Los 14.1 (Nougat)
Also same problem.
Please someone tell us how to fix this
did you fix it ?
There's no fix, Xiaomi audio just sucks.
This mod enables the Earpiece speaker to be used at the same time with the main rear speaker when using listening to music, and watching videos etc...
Updated
Now TRUE STEREO with Earpiece playing the LEFT channel and rear speaker playing the RIGHT channel. Test with app of your choice.
Click to expand...
Click to collapse
To install open the zip file and extract the "default_gain.conf" file and copy it to "/system/etc/default_gain.conf" using your preferred method.
Then set permissions to rw-r-r or 0644 ( e.g "chmod 0644 /system/etc/default_gain.conf" ) and REBOOT your device.
Volume levels are pushed to maximum possible without distortion with EQ on Earpiece speaker to remove low frequencies. Good luck.
Works on my SM-910K running MarshMallow 6.0.1.
WARNING!!!
THIS HAS ONLY BEEN TESTED ON THE DEVICE MENTIONED ABOVE. MAKE SURE TO BACKUP YOUR DEFAULT "default_gain.conf" FILE BEFORE INSTALLING THE NEW ONE.
(E.g "adb pull /system/etc/default_gain.conf [safe location here]" or "adb shell cp /system/etc/default_gain.conf /sdcard/default_gain.conf.bak" )
To be SAFE DO a NANDroid backup in Recovery.
Happy modding.
NOTE:
If you cannot find "/system/etc/default_gain.conf" file on your device then this MOD will NOT WORK for you. If that is the case you can try the other surround mods for other variants of the Note 4. This has only been tested to work on the N910K.
I created this one because the mods for the other variants didn't work on my phone since it uses the "default_gain.conf" file instead of the 'normal' "mixer_paths.xml" file.
Source
https://github.com/salvenose/dual_mod
Changelog
v1 -> Initial Dual Speaker Mod
v2 -> Upgrade to true stereo
v3 -> Fix for audio leak through earpiece while Headphone connected
Tried it on my N910F running 6.0.1 and seems like it works,but need to cover the main speaker to hear anything from the earpiece.
alexetna95 said:
Tried it on my N910F running 6.0.1 and seems like it works,but need to cover the main speaker to hear anything from the earpiece.
Click to expand...
Click to collapse
If there was a quick ON/OFF toggle you would notice that it makes quite a difference than with it turned off completely. Especially when you receive a notification etc... with your phone lying on a flat surface.
I haven't yet figured out how to manipulate the EQ settings for the front earpiece so that it only outputs mid-treble range without any bass.
Once I do, I'll be able to boost the volume without causing distortion. Otherwise it might damage the earpiece.
Where shoud I found that toogle ?
Actually I didn't find a "default_gain.conf" file in etc,so I just simply copied the one from your mod zip.
alexetna95 said:
Where shoud I found that toogle ?
Actually I didn't find a "default_gain.conf" file in etc,so I just simply copied the one from your mod zip.
Click to expand...
Click to collapse
If you didn't find a "default_gain.conf" file then the mod definitely won't work. It's not working for you.
Would this work on N910U?
It works on the 910C running Nemesis
Good job OP, this mod on 910C it is been hit and miss with a lot of distortion. This is the best implementation I have used. ?
Finaly N910c has this mod
It is working. Thank you very much :highfive::highfive:
Came from @mangui's post in NEMESIS REFINED V3.8.5 N7 Port by*ananjaser1211
Confirmed!!! This work good on 910C , thanks very good mod
Working, but after first call - microphone stop working
Fixed call microphone
alextalexus said:
Working, but after first call - microphone stop working
Click to expand...
Click to collapse
I've fixed it ?
Hi theres a bug
when I plug in earphones , sound still comes out of front mic
Here is the source pushed to GitHub
https://github.com/salvenose/dual_mod
Possible Fix
Ryuce said:
Hi theres a bug
when I plug in earphones , sound still comes out of front mic
Click to expand...
Click to collapse
Can you tell me if this fix works
https://raw.githubusercontent.com/salvenose/dual_mod/master/default_gain.conf
sVenose said:
Can you tell me if this fix works
https://raw.githubusercontent.com/salvenose/dual_mod/master/default_gain.conf
Click to expand...
Click to collapse
Thanks bro its fixed!
Ryuce said:
Thanks bro its fixed!
Click to expand...
Click to collapse
Alright. Just added v3 to the original post. Have a nice day and God bless you.
Wooooow
Thats awesome
V3 Working great on N910C ,
I found another bug
When i make phone call people i call cant hear me
Ryuce said:
I found another bug
When i make phone call people i call cant hear me
Click to expand...
Click to collapse
Yes i have the same problem,
I have to restart my phone, then it worka fine
Hi again,
After update to erobotrom v1.2, I have the same problem - microphone stop working. Somebody have the original mixer_path and default_gain or the other solution for this problem. Thx.
Hi guys I'm having a problem where on Android 7+ I have no sound please help me as soon as you can
Sonicfann said:
Hi guys I'm having a problem where on Android 7+ I have no sound please help me as soon as you can
Click to expand...
Click to collapse
Is the call volume is low, or no sound is coming out from speaker???
There's no sound from the speaker and the call volume doesn't work either
Sonicfann said:
There's no sound from the speaker and the call volume doesn't work either
Click to expand...
Click to collapse
Is it works if you use head phone???
Well my headphone jack is broken but my Bluetooth earbuds work so yea
Sonicfann said:
Well my headphone jack is broken but my Bluetooth earbuds work so yea
Click to expand...
Click to collapse
Then it should be Hardware problem, try hitting back of speak, something it works, if not you need to replace the speaker.
I think it's a software issue because games won't start they crash after the splash screen and the mic crashes Google Assistant and sound recorder
Sonicfann said:
I think it's a software issue because games won't start they crash after the splash screen and the mic crashes Google Assistant and sound recorder
Click to expand...
Click to collapse
Try flashing other custom ROM. Maybe it will solve your problem.
No you Don't get it it's on EVERY custom rom above 6.0.1 also I tried what you said it didn't work
(Crdroid 5.1 was the one that caused the prob btw)
Had this issue on my e 2015,I downloaded one of those speaker tester apps, and once I got to a high enough MHz sound,the speaker started working
https://play.google.com/store/apps/details?id=com.blackflame.internalspeakertester