yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] chdloc:
First of all, I do not have a Nexus 6, so I have no way of testing on-device.

The stereo mod will not work as is. I looked at the two files that need modification, i.e. /system/etc/media_profiles.xml and /system/etc/mixer_paths.xml

While the former one is easy to modify, the latter one (the mixer) is considerably more difficult, but I'm relatively confident that stereo recording is possible.

Although there are five ADC devices defined (one being the headset mic), there are only two being used, so contrary to what I've read, the Nexus 6 does

not use four microphones for noise cancellation.

Please PM me (you or anyone else having a Nexus 6) if you are interested in trying a few things I can think of.

But please advised that you need to be comfortable using the Android shell to edit and copy system files.
[Nexus 5 Android Development] kaikupascual:
The fix camcorder mod for CyanogenMod 12???, in CM12 I have the problem, the sound of video recorder is horrible when pass a car for example or wind... sound glbglglblglblglbfgfgfg like as underwater...
[Nexus 5 Android Development] chdloc:
Follow the link in the OP to a (simple) fix for CM11. Maybe it works for CM12 as well.

I do not plan on maintaining this mod for ROMs that modify the audio HAL, such as CM or its derivatives as it quickly becomes a support nightmare.
[Nexus 5 Android Development] kaikupascual:
Thanks!!

I think that this fix is very important for all ROM's, CyanongeMod is the most important ROM and much ROM's are done using CM12 as base... is a big and great job, thanks!!

EDIT: The fix for CM11, not work, no sound and Galley crash when open a video...
[Nexus 5 Android Development] SummerBoyz:
Right, once i free to do so, i will pm you. Thanks
[Nexus 5 Android Development] nerotic:
I've had my N5 for about a year now and everything was fine until last night when something went wrong with my mic input levels. I was getting nothing in calls or video recording.

I flashed stock files but that didn't fix anything. Then I flashed the camcorder mod and upped the gain and video recording is now perfect. However like the previous poster, I still don't have volume when using the mic during calls but can use hands free just fine.

What would I have to edit to increase the gain for handset calls?
[Nexus 5 Android Development] vaindil:
I'm sorry, this is probably a stupid question but I'd like to make sure. To revert back to normal settings, I just rerun the installer, select to install the stock libraries at the first menu, then select mono playback (the stock option), then hit Install Now? To clarify, I'm flashing the 5.0.1 zip from this post.

I'm having MAJOR issues with the Hangouts Dialer so I'm reverting to check whether this is the problem.
[Nexus 5 Android Development] chdloc:
What ROM/kernel combo are you running? Has that recently changed?

To me it sounds like the main microphone port may be clogged with dirt, lint, etc. It is also possible that the microphone itself is defective.

You can use your phone in speakerphone mode as the microphone switches from the main microphone to the "auxiliary" one (the one by the headphone port) in that context. Try flashing the stereo recording camcorder mod and analyze a recording. Do the two channels exhibit (roughly) the same level in the recording?

If they do sound like they are equal, then there may be a problem with the dual-microphone processing for telephony (is your earpiece level really high?), which cannot be truly fixed with increasing the gain., and I don't really recommend going that route as you will more likely than not introduce echo to your TX signal

Things to test to rule out algorithmic problems

is the TX level low when making Hangout calls?

does the TX level increase when you lower the earpiece gain?
[Nexus 5 Android Development] chdloc:
Yes, this is how it is supposed to work.

Is your problem related to incoming calls not connecting?

I've seen that, too, and I think I have traced the problem (at least on my phone) to face unlock interfering with setting up the call.

Making outgoing calls was unproblematic.

I had that issue with and without my mod in place.

I'd be happy to revisit this issue if necessary.
[Nexus 5 Android Development] vaindil:
I'm not having a problem with incoming calls as far as I'm aware. The first problem is that I sometimes hear a very clear, distinct echo of my voice coming out of the earpiece, a few seconds delayed. Makes it very difficult to talk to anyone. The second problem is that people typically cannot understand me at all, and I have to call back using the normal phone dialer. (That still uses my GV number, but I'm on T-Mobile's $30 plan so I have limited minutes each month.)

I reverted to stock then placed an outgoing call to my friend, he said it sounded almost normal but like I was reaching the mic threshold and it was clipping. I then received an incoming call from a business regarding an appointment, and the receptionist did not indicate that she was having difficulty hearing me (whereas when I called her just before reverting back she couldn't understand a word I said).
[Nexus 5 Android Development] nerotic:
ROM and Kernel are stock.

3 questions:

1) How would I analyze the recording?

