yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] RoadToNever:
Wow, I can't wait until I can make custom EQs for my IEMs. I'm doing this on the desktop with VST plugins and a piece of software called Virtual Audio Stream.
[Nexus 5 Android Development] chdloc:
The filter design instructions and a detailed example design are now LIVE .

Please post your questions and suggestions there. As this is topic has a pretty steep learning curve I'm prepared to do a lot of hand-holding...;)
[Nexus 5 Android Development] slobo2712:
Does this mod work with this rom?

http://xdaforums.com/google-nexus-5/development/rom-chroma-03-31-2015-layers-t3069105
[Nexus 5 Android Development] chdloc:
As the ROM you have linked to is based on AOSP, there is a pretty good chance that this mod will work.
[Nexus 5 Android Development] dakore:
It works, but first time I flashed this mod I got bootloop. Clean flash in both tries. Anyway, it works...
[Nexus 5 Android Development] xTwipz:
Noob here!

Hey mates, noob here! I have only one question: my build of Lollipop is the LMY47I; in the download i see that the version is the LMY47D..

This zip works without problem also with the	LMY47I build or not? Thanks for all the answers :o
[Nexus 5 Android Development] Pilatus47:
Yes it works, and works perfect. I´m using the latest aroma installer made by spacetaxi.

Saludos
[Nexus 5 Android Development] xTwipz:
Got bootloop after flashing the spacetaxi installer :crying:

I solved with the unistall option...

Any tip for using this? please help me :D
[Nexus 5 Android Development] chdloc:
I'm running LMY47D myself, but I have seen reports of this mod working on LMY47I as well.

I looked at the changelog between LMY47D and LMY47I and there is nothing that would indicate that the installer would need to be updated.

Which version of the mod did you flash? Try flashing the "simple" mod (without noise suppression).

Are you running the stock Google ROM without any other mods installed?

(The installer will not work with CM ROMs or any of the CM derivatives, for those go here)
[Nexus 5 Android Development] Flyview:
Does anyone here use the Zello app? The microphone in the app is completely silent. I'm thinking it may have to do with this mod as it works fine on my gf's stock Nexus 5.

Edit: Interesting, I turned on "noise suppression" in the options and now it works. You'd think that would have the opposite effect. Still wondering if this could be related to the stereo mod and mic gain mod.

Sent from my Nexus 5
[Nexus 5 Android Development] xTwipz:
I have the stock Google ROM, today i installed the simple mod (last time i use the noise suppression) and it works... I'll test and i post here the result! thanks mate
[Nexus 5 Android Development] chdloc:
Thanks for the heads-up!

I'm not using Zello, but I doubt the initial incompatibility has anything to do with the stereo mod (you mean playback, right?) or with any mic gain mod.

The problem is likely how I (had to) enable noise suppression for the Camcorder in libaudiolfinger. Does your workaround (by enabling noise suppression in the Zello app) result in acceptable voice quality?
[Nexus 5 Android Development] Flyview:
Yes, it seems to work fine. Thanks for the response. What I meant by mic gain mod is that I believe when you use the aroma installer it asks you how much negative gain you want (noise suppression?) for the camcorder mic. This app isn't using the camcorder though, just the microphone afaik.
[Nexus 5 Android Development] otavioricciotti:
[MENTION=2760454]chdloc[/MENTION] do you think it's possible to add AGC to Nexus 5? Is there something the Qualcomm hardware filtering can improve?

Again, thanks for answering! This still is the best mod for N5. <3
[Nexus 5 Android Development] chdloc:
Are you referring to AGC on the recording or the playback side? The post you quoted leads to playback modifications only. I have not yet tried to figure out whether the hardware filter inside the Qualcomm codec can be applied to the microphone path (other than to apply sidetone filtering) as I doubt there would be any value in doing so.

If you are referring to AGC on the recording side: I did play around with AGC. There is AGC functionality available both from within Android (webRTC) and Qualcomm (Snapdragon). Both implementations seem to be optimized for speech signals only and perform poorly when presented with "generic" audio signals.

Ultimately, I see two major problems with the recording side of things, and they are:

excessive white self-noise

distortion at (even moderately) high input levels.

Both are primarily due to the poor microphone chosen. Unfortunately, there is only very little that can be done with software. I believe I exhausted our options here by applying 6 or 12 dB of noise suppression as well as utilizing aMGC.

