yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] Pilatus47:
ROM: Cataclysm, Jan 23, Stable

Kernel: Cataclysm stock

Working as claimed: Absolutely YES!

What problems are you experiencing: N/A

Version of this mod installed: LRX22C_v2

Configuration used: Stereo recording (6 dB noise suppression and default mic gain). Stereo playback (92 ear speaker gain and 87 speaker)

Other sound mods installed: None

Those playback settings are working really good. I don´t have any distorsion at all. And it gives a good sweet spot to the "stereo" experience. Increasing the ear speaker a little bit maybe 1 more it would make the perfect stereo effect but I don´t know if it´s secure. Maybe I try it later, since I don´t have distorsion with the current settings.

Btw, I'm using poweramp for music playback with stock EQ settings.

Saludos
[Nexus 5 Android Development] krneki10:
Does this mod work with A better camera? It's one of the best camera/camcorder apps out there.
[Nexus 5 Android Development] chdloc:
Alright, tell you what:

Attached is the simple audio quality fix built from today's CM12 sources.

It does not offer any noise suppression and it does not support aMGC.

I have not tested it as I'm not running CM. I do not plan on building the

advanced fix nor maintaining the simple fix going forward as CM is too much of a moving target.

If you guys feel that this fix should be part of CM I suggest you make one of the Nexus 5

maintainers aware of it. I'd be happy to assist in pulling the necessary sources into the CM code base, if desired.

Installation

unpack the attached archive. You will end up with two files (actually four counting the CM12 stock ones),

i.e. audio.primary.msm8974.so and mixer_paths.xml

make a backup of /system/etc/mixer_paths.xml and /system/lib/hw/audio.primary.msm8974.so

(or your entire system partition)

push the two new files to their respective location and make sure that their permissions are set to 644 (rw-r--r--)

optionally adjust the microphone gain to your liking. The default values are ADC1=15 and DEC6=97

you may need to manually combine your mixer_paths.xml files and the attached one in case you have any other audio mod installed.

reboot
[Nexus 5 Android Development] chdloc:
The mod itself should work with any app that is requesting the "CAMCORDER" audio device, which should include any third-party camcorder app.

aMGC, however, currently only works with "Google Camera" and "Cinema FV-5". In order to support any other third-party camcorder app I would have to have it installed on my phone. I'd be happy to support additional free apps going forward, but I personally do not see the need to purchase any other camcorder app as Cinema FV-5 seems to be working great. We could crowd-source support for additional paid apps as anyone who has Tasker and the desired camcorder app installed can help add support for it.
[Nexus 5 Android Development] kaikupascual:
Thanks!!, more later I try this, I use CyanogenMod always, is my preffer ROM and the base ROM of much ROM's, I think that the fix for this ROM is Important, I dont know make this things...:eek: thanks again!
[Nexus 5 Android Development] marquimsp:
chdloc, is there a way to make the last used mic gain hold? I mean, everytime we start the camera mic gain is at 0dB, right? If we're at a concert we have to readjust to - 12dB everytime we want to record something.. Or am I doing something wrong?

I'm using cataclysm, elementalx, - 12dB nr and 90 dB gain. Stereo recording at 160 kbps and mono playback. Everything works well.

thanks!
[Nexus 5 Android Development] chdloc:
No, you are not doing anything wrong. Every time a camcorder recording is started the default gain values from mixer_paths.xml are applied.

I had thought about being able to (automatically or via UI interaction) apply the previously used gain, but I dismissed the idea because no two acoustic environments are alike. I think it is better to always start from known "square one". Imagine you recorded a loud concert yesterday and today you are recording your kid's recital. The notion of being able to apply the previous gain may be good for a small number of folks, but I think the majority of users are better served without this option. I also like to keep things as simple as possible.
[Nexus 5 Android Development] marquimsp:
you're right, this is the right way to do it... let me ask you, when we choose a value for mic gain (during installation), say, 90 dB, then we apply - 12 to it with aMGC is the same as choosing - 78 dB during installation?

I'm only asking because it seems to me that mic sensitivity is already too high, maybe 60 dB is enough for most purposes. What do you think? I'm trying to find a "set it and forget it" value lol...
[Nexus 5 Android Development] chdloc:
This is (almost) correct, see below.

If you are recording in mostly very loud environments, then your strategy may work. If you are recording mostly in "normal" acoustic environments, then your strategy will force you to apply gain to most of your recordings in a post-processing step.