2) How do I measure the TX level?

3) Modify the gain using the flashed zip I assume?

And thank you so much for taking the time to respond to me :) It's greatly appreciated.
[Nexus 5 Android Development] chdloc:
I cannot reproduce the issue you are describing on my phone. My TX levels are nice and strong. Did you have these issues intermittently or pretty much constantly?

You mentioned that you can hear your own voice "a few seconds delayed". I don't think it is possible to have a delay that long, unless you called somebody overseas (even then, a second would be long). What you are describing is echo, either network echo or acoustic echo introduced on the other end. I don't think the echo that you are hearing comes from your phone.

Routing calls through Hangouts (formerly Google Voice) is known to be iffy. I have experienced numerous instances of echo. Also, packet loss is very common, which will make a conversation very difficult. In my experience, unfortunately, Hangouts (a VoIP service, really) is no real alternative for making reliable phone calls as bandwidth is not guaranteed and congested networks can really kill voice quality.

1) use a sound recording app that allows you to chose the "Camcorder" device as its input, such as "Easy Voice Recorder Pro" or "Voice Recorder". This way the same exact mixer settings as used for a camcorder will be applied. These two pieces of software allow for stereo recordings if the stereo mod is installed.

Download the recordings to your PC and look at the level differences with an audio editing software, such as "Audacity" (free)

2) For our purposes it is probably enough to eyeball the levels; Audacity would be capable of calculating the levels accurately.

For evaluating Hangouts calls I would just call somebody and let him/her evaluate the levels for you.

3) Yes, you can increase the levels of cellular TX, but you would have to edit mixer_paths.xml manually. I would go there only as a last resort.
[Nexus 5 Android Development] winamp26:
Hi

After flash http://http://xdaforums.com/google-nexus-5/themes-apps/smooth-scrolling-mod-mahdi-rom-t2831848 aMGC doesn't work

Is aMGC not compatible with other mod?
[Nexus 5 Android Development] krneki10:
Could you please share your recommended settings for Aroma installer? May I just simply reflash it if I decide to change settings?
[Nexus 5 Android Development] chdloc:
By "not working" you refer to the UI not showing up anymore?

The only thing I know about the "smooth scrolling mod" is that it modifies the framework.

I don't know why and how that could mess with aMGC.

Yes, you can reflash the mod with modified settings. The default values are merely suggestions. I chose the gains (ADC/DEC = 15/103) to arrive at recording levels that closely match stock. You may want to lower those gains if you expect to record in noisy environments frequently.

My current settings are stereo capture and playback with 6 dB of noise suppression with default gains.
[Nexus 5 Android Development] fatiko85:
This mod is compatible with rom Euphoria OS?

I know this mod is functional for rom stock but i am asking if someone has tested in euphoria.
[Nexus 5 Android Development] slobo2712:
If xTraSmooth rom uses this mod than is really bad...

https://www.youtube.com/watch?v=l4jEAf9vytQ
[Nexus 5 Android Development] chdloc:
You need to bring the recording levels *way* down if you want to record anything useful in a live concert, especially

bass-heavy music.

In trying to make aMGC better I found that distortion gets increasingly worse with decreasing frequency, so my previous recommendation to simply observe the VU meter and avoid seeing a red LED does not seem to apply when recording very bass-heavy sounds. It is almost as if there is no DC offset filter anywhere in the microphone path.

More proof that there were significant corners being cut in designing the Nexus 5.

I'll see whether there is anything I can do to detect instances of bad distortion and alert the user.
[Nexus 5 Android Development] winamp26:
Yes don't show ui for change dB and no change led color
[Nexus 5 Android Development] elinho:
Im really excited about this mod. But im a bit confused. All those files..

How do I install this to get the UI mic gain in my camera?

Can any nice soul give me a step by step?
[Nexus 5 Android Development] chdloc:
Has aMGC worked before you installed the smooth scrolling mod?

(You are running the advanced version of the camcorder mod, right?)

Does aMGC work as expected if you revert the smooth scrolling mod?

It would greatly help in debugging this if you ran Tasker or SuperSU Pro.

I would actually recommend spending the little amount these apps cost to

anyone as either of them are infinitely useful.
[Nexus 5 Android Development] chdloc:
OK, fasten your seatbelt...;)

At a high level, make sure that you

install the advanced camcorder mod (I suggest 6 dB of noise suppression) from here

install aMGC from here ;