(There is actually a third problem, which is the PCB routing of the auxiliary microphone trace as it picks up switching noise.)

What kind of additional improvements are you thinking of?

If you are referring to AGC on the playback side: As far as I know, the only thing you could do via the codec is to apply compression. I tried that once and it performed very poorly...
[Nexus 5 Android Development] otavioricciotti:
Sorry, I was talking about recording. I don't know what to expect with this qualcomm filter, maybe something good to our headphones ¯\_(ツ)_/¯

I still can't record good videos in noisy places (like stadiums). That's why I asked.

Thaks for replying :)
[Nexus 5 Android Development] chdloc:
That's the idea.

aMGC (see OP) is not working for you?
[Nexus 5 Android Development] Matrix_19:
5.1.1 is out
[Nexus 5 Android Development] otavioricciotti:
aMGC works nice, but I'm not so used to it. My fault, of course.

Time to practice more :p

Thanks for really fast reply.

Actually it was a too fast reply, WOW
[Nexus 5 Android Development] chdloc:
I looked at the available OTA file and none of the files that need to be modified for the mod to work seem the be slated for a patch. In other words, the current mod should work for 5.1.1. Please report back if you experience otherwise.
[Nexus 5 Android Development] Matrix_19:
I tried the aroma installer.

I can install and boot (my configuration is mono camcorder + stereo playback and nothing else)

but the stereo playback is not working and I recorded a video and the sound seems to not be good but I'm not sure, I did only 1 test

So I think it's not working and I'm not sure what's wrong (5.1.1, twrp, aroma installer with 5.1.1..??.)

I'm using twrp-2.8.6.0

I' not sure if the issue is only on my side

can someone else try it ?
[Nexus 5 Android Development] vaindil:
I'm on 5.1.1 (flashed the stock image except for the data partition) and the aroma installer worked perfectly. I haven't tested any video, but I use stereo playback and the default volume settings and everything is working as expected.
[Nexus 5 Android Development] chdloc:
After having compared all relevant files, I see no reason why the current version of the mod should not work with LMY48B (5.1.1)

Try using TWRP 2.8.5.3. It was reported before that there may be a problem with 2.8.6.0
[Nexus 5 Android Development] Matrix_19:
you are correct.

twrp 2.8.6.0 was the problem

thanks
[Nexus 5 Android Development] Basche:
There's a 2.8.6.1 version, maybe try that before an older version. I believe that fixed issues 2.8.6.0 had when it was released
[Nexus 5 Android Development] onesolo:
Does the last update works on 5.1.1 ??
[Nexus 5 Android Development] dadomonte:
5.1.1 record audio seems fine?!

Please, before install this great patch someone could test the audio record quality in 5.1.1 because in a short test

I had a good quality audio, not that buble water sound that we found before 5.1.1. Placebo effect maybe? I made a clean install!!!
[Nexus 5 Android Development] chdloc:
Just applied the update. Without the mod in place, the camcorder still sounds unacceptable to me. Whether it has improved at all or not (compared to pre-5.1.1), I cannot say.
[Nexus 5 Android Development] MrMarques01:
Seriously? You can't even read the last page?
[Nexus 5 Android Development] Flyview:
Is the latest aroma installer still this one?

http://xdaforums.com/showpost.php?p=59392397&postcount=627
[Nexus 5 Android Development] AvivEliyahu:
Had a bootloop after flashing it for some reason.. Flashed it and choose "stock" and then device was able to boot normally :/

Using stock android 5.1.1

Sent from my Nexus 5
[Nexus 5 Android Development] Flyview:
Any idea how much space you had left on system? You probably ran out of space. The same thing happened to me.
[Nexus 5 Android Development] AvivEliyahu:
Yeah I think I have an issue with that since adaway can't install saying no space left.. How can I make space? Since it's only stock with xposed :/