There is more to the whole gain puzzle which I cannot completely solve as I do not have access to the microphone's or the codec's specs. I do not know when the microphone will start producing distortion nor when the codec will start clipping. (I would need to spend a lot of time in a lab to reverse engineer an answer.) What I do know is that we have two gains at our disposal, i.e. "ADC Gain" (which I think controls a PGA in front of the analog-to-digital converter) and "DEC Gain" which is simply digital gain after the signal has been converted to the digital domain.

Long story short, you will most likely also need to adjust ADC gain in loud environments to avoid clipping the analog-to-digital converter. I actually do do that within the aMGC service, where I reduce ADC gain (relatively) more than DEC gain.
[Nexus 5 Android Development] marquimsp:
one thing I just noticed today is that when I make calls using my earphones I can only hear the other side on the right. I uninstalled the mod to check and then I could hear the caller on both sides of my earphones.

Just FYI. It's not a big deal.
[Nexus 5 Android Development] kaikupascual:
Work correctly:good::laugh: I have a recorded videos with your FIX and the sound are correct, no "glbglbglblglbhgss" background:cool:

You can include this fix in the first page for CM12 users... thanks again!:good:

Tested with Official CM12
[Nexus 5 Android Development] chdloc:
Thanks for pointing out this bug!

I had left a couple of debug entries in the mixer_paths.xml file.

Please delete the following line:

<ctl name="RX1 Digital Volume" value="0" />

from the device sections "speaker-mic", " voice-speaker-mic", "speaker-mic-aec", and reboot.

I'll update the post containing the mod tomorrow.
[Nexus 5 Android Development] panpiotus:
ROM: Cataclysm, Jan 23, Stable

Kernel: 3.4.0-Elementalx 2.05

working as claimed: no

if not working - not working microfone with Cyberion Voice Commander (not hear commands)

version of this mod installed: LRX22C_v2; mono recording, mono playback, 6dB noise suppression, no aMGC script

other sound mods installed: none
[Nexus 5 Android Development] krneki10:
[MENTION=2760454]chdloc[/MENTION] have you seen this yet http://xdaforums.com/google-nexus-5/themes-apps/mod-best-audio-mod-nexus-5-fosseperme-t2621736 ? Perhaps you can merge it with your own mod ;)
[Nexus 5 Android Development] chdloc:
So you are saying that the camcorder mod does not work at all for you or only that the mod is

introducing issues with the Cyberion app?

If you are only having issues with the Cyberion app I suggest you run a detailed logcat while you are trying to use

Cyberion

logcat -v time

and post the output here (or send it to me via PM).

A few more questions:

are you still having issues if you install the "simple" mod without noise suppression?

can you change the microphone source and/or sampling rate from within Cyberion?
[Nexus 5 Android Development] myfluxi:
[MENTION=2760454]chdloc[/MENTION]: As you are deep into this, can you check the mixer_paths part of this commit for compatibility with AOSP.

https://github.com/myfluxi/android_...mmit/53dba09dd892e92395e6f046ec44b41091c87858
[Nexus 5 Android Development] panpiotus:
When i back to stock settings Cyberon Voice Commander works OK
[Nexus 5 Android Development] chdloc:
There are a number of changes proposed in the mod (mixer_paths.xml only) that you are referring to that I would not feel comfortable

suggesting for the average user. In particular all gain changes that have an effect on telephony. While levels may increase, the probability

of echoes and double-talk problems will increase as well. The other proposed changes (pertaining to the loudspeaker and headphones)

seem very dependent on user preference.

Increasing gains will likely increase distortion and I would not have any generally applicable gain change suggestion (quality vs. level).

Changing these gains manually with Root Explorer (or similar) is easy enough. Better yet, use the tinymix binary that I posted earlier in this thread

to change gains on-the-fly in order to find out your preferred value. Note your optimum levels and copy them to your mixer_paths.xml.
[Nexus 5 Android Development] spacetaxi:
updated installer available

I've posted an updated installer including bug fixes for mixer_paths.xml as mentioned in post #530. The updated installer is available from post #235.
[Nexus 5 Android Development] chdloc:
I'm not disputing that. Any other input with respect to my remarks/questions above?
[Nexus 5 Android Development] chdloc:
Looks good to me.

A few comments/questions:

what is the use-case for "handset-stereo-dmic-ef"?