if you have access to Tasker (preferred), import the project (CamcorderMGC.prj.xml.gz -> decompress to CamcorderMGC.prj.xml),

otherwise install the apk (CamcorderMGC.24.apk)

follow all instructions in the Prerequisites section

Detailed instructions on how to install tinymix:

Download tinymix.gz and decompress the file (XDA does not allow binary attachments). You will see a file called tinymix

Copy to your sdcard

adb push tinymix /sdcard/

open an adb shell

adb shell

in the adb shell ($ denotes the shell prompt, "normal user")

$ su

give the shell root privileges through SuperSU if necessary. If successful, you will see the root prompt, i.e. #.

Then make system partition writeable:

# mount -w -o remount /system

Copy the tinymix binary to /system/xbin/

# cp /sdcard/tinymix /system/xbin/

and make the binary executable

# chmod 744 /system/xbin/tinymix

Remount the system partition read-only

# mount -r -o remount /system

Detailed instructions on how to install the shell scripts:

Download the archive containing the necessary shell scripts (shell_scripts.tar.gz), and unpack the archive. You will end up with three shell scripts,

i.e. adjust_gain.sh, evaluate_microphone_level.sh, and reset_leds.sh. In the below I will refer to the three scripts jointly as script.sh.

Hence, you will need to repeat the following steps for all three files (except where noted), while replacing scripts.sh with the actual file name.

Push script to sdcard directory

adb push script.sh /sdcard/

open an adb shell

adb shell

in the adb shell ($ denotes the shell prompt, "normal user")

$ su

give the shell root privileges through SuperSU if necessary. If successful, you will see the root prompt, i.e. #.

Create the directory /data/local/tmp/camera (you only need to do this once)

# mkdir /data/local/tmp/camera

Copy the shell script to the just created directory

# cp /sdcard/script.sh /data/local/tmp/camera/

and finally, make the script executable

# chmod 744 /data/local/tmp/camera/script.sh

Remember to repeat these steps for all three shell scripts.
[Nexus 5 Android Development] otavioricciotti:
I recorded a video to test OIS (my mom driving: shaking machine.) and got a really bad audio. It's hard to describe. Please watch it.

https://docs.google.com/file/d/0B87i-uIvsOzOM1BvaGZrQXJCams/edit?usp=docslist_api

Any way to solve this "bug"?

Recorded in a small city in Brazil :)
[Nexus 5 Android Development] chdloc:
Were you using aMGC during that recording? What were your ADC and DEC gain settings?

The sound inside a moving car contains a lot of energy at very low frequencies. The acoustic front-end of the Nexus 5 distorts badly when presented with very low frequencies (less than around 50 Hz), even at relatively low levels. This seems to be a hardware limitation. The only way around this is to lower the microphone gain significantly, i.e. on the order of 30 dB or more.

I'm currently trying to find some rules in order to "deal" with this issue while using aMGC.
[Nexus 5 Android Development] winamp26:
yes its work.

yes i follow Instructions.

dont test it.

ill revert smooth scrolling and tell you

tnx
[Nexus 5 Android Development] 21plays:
Will this mod play nice with FauxSound Audio/Sound Control? Or does having one defeats the purpose of having the other? thanks
[Nexus 5 Android Development] otavioricciotti:
Settings:

Stereo (usb to the right)

288kbps

95 dB mic gain

Ear speaker 95 dB

Bottom speaker 92 dB

I didn't use any app. Just opened Google Camera from lockscreen and started recording.

Is possible to get a dynamic mic gain? But something that isn't manual. Sometimes we just want to open an app and record a nice video.
[Nexus 5 Android Development] chdloc:
I'm guessing you will be running into issues when you try to run both, but I don't know. I'm not running (and never will) any "generic" audio mods.

Levels can be adjusted by manually (and moderately) adjusting mixer_paths.xml. Other sound modifications are mostly subject to personal preference

and generally do not result in any objectively quantifiable improvement. I'm personally only interested in linear sound in and linear sound out.

Yeah, you need to lower you mic gain significantly when recording bass-heavy sounds. I'm guessing your analog gain is ADC=15 (default).

In bass-heavy acoustic environments (such as a moving car, live music events, etc) you may want to set the gains to something like

ADC=5 and DEC=80 (which would be around 30 dB lower than what you have currently set).

My aMGC (assisted manual gain control) app aims at providing clues as to what gains should be set during a recording (and actually applies

the new gains on-the-fly). aMGC is not really an app, but a background service with on-screen floating UI that shows up automatically when