Sent from my Nexus 5
[Nexus 5 Android Development] Flyview:
Delete whatever system apps you feel comfortable with through Titanium backup. Deleting extra language keyboards seems not to have any bad effects, but make sure you un-check auto-update for them in Play Store or they might reinstall themselves.
[Nexus 5 Android Development] aeoveu:
You can delete Google Fit (and optionally keep all the keyboards, since it's irritating finding and digging out each and every single one) and gain ~10 MB of data in the system partition (leaving you with ~15 MB of usable space). Sufficient for installing this mod AND Viper4Android as well!
[Nexus 5 Android Development] Vitalyt:
aroma installer 5.1.1

plz rebuild aroma installer for 5.1.1 to have ability to rollback to 5.1.1 stock. thanks!
[Nexus 5 Android Development] chdloc:
There is no need for that since the relevant files have not changed between 5.1 and 5.1.1
[Nexus 5 Android Development] MrMarques01:
Since this question is going to be asked sonner or later: Do you think this mod will be compatible with Android M, provided that there will be a working root solution?
[Nexus 5 Android Development] chdloc:
All relevant library files (audio.primary.msm8974.so, etc) of the M Preview are significantly larger than their Lollipop counterparts, at least in part due to larger symbol tables.

This means that, unless source code becomes available, the camcorder mod will not work on this or any of the future M Preview builds.
[Nexus 5 Android Development] drago10029:
I love you!! I 've wanting, even asking for sound, telephone mods!! anyway you can create a equalizer that modifes in call sound? Please and I will have your baby!
[Nexus 5 Android Development] chdloc:
Unfortunately, audio of cellular telephony never reaches user-space. Hence, the only hope one would have is to use the hardware filters available in the Snapdragon and/or WCD9320 audio codec. I have started some work around hardware audio filtering for headphones. Theoretically, this could also work for in-call audio...
[Nexus 5 Android Development] Grachasaurus:
Seems to be working fine on Euphoria [April 28 build] :D
[Nexus 5 Android Development] winamp26:
Hi can you add lolliviper to your mod?

If can its be awesome mod
[Nexus 5 Android Development] mcgrave:
Can I also install this mod with TWRP?

Verstuurd vanaf mijn Nexus 5 met Tapatalk
[Nexus 5 Android Development] drago10029:
read the other post you linked me to, amazing what you able to accomplish by digging into the codecs, much respect! and I hope you can completely decode what Qualcomm isn't willing to share with us. I have worked backed up but am gonna make sure to read that thread, super interesting stuff, for real!

If you need testers for anything send me a shout, I'm not afraid or bricking since I'm super cautious anyway and I wanna ask 2 things.

What programming language's (since I'm assuming you know code) can I learn to also mess with audio? android innnards/hardware?

Thanks again [MENTION=2760454]chdloc[/MENTION]
[Nexus 5 Android Development] chdloc:
I may look into doing that when it is time to update the installer. Generally, though, I would not add anything to the mod unless I find it useful.

My personal opinion on sound mods in general is: unless you know what you are doing, they are more detrimental than helpful to faithful sound reproduction.

Well, I always go the manual route, but TWRP is the second-best way to go.
[Nexus 5 Android Development] chdloc:
This is a loaded question. Can you expand on what you mean by "messing with audio"?

On the Android side of things, the relevant code is all in c/c++.
[Nexus 5 Android Development] mcgrave:
So aroma installer is not necessary to have? :)

Verstuurd vanaf mijn Nexus 5 met Tapatalk
[Nexus 5 Android Development] chdloc:
No, pushing the modified libraries can be done with adb and configuration files can be edited locally with vi (command line editor) or your file manager of choice.
[Nexus 5 Android Development] drago10029:
thanks, and lol not loaded the "can I also learn to mess with audio was just a non sense extension of the first questions about which programming language. But you already answered it thank you! You recommend any free places online to learn it?
[Nexus 5 Android Development] chdloc:
Sorry, I cannot help here. I learned coding the old fashioned way by working through the classical books on C/C++ by Kernighan & Ritchie as well as Stroustrup.
[Nexus 5 Android Development] drago10029:
fair enough, I look forward to your work!
[Nexus 5 Android Development] winamp26:
hi

i finally add viper$android on your flashable zip.

but for now you add

#Viper4android
lpa.decode=false
tunnel.decode=false
lpa.use-stagefright=false
lpa.releaselock=false

manually after last line in biuld.prop

@chdloc if let me upload it.
[Nexus 5 Android Development] markdapimp:
Does this mic issue look like it's hardware related or software bug that google can fix?
[Nexus 5 Android Development] rockknee:
Well it's already fixed here so it must be hardware related, right? :D I assume you're talking about the mic issue with camcorder.
[Nexus 5 Android Development] markdapimp:
a signal path that seems to bypass noise suppression when the camcorder is used

Just a mod to fix something that's clearly hw issue?