your default gains seem overly hot to me, you will quickly run into clipping/saturation issues.

I really like the idea of being able to modify device acdb identifiers via an xml file.

This means no more messing with the audio HAL required to select a different identifier for the CAMCORDER device.

from your mixer_paths.xml file it appears that you are defaulting to stereo recording when the camcorder is being used.

On hammerhead, there is some structured noise audible in the auxiliary microphone channel (left). I'm not sure where it comes

from, but it seems louder during a camcorder recording and somewhat softer (and different in nature) during an audio-only

recording. I did correlate some of the noise to mpdecision as it manipulates the processor cores. I am able to lower the noise somewhat by locking all four cores to 1.19GHz. At this point my best guess is that the analog microphone traces run close to some high-speed data signals that feed into the MSM. Long story short, you may not want to default to stereo recording as some folks may object to the noise.
[Nexus 5 Android Development] kaikupascual:
This work very perfect!!, today I have one video recorded without fix and other with fix, when the car pass for the road, the sound is horible... and the wind... but with the fix, the sound are correct:laugh:

Also work with "Surround Mod" mixing the mixedpath.xml, perfect perfect:good:
[Nexus 5 Android Development] myfluxi:
I am using the codeaurora version [1] of the audio HAL (well, their CM flavor [2] to be exact). handset-stereo-dmic-ef is used by some apps, such as WhatsApp.

Can you push your changes to github? This would make tracking, understanding and cherry-picking much easier. Uploading blobs is confident for the end user, but not for everyone else. You just had to clone the hammerhead devicetree and audio HAL from https://android.googlesource.com/device/lge/hammerhead/ and https://android.googlesource.com/platform/hardware/qcom/audio/ and probably https://android.googlesource.com/platform/frameworks/av/ as well.

[1] https://www.codeaurora.org/cgit/quic/la/platform/hardware/qcom/audio/log/?h=LA.BF.1.1.1_rb1.8

[2] https://github.com/CyanogenMod/android_hardware_qcom_audio/tree/cm-12.0-caf-8974
[Nexus 5 Android Development] AvivEliyahu:
It would be great if there was changing speaker and headphones (also earpiece would be awesome) volume instead of changing it manually after flashing the mod
[Nexus 5 Android Development] slobo2712:
I think this thread and first post is real mess with a number of files.Does this work with CM12 or not?
[Nexus 5 Android Development] chdloc:
Well, the latest update in the OP does link to the "simple" fix for CM12. Does it work? I don't know. I'm not running CM and I'll probably never will.

As of today the fix for CM12 has been downloaded more than 170 times, but only one person bothered to report his findings. Why don't you help answer your own question and report your experience with it here?

And I agree with you, the OP is a mess and needs a face lift.
[Nexus 5 Android Development] srikiran2006:
Will this flash work for Oneplus One?
[Nexus 5 Android Development] Vipauer:
I think that will not work ... just for the Nexus 5.
[Nexus 5 Android Development] chdloc:
The flashable zip will most certainly not work with any device other than the Nexus 5.

On the other hand, it may be possible to get the "simple" mod working on other devices that are based on the Snapdragon 800 series (msm8974) -- but don't run OEM software -- where the audio HAL (audio.primary.msm8974.so) has not been altered from either the AOSP or CM (11 or 12) baseline.

For sure, though, the mixer_paths.xml files would have to be merged manually.
[Nexus 5 Android Development] Vipauer:
I need your help in one question.

I use on my Nexus the version: Nexus5_5.0.1_LRX22C_v2_audiofix_stereomod_aroma_build2.zip

It's the lastest version and without bugs?

What are the best values to choose on configurations without damaging the speakers?

I installed with this selection:

- Camcorder Audio Fix

- Noise Suppression: 6 dB

- Mic Gain: 97 (default)

- Camcorder Channels: Stereo - micro-usb to the right

- Audio Bitrate: 288 kbps max

- aMGC prereq.: tinymix + scripts

- Playback Channels: Stereo - micro-usb to the right

- Ear Speaker Gain: 95

- Bottom Speaker Gain: 90

The values are ok?

My doubt are on "ear speaker gain" and "bottom speaker gain"...

What is the best configuration or best values to preserve the speakers life?

Thanks very much your help...
[Nexus 5 Android Development] Flyview:
The gain values will depend per device. As long as the speaker isn't cracking at full volume it should be fine. Another reason you might want to tweak the values is to get the L/R balance correct where both speakers are the same volume.