the camcorder is recording. I'm still in the process of working out further details to make this app more useful, in particular with respect to

low-frequency sounds.

I have played around with full AGC (automatic gain control) as provided by Qualcomm and AOSP (two different approaches). As I stated in an

earlier post, I don't think that either of them is at all useful for camcorder (or generic audio) recordings as they more often than not adjust the

gains wildly all over the place. Hence it comes as no surprise that both of them are completely disabled by default by any Nexus device. OEMs

may have implemented their own (better?) solution.

There is, theoretically, the possibility to integrate or develop yet another AGC algorithm, but the time and effort required to achieve this

is *way* beyond what I'm willing to invest.
[Nexus 5 Android Development] marquimsp:
I too have never used "audio enhancers" , I just listen to good audio files and use a decent pair of earphones (shure se-535). How can one improve the sound of, say, the white album using a glorified Eq of a few megabytes? Buying very good transducers, while expensive at first, proves to be a fantastic long term investment.
[Nexus 5 Android Development] Yakandu:
Since i isntalled this mod, while in call, if the headphones are pluged in, the mic doesnt work... strange
[Nexus 5 Android Development] chdloc:
FYI, http://xdaforums.com/showpost.php?p=58147369&postcount=1
[Nexus 5 Android Development] chdloc:
Sorry, I cannot reproduce the problem you are describing. Please share your mixer_paths.xml file.

Also, please share the output of the following adb shell command executed while plugging in a headphone during a call

logcat | grep audio_hw_primary
[Nexus 5 Android Development] otavioricciotti:
[MENTION=2760454]chdloc[/MENTION] I'll try usign your solution to help me with video recording. Maybe it won't be so useful with Snapchat (since we have to hold the record button). For sure you are doing an amazing work to fix what Google wasn't capable of. Good luck in your work.

Thanks for supporting :)
[Nexus 5 Android Development] chdloc:
Hmm, I don't see anything wrong with your setup. A few questions remain:

What happens if you plug in another pair of headphones?

Does your microphone work OK when you are on cellular speakerphone?

When you remove the camcorder mod, does the microphone come back to life when you plug in headphones during a call?

Please share a full logcat, maybe there are other clues that are not tagged with "audio_hw_primary"...?
[Nexus 5 Android Development] Yakandu:
With all my headphones the same happened

Yes, it works ok when nothing is pluged

I flashed the stock system.img, i'll do my tests today and i'll share them later

That was the full logcat, I called, then opened ADB in windows CMD, then logcat, then finished the call, then copypaste XD
[Nexus 5 Android Development] chdloc:
With full logcat I meant omitting the " | grep [...]" part (and adding time information), i.e. run

logcat -v time

Now that you have reverted to stock (LRX22C, right?), you can do a before and after comparison.

Actually, run the following command as root to also include the kernel messages for more clues

cat /proc/kmsg & logcat -v time
[Nexus 5 Android Development] riscanudinu:
yes somehow i am using this mod 6db noise supresion 95 mic gain and elementalx kernel .in faux sound app i turned all the way down camera microphone(-30)

and now all people hear me perfect,and i dont have to talk loud.for me it's the best solution
[Nexus 5 Android Development] spacetaxi:
New installer available

I've posted the new installer: http://xdaforums.com/showpost.php?p=56872432&postcount=235
[Nexus 5 Android Development] gpvecchi:
Many thanks for the new update! Unluckily this still gives me bootloop with Dirty Unicorns ROM... Any idea why? Thanks!
[Nexus 5 Android Development] chdloc:
This mod will only work on stock Lollipop ROM and those that closely follow AOSP.

(We really should compile a list of working ROMs)

I suspect one of the core libraries (audio HAL and/or libaudioflinger) to be incompatible with your ROM.

You can find clues by looking at your logcat while your ROM is boot-looping, provided the loop does not occur at the kernel level.
[Nexus 5 Android Development] chdloc:
Please, everyone using or trying to use this mod

Let us know how this mod is working for you.

Here is my entry:

ROM: stock LRX22C

Kernel: self-built AOSP/stock with telephony-related modifications

working as claimed: yes

if not working - what problems are you experiencing: N/A

version of this mod installed: LRX22C_v2; stereo recording (6 dB noise suppression) and stereo playback w/ default settings and aMGC w/ Tasker

other sound mods installed: none
[Nexus 5 Android Development] spacetaxi:
ROM: Cataclysm, Jan 23, Stable

Kernel: CodeBlue, r822 (stable)