Maybe :confused:

Also: http://xdaforums.com/showpost.php?p=54627207&postcount=14

Does nothing for Audio-calls
[Nexus 5 Android Development] AvivEliyahu:
Hey I want to flash a speaker volume mod but I don't want this mod to get ran over by it.. Any idea which values to change after I'll flash the speaker mod to enjoy the speakers +better voice on videos?
[Nexus 5 Android Development] rockknee:
I'm not sure wheter there is possibility to change the noise suppression algorithm (whatever is the correct name) by Google. I guess it could be said more like the software is not just well optimized for the hardware.
[Nexus 5 Android Development] chdloc:
<path name="voice-rec-mic-mod">

<path name="handset-mic" />

<ctl name="ADC1 Volume" value="15" />

<ctl name="DEC6 Volume" value="88"/>

</path>
[Nexus 5 Android Development] AvivEliyahu:
Pasting it in the mixed path file after flashing speakers mode?
[Nexus 5 Android Development] chdloc:
From an acoustic front end standpoint the two use cases, camcorder and telephony, have different requirements. It appears to me that the issue here is both hardware and software related.

For camcorder use, the microphone gain needs to be cranked up significantly to be able to capture sound sources that are far away. High microphone gain also means an amplification of the acoustics front end's self noise. Ideally, you want to use a very low-noise microphone, which of course, is not cheap. Unfortunately, the Nexus 5 does not use high-end components throughout. Hence, LG/Google decided to compensate the higher-noise microphone they selected with (way too aggressive) noise suppression.

On the telephony front, handsets now mostly use two microphones for more efficient background noise suppression. The AOSP source code indicates two microphone array processing techniques, i.e. endfire (stock setting in build.prop) and broadside. An endfire configuration typically requires a smaller microphone spacing than we have on our Nexus 5, unless there is yet another microphone right next to the main handset microphone.

It seems that the main problem most people are facing is their own voice getting attenuated. This could be due to the software not working ideally due to the unusually large microphone spacing. Note that all telephony-related signal processing is done inside Qualcomm's S800, and not all phones that use this chipset seem to suffer from the described problems.

A second aspect with respect to voice cancelation is related to the acoustic echo canceler (AEC). I have addressed this issue along with some suggestions what an end-user can do to alleviate some of the problems in an earlier post. Again this signal processing is done in the S800 and other phones that use this chip seem to be doing OK in the telephony department. So, there may be some underlying hardware, or physical design issues.

Alternatively, there is a high possibility that LG simply did not spend too much time on tweaking the parameters controlling the audio signal processing offered by the S800.
[Nexus 5 Android Development] chdloc:
Yes
[Nexus 5 Android Development] markdapimp:
This may lead to What Apple had done with the iPhone 4 with the death grip, Saying you're holding it the wrong way

So apparently jamming the phone as close as to your face as possible works, No gap, Screen to face
[Nexus 5 Android Development] aeoveu:
Quick question:

When I flashed the zip file (using the default gain settings), the gain was actually a little quiet.

When I installed using the gain setting 100, it was just as loud as the stock settings - but with less noise supression (as in - the gain was nice and loud enough, without it sounding like water).

I decided to reflash it using 95 as the setting that's in the middle of the road (not too gained, not too quiet). Would it be possible for that to be the new setting? I think it should strike a decent balance IMO.

And thanks for the mod - appreciate it :)

PS: if my understanding is correct, this stops the second mic from doing its modjo. What if - and this is coming from a non-developer - the second mic was used for stereo video recording? Is that possible (at this moment in time)?
[Nexus 5 Android Development] chdloc:
Thanks for sharing your gain settings!

I'd say, let's wait for others to chime in with their preferred settings before we make a decision which one seems to work best.

We need to keep in mind, though, that typical microphone tolerance is (in this quality bracket at least) +/- 3dB, so one setting that works for one may not work for somebody else. This means that in the extreme case, the recorded "loudness" may vary by at least 6dB from phone to phone. That's a lot and may make general recommendations difficult.

You already have your optimum setting, so just keep it in your mixer_settings.xml file...;)

With respect to stereo recording. This is a good idea which I gave already gave some thought to. Even though the microphone spacing is a little small for typical A/B stereophony, it may just work.

There are two problems with this at the moment:

1. The two microphones may be very different in terms of sensitivity and frequency response which has ramifications in terms of the stereo image. This issue could be dealt with in software, though.

2. The software framework is written for a single channel only as far as I know. This can certainly be changed. Maybe one of the big-boy ROM devs would be interested in looking into this?
[Nexus 5 Android Development] aeoveu:
My reason for toning it down to 95 overlaps your explanation slightly - for me, I wasn't sure if distortion would be introduced at 100, so I brought it down intentionally.

All I need to do is stand in front of an aeroplane and then test out the levels ;) I don't see that happening anytime soon, so I need to look for a crying baby. Anyone willing to volunteer? Hehe
[Nexus 5 Android Development] Eduardo C.:
Finally we have a full working N5...

Thanks a billion!!! :laugh: :good: :good: :good:
[Nexus 5 Android Development] drugusv:
can i install this patch if my phone is not rooted?
[Nexus 5 Android Development] rockknee:
No
[Nexus 5 Android Development] drugusv:
sad :(
[Nexus 5 Android Development] rockknee:
Yes it is. It's just impossible to write/make changes to /system partition without root.
[Nexus 5 Android Development] kevev:
Thanks Chdloc for your sweet mod. Would you by any chance know how we can prevent incoming calls from switching to speaker phone after unplugging a headset? All other Android devices I have owned will not do this. Kind of embarrassing when unplugging my headset in the middle of a call and the device switches to speakerphone instead of built-in earpiece.

Sent from my Nexus 5
[Nexus 5 Android Development] chdloc:
I never noticed the bug you are describing, but I was able to reproduce it.

So I looked at the logcat upon disconnecting the headset. The following (I think relevant) messages come up:

I/AudioRouter( 1191): Audio mode changing to EARPIECE

D/AudioManagerAndroid( 2368): ==> onReceive: s=0, m=1, n=h2w, sb=false

D/AudioManagerAndroid( 3183): ==> onReceive: s=0, m=1, n=h2w, sb=false

D/AudioManagerAndroid(10936): ==> onReceive: s=0, m=1, n=h2w, sb=false

W/AudioService( 781): Audio Settings Permission Denial: setSpeakerphoneOn() from pid=10936, uid=10056

W/AudioService( 781): Audio Settings Permission Denial: setSpeakerphoneOn() from pid=3183, uid=10041

D/AudioManagerAndroid(10936): reportUpdate: state=1, devices=[Speakerphone, Headset earpiece]

D/AudioManagerAndroid( 3183): reportUpdate: state=1, devices=[Speakerphone, Headset earpiece]

D/AudioManagerAndroid( 2368): reportUpdate: state=1, devices=[Speakerphone, Headset earpiece]

What is very interesting here is that there are three processes querying the state of the audio subsystem, i.e.

pid=2368, pid=3183, and pid=10936. They correspond to "com.google.android.talk", "com.google.android.gm",

and "com.google.android.apps.magazines", respectively. Further, it seems that pid=3183 and pid=10936 are trying to turn

on speakerphone, but are denied to do so. So my theory is that pid=2368 ("com.google.android.talk", i.e. Hangouts)

tries and succeeds to turn on speakerphone, but that operation is not reported in logcat. Just the fact that, indeed,

the speakerphone mode is enabled is noted.

To test that theory, I restarted the phone to start from a clean slate and immediately started a call which was routed to the

headset. Upon disconnecting the headset, the call was then (correctly) routed to the earpiece rather the speakerphone. After

sending my first text using Hangouts (receiving messages does not seem to trigger the bug), calls get routed to

speakerphone upon disconnecting the headset. After killing Hangouts ("kill -9 2368") calls get routed correctly again.

Hence, my theory seems to be correct. At least in my case.

So how to fix this without having to dig into source code?

If you can confirm my theory, I'd say you have three options:

1. Wait until an update to Hangouts fixes this (may take a while, possibly need to post a bug report)

2. Don't use Hangouts

3. Use Tasker to either explicitly disable speakerphone when the headset is disconnected or kill Hangouts during a call

(not sure whether you need root for this to work)
[Nexus 5 Android Development] chdloc:
You can absolutely share the zip you created. But please upload it to this thread only if

the installation of Viper4Android is made optional much like any of the other options that the current mod offers, and

you agree to attend to all questions regarding Viper and/or your zip

Please know that I do not endorse the use of Viper or any other "black box" sound playback "improvement" mod.