Sent from my Nexus 5
[Nexus 5 Android Development] partner22:
* ROM: paranoid 5.0 alpha 1

* Kernel: stock paranoid kernel

* 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 without Tasker

* other sound mods installed: none
[Nexus 5 Android Development] Yakandu:
I installed the last aroma + aMGC prerequisites with it and then installed the app but i think i'm missing something... do i have to isntall anything else appart from those two?

No UI nor LED working, do I have to install busybox even if i instaleld the prerequisites with the aroma isntaller? or any other app?

Thanks in advance

PD: also my bug is not there anymore, i can speak with my earphones plugged in

PD": Ok, some lbusybox libs where missing, its working now, but sometimes the led doesnt work
[Nexus 5 Android Development] chdloc:
Just a heads up: I updated the Google App (launcher, Google Now, etc) today and it seems to have hotword detection from any screen enabled by default. As aMGC currently does not work in this configuration, you may have to disable hotword detection from any screen in the settings after updating to Google App version 4.1.29.1706998.
[Nexus 5 Android Development] Flyview:
This is the best mod I've done to my Nexus 5. It makes listening to or watching media so much cooler. Thank you so much. There's one issue I've noticed. When talking on the phone with a headset or headphones or speakers plugged in, audio only comes in through the right channel. I assume this is a side effect of disabling the ear piece speaker during calls so it doesn't interfere with noise cancelation, but can we not detect audio is playing through 3.5mm jack?

Sent from my Nexus 5
[Nexus 5 Android Development] krneki10:
I just installed aMGC but whenever I try to record with Easy Voice Recorder Pro (camera as source), I only get loud buzz-noise and almost no voice. Any ideas? Anyone experiencing similar problems?
[Nexus 5 Android Development] chdloc:
The latest version of the mod available here and here (installer) should have fixed this issue.

Make sure you have the following options set in Easy Voice Recorder Pro:

Settings -> Sound quality -> Sound encoding -> High quality (PCM)

Settings -> Sound quality -> PCM settings -> Sampling rate -> Film quality (48 kHz)

Settings -> Sound quality -> PCM settings -> Noise suppression -> Device default

Settings -> Sound quality -> PCM settings -> Echo cancellation -> Device default

Any other setting (in combination with the "Camcorder" microphone as source) may result in the audio problems you are describing .
[Nexus 5 Android Development] Flyview:
Thanks, I had installed V2 build 1 and didn't keep up with the thread.

Sent from my Nexus 5
[Nexus 5 Android Development] mikael91:
settings shootout!

hello guys! first of all thank you to everyone who contributed to this mod. im utterly thankful, i am a musician and audio quality within the camcorder was always biggest letdown when it comes to n5. i made a video, where im playing with different settings of the mod, hopefully it will help you to decide which setting works best for you. i've used the same song, played in about 100db, using studio monitors, and tried my best to have nexus 5 in the same spot. here are the settings:

1. 95db, 6db NS, mono input, aMGC

2. 95db, 6db NS, mono input, no aMGC

3. 95db, 6db, stereo input, aMGC

4. 95db, 0 NS, stereo input

5. 88db, 0 NS, stereo input

my conclusions:

Personally i'm torn between 6db NS aMGC and 0db NS. What is interesting, i've noticed that after a two or three seconds from playing a song, all of 6dB NS settings were doing kind of dramatic lowering of volume, as if some limiting was kicking in. you can clearly hear it on the recording, it almost seems as if im turning volume down and IM NOT. you can also see this on ss with track waveforms. It's a thing i havent noticed on 0db. On the other hand, you can hear more noise on 0db, though it also seems to me much louder, even though both settings were 95db input. It would be interesting to hear the difference where volume difference is compensated. I actually think 88db 0db NS is more comparable to 95db 6dbns when it comes to levels. When choosing between 6db NS no aMGC and aMGC personally i'd choose aMGC, seems to have a bit more sweet high and low end.

I think i will be rocking 6db NS aMGC stereo input for now, as it seems to have some peak limiting going on, possiblly i'll try it on a higher input gain. gonna check also how mod behaves with other audio recording apps.

Thank you for making this mod!! It is amazing. As you can see in video, it even clearly beats ipad mini retina. ( in my humble opinion )

LINKS:

film: https://dl.dropboxusercontent.com/u/55577110/shootout.mp4

waveforms ss: http://cl.ly/image/1d1F2D0j3w3R

im on a 5.0.1 cataclysm rom, audio was recorded at highest possible bitrate, 280kbps i believe.
[Nexus 5 Android Development] GorfDroid:
I have the volume boost mod installed. Will this mod conflict with it? I am on the latest cataclysm ROM.
[Nexus 5 Android Development] chdloc:
Very nice! Thank you for posting this comparison.

Let me add a few random thoughts to hopefully clarify some things.

(I promise I will update the messy OP soon to make it more coherent and complete.)

aMGC by itself does not do anything. It offers the user the option to modify the microphone gain based on the level of the input signal to prevent clipping, which absolutely ruins any recording. As of now, aMGC only works if noise suppression is enabled. The reason for that is that I wanted to make sure that any of my mods only happen when the device is in a very defined state. If you don't touch the up/down arrow in the UI absolutely nothing will happen.

there is no limiter kicking in when 6 dB noise suppression is enabled. What happens is that it takes the noise suppression algorithm a while to "kick in". Note that this algorithm really expects speech as its input, so it is quite possible that it simply adds 6 dB of attenuation in case of signals that cannot be classified as speech. I would have to study the algorithm to confirm this suspicion. Your observation with regard to levels seems to (unscientifically) prove my assumption.

The quality of a recording device really shows itself at the two level extremes: very quiet acoustic environments and very loud ones (and by extension extremely dynamic ones). In quiet environments a microphone's signal-to-noise ratio (SNR) will become apparent. I'm almost certain that the Nexus 5 offering only 58 dB of SNR will come in at a distant second to the iPad Mini Retina that you tried. Not sure what SNR the microphone(s) of the iPad offer, but I'm sure we are talking upper 60s. What happens in very loud environments (120dB+) is also very important. Prior to my latest update, the Nexus 5 simply could not handle anything close to 120 dB SPL. Things should be better now, in particular when using aMGC, but I'm sure the Nexus 5 will be waving a white flag when competing against the iPad in very loud acoustic environments.

if you adhere to the suggestions I made a few posts ago with regard to the setup, I think "Easy Voice Recorder Pro" is the way to go for best audio quality as it allows stereo recording at 48 kHz in PCM format. (A future update of aMGC will also support Easy Voice Recorder Pro.) 48 kHz is the native sampling rate on our device and by selecting it no potentially sound-degrading resampling will be applied.
[Nexus 5 Android Development] mikael91:
thank you chdloc! sorry for misunderstanding some concepts. so is aMGC becoming available when you follow instructions you wrote in a post about floating microphone gain adjustments?
[Nexus 5 Android Development] chdloc:
No need to apologize. I have to apologize for having information splattered all over this thread.

All you need to know about aMGC can be found here, but the latest

version currently resides here
[Nexus 5 Android Development] chdloc:
Quite possibly. However, the conflict is probably quite easy to resolve.

If I were you I would save my current /system/etc/mixer_paths.xml file and compare it to the stock one that comes with your ROM.

This way you know what changes have been applied by the "volume boost mod" (whatever that is). Then you can install my mod and manually edit the new mixer_paths.xml file to your liking.
[Nexus 5 Android Development] mikael91:
Wow, this sounds amazing! LED as a VU meter.. seems to good to be true. The only thing I do not know is how to make file executable.

I'm really sorry if this is basic knowledge, it's just first time I come across this kind of process.. I have latest version of the mod, with all of the advanced settings and aMGC installed from aroma installer. I'd greatly appreciate any hints on how to make required files executable. Thanks once again for amazing work you've done!
[Nexus 5 Android Development] chdloc:
Let's carry this conversation over to PM.

This is a good exercise for me, too, as this will help me make the new OP as clear as possible.

Edit: For others that are interested in this - you can use spacetaxi's installer to do most of the aMGC-related legwork for you
[Nexus 5 Android Development] AtField:
Hi,

the mod is great, really usefull. I only have a question!I know that you dont support custom kernel or roms atm, but i tried to install aMGC on my device (i'm currently on stock rom and franco kernel r71) and I can see the interface when i record a video, but the led doesnt work as VU meter, it just do nothing!I was just wondering if I made some mistake or if its an incompatibility problem. I tried to use the search box but i couldnt find an answer!

p.s. sorry for my english :P