working as claimed: yes

if not working - what problems are you experiencing: N/A

version of this mod installed: LRX22C_v2; mono recording, mono playback, 6dB noise suppression, aMGC w/ Tasker

other sound mods installed: none
[Nexus 5 Android Development] adnan.selimagic:
ROM: stock LRX22C

Kernel: stock

working as claimed: yes

if not working - what problems are you experiencing: N/A

version of this mod installed: LRX22C_v2; 6dB noise suppression mono recording, stereo playback, aMGC w/ Tasker

other sound mods installed: non
[Nexus 5 Android Development] Matrix_19:
ROM: stock LRX22C

Kernel: stock

working as claimed: yes

if not working - what problems are you experiencing: N/A

version of this mod installed: LRX22C_v2; 6dB noise suppression mono recording, mono playback, aMGC w/ Tasker

other sound mods installed: non
[Nexus 5 Android Development] indigobv:
ROM: stock LRX22C

Kernel: stock

working as claimed: pretty much

if not working - what problems are you experiencing:

Everything works fine, but logcat is filled with audioflinger errors reporting microphone_level_RMS_db values. Here is a part of my logcat during video recording.

01-23 16:11:49.346: E/AudioFlinger::EffectModule(184): microphone_level_RMS_dB:	avg:	-54	peak:	-50
01-23 16:11:49.547: E/AudioFlinger::EffectModule(184): microphone_level_RMS_dB:	avg:	-55	peak:	-51
01-23 16:11:49.746: E/AudioFlinger::EffectModule(184): microphone_level_RMS_dB:	avg:	-54	peak:	-48
01-23 16:11:49.946: E/AudioFlinger::EffectModule(184): microphone_level_RMS_dB:	avg:	-54	peak:	-50
01-23 16:11:50.146: E/AudioFlinger::EffectModule(184): microphone_level_RMS_dB:	avg:	-54	peak:	-49
01-23 16:11:50.349: E/AudioFlinger::EffectModule(184): microphone_level_RMS_dB:	avg:	-49	peak:	-44
01-23 16:11:50.546: E/AudioFlinger::EffectModule(184): microphone_level_RMS_dB:	avg:	-43	peak:	-40

version of this mod installed: LRX22C_v2; 6dB noise suppression mono recording, mono playback, aMGC w/o Tasker

other sound mods installed: Viper4Android (TestLolliViPER_v2.3.3.0) - it requires driver reinstallation if installed before camcoder mod.

About this change: "aMGC: takes advantage of the fact that true RMS values are reported by libaudioflinger and considers the peak values for UI feedback.", it doesn't seem like a good idea. I mean how are this values supposed to help me? Wouldn't be better if only the LED would change it's color based on this, and keep the UI showing the current gain like it used to? It seems redundant if you ask me, showing the same thing in two different forms, unless this is for debugging purposes, of course.

Anyway, it's my opinion, you can do whatever you wish.

L.E. I've tested the mod with Cinema FV-5 and found that if the "Encoding format" is set to anything other than AAC-LC the UI shows "Level_dB dB" instead of the actual value.
[Nexus 5 Android Development] chdloc:
This is by design. aMGC reads the values reported by libaudioflinger for UI display every 200ms. I chose these values to be assigned the "error" tag

so that it shows up in logcat by default. Again, simply a design decision that should have zero impact on the rest of the system.

Note that these audioflinger logs will show up only if the CAMCORDER device is being used.

As you suggest, I originally added this redundant information for debugging purposes, but I thought it would give the user

some more fine-grained information as to how close the microphone is from clipping, which is extremely important for recording

high-volume and/or low-frequency sound fields. The "yellow" range (ideal) covers 12 dB and the "orange" range covers 12 dB (good, but risky).

Highly dynamic sound fields blow through 12 dB and even 24 dB very quickly.

I can certainly revert that change if the majority of folks prefer the old style. Let me know.

BTW, you can still view the current gain by tapping on the area between the up and down arrow, so no information is lost.
[Nexus 5 Android Development] indigobv:
I thought that was the case since it wasn't an actual error message, but I thought I would mention it, just in case.

Well that's something I didn't know about and I actually like the idea. I only mentioned that because I thought the only way to view the current gain was to change it. Then I guess there is no reason to go back.
[Nexus 5 Android Development] kaikupascual:
This mod is very necesary for CyanogenMod 12, the best ROM and base ROM of much other ROM's...

The CM11 FIX dont work on CM12, please, try to make a fix for CM12