yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] aeoveu:
Can we have a mirror elsewhere? Mediafire doesn't want to let me download the file (slow speed...which is very unlike mediafire) :/

Edit: managed to download and upload it to a mirror: https://docs.google.com/file/d/0Byfz0ZF3flhyR0xaNXI1SmxRYk0/edit?usp=docslist_api

Feel free to put this in the OP

Edit 2: I used the 6db noise cancelation, stereo mic arrangement (USB facing mic = right side), but I can't seem to tell if the mod is effective or not. Its either too quiet, or it really isn't working on that config.

I reverted back to the previously issued Aroma Installer file for now.
[Nexus 5 Android Development] NickFe:
5.0.1?

Do we know if the recent 5.0.1update for the Nexus 5 fixes the problem?
[Nexus 5 Android Development] scleone1987:
Doesn't work with latest 5.0.1 LRX22C rooted. I only tested stereo option, no sound, I had to revert it back to stock audio libs.
[Nexus 5 Android Development] adnan.selimagic:
I installed 6dB mono and everything is working
[Nexus 5 Android Development] fatiko85:
In 5.0.1?
[Nexus 5 Android Development] chdloc:
I have not updated myself yet, but I noticed that Android 5.0.1 OTA has a patch for libaudioflinger.

Hence, I do expect problems with the "advanced" mod. Until I have the new fix ready, you

should be ok running the "simple" mod without noise suppression as none of the other patched

files seem to have changed.
[Nexus 5 Android Development] aeoveu:
Just clarifying: does your simple mod include stereo recording WITHOUT noise suppression?

Or is it only mono sound without any suppression?

Kinda confuzzled with all these files flying around everywhere :)
[Nexus 5 Android Development] chdloc:
Yes.
[Nexus 5 Android Development] GMFalka:
Nexus 5 on Android 5.0.1. stock and the Stereo Simple (no suprs) works like a charm!
[Nexus 5 Android Development] adnan.selimagic:
Yes, 5.0.1
[Nexus 5 Android Development] Escoban:
Doesn't work for me, can't play music after flashing your zip
[Nexus 5 Android Development] chdloc:
libaudioflinger.so for 5.0.1

For those of you running 5.0.1 and are comfortable manually copying files to your system/lib partition,

please test the attached libaudioflinger.so library. This new library has been built from 5.0.1 sources and now

hopefully allows for noise suppression.

I have not updated to 5.0.1 yet as I still need to work on some kernel changes (not camcorder-related).

This library works as expected on 5.0.0

This version of the library adds one feature: It periodically reports the microphone level to logcat under

the tag "microphone_level_dB_int". I will be using this feature in combination with Tasker and some shell trickery

to facilitate "assisted Manual Gain Control" mentioned in an earlier post.
[Nexus 5 Android Development] Vitalyt:
no google search widget

I have running Android 5.0 on my Nexus 5 + installed Nexus5_5.0_LRX21O_audiofix_v1_aroma.zip. Everything works fine except I found a side effect that there is no google search widget (error message instead of it) in recent application list. Have somebody this problem?
[Nexus 5 Android Development] dakore:
That's common rom related bug.
[Nexus 5 Android Development] fatiko85:
Sorry man but if i have understud you correctly in 5.0.1 i put the library attached and what should be ocurried?

(my professional english language is conmming....:cowboy:)
[Nexus 5 Android Development] chdloc:
As reported by a few, Android 5.0.1 breaks the ability to run the "advanced" mod with noise suppression. This new library aims at fixing that problem.

To test, I suggest you (or anybody who is willing to help) install the advanced mod (mono or stereo) using the Aroma installer and push the new library

to /system/lib/ after your phone has booted.

Make sure the permissions are set correctly (644) and reboot.
[Nexus 5 Android Development] fatiko85:
ok but if something is wrong how i back before i applied the fix?

Thanks!!
[Nexus 5 Android Development] chdloc:
You can go back to stock using the Aroma installer.
[Nexus 5 Android Development] AvivEliyahu:
i would try it tomorrow, but where does the files appear after flashing it ?
[Nexus 5 Android Development] fatiko85:
All working in 5.0.1 with advanced mono 6db supression and the new lib for now

THANKS
[Nexus 5 Android Development] chdloc:
Thanks a lot for testing! Would you mind running another test with stereo and 6dB suppression?
[Nexus 5 Android Development] donwhall70:
Has anything changed with the paths file? Can I reuse the modified one I have now on 5.0.1?
[Nexus 5 Android Development] chdloc:
The only relevant file that has been patched by the 5.0.1 OTA is libaudioflinger.

As of now I suggest to install your favorite camcorder mod either manually (OP) or with the current Aroma installer, followed by a manual

push of the latest libaudioflinger that I posted today. If you are also interested in the stereo playback mod, you need to manually merge

the relevant changes as described here.

Once I receive confirmation that the new libaudioflinger also works with stereo capture I will update the mod with all required files including

the stereo playback mod. A new Aroma installer should be available shortly after that.
[Nexus 5 Android Development] donwhall70:
I am not sure if this is the best example as it is pretty quiet around here.. This is Stereo with 6dB and your modified flinger.so and the default 103 mic gain. - http://goo.gl/t17ipY
[Nexus 5 Android Development] spacetaxi:
Completely reworked installer v3 including new features!

Hi all, I've posted a completely reworked installer including new features in post #253. Hope you like it! :cool:

PS: This installer is for Android 5.0.0 only! A new installer for Android 5.0.1 will follow soon. 2014-12-19 Edit: The latest installer (LRX22C v1) should work on Android 5.0.1 and 5.0.0.
[Nexus 5 Android Development] gil80:
Hi,

I edited the mixer_paths_right.xml to enable "Stereo" on the nexus 5 by using the mixer_paths.xml made by Sasha Shafranko <- Credit to him! (source)

The result is a combination of the OP's great work on camera quality and Sasha Shafranko Stereo mode.

Don't know if it matters but I made sure I use mixer_paths_right.xml file name. So rename the file to mixer_paths_right.xml if you want to use it.

Stereo, as in front speaker and bottom speaker are playing sound when watching video, listening to music, etc. Read the source article to know what it's all about.

Tested on lollipop 5.0.1.

I'm not assuming any responsibility if you damage your device.

Always backup before messing with system files.
[Nexus 5 Android Development] adnan.selimagic:
What is the difference between this and Aroma installer in post #253
[Nexus 5 Android Development] chdloc:
Android 5.0.1 support and stereo playback

New mod added to OP.

It now includes full support for Android 5.0.1.

It also enables true stereo playback capabilities throughout the system (where supported by the source material). Enabling the earpiece speaker for audio playback has been originally reported and implemented by [MENTION=5108383]sshafranko[/MENTION] . I modified his implementation for the Nexus 5 thereby enabling true stereo playback rather than dual-mono. I also disable the earpiece speaker when on speakerphone in a cellular call to minimize its effect on echo control. Please refer to my posts here and here for some details.
[Nexus 5 Android Development] gil80:
nothing I guess. I posted this before I got the chance to see the updated OP.
[Nexus 5 Android Development] Xanderw:
Aroma Installer updated?

Noticed spacetaxi edited his posts before op updated. Is it ok to use the installer? Thanks.
[Nexus 5 Android Development] donwhall70:
I believe as of now it is still for 5.0.0
[Nexus 5 Android Development] Aswin08:
Thanks! Waiting for the aroma.
[Nexus 5 Android Development] FLH_Sky:
Thank you so much guys for this awesome developments over the past weeks. Can't believe why Google isn't implementing this themselves.

Cheerfully waiting for the 5.0.1 aroma installer. :)
[Nexus 5 Android Development] spacetaxi:
New installer for Android 5.0.1/5.0.0 including even more new features!

Hi all, I've posted a new installer for Android 5.0.1 (and 5.0.0) including more new features in post #253. Have fun! :cowboy:
[Nexus 5 Android Development] maortrol:
Thank you!!! ;)
[Nexus 5 Android Development] fatiko85:
sorry dude I've been busy . I see the new aroma installer and new changes . Thank you very much to you both for your development !!!!!
[Nexus 5 Android Development] Matrix_19:
It doesn't work for me :(

I set it to 6db suppression and

Mono

And then my N5 doesn't seem to boot (I give up after 4 or 5 min) and I have to use the installer to go back to stock (at least this step is working)
[Nexus 5 Android Development] dadomonte:
Not working for me too. N5 dont boot!!!
[Nexus 5 Android Development] spacetaxi:
The installer is working without problems on my device. And currently I'm using the 6dB/mono setup myself. What recovery are you using?

Edit: I'm using TWRP 2.8.1, as 2.8.2 seems to have some issues...
[Nexus 5 Android Development] dadomonte:
Before return to stock I flashed one more time and now it´s working/booting ok. This time the only thing i made diferent was return to TWRP Recovery and reboot from there. I didnt select the reboot option on the installer. N5 with 5.0.1 an TWRP 2.8.2!!

Will do some tests now!!

Thank You :good::good::good:
[Nexus 5 Android Development] adnan.selimagic:
Me too, 6dB mono with stereo speakers...everything is working.

Android 5.0.1

TWRP 2.8.1
[Nexus 5 Android Development] Escoban:
Seems like the source of the problem is indeed twrp 2.8.2, I'm stuck in boot too
[Nexus 5 Android Development] Matrix_19:
ahhh thank you,

I'm using TWRP 2.8.2 !
[Nexus 5 Android Development] Escoban:
For everyone facing problems with 2.8.2,this worked for me too. Thank you sir
[Nexus 5 Android Development] spacetaxi:
Thanks for your feedback! Indeed the reboot option of the installer doesn't work as expected with TWRP 2.8.2. So I'll simply remove this option and post an updated installer within a few minutes. Stay tuned...
[Nexus 5 Android Development] Matrix_19:
it's working, thank you guys !
[Nexus 5 Android Development] spacetaxi:
Build 2 of latest installer available

Ok guys, I've just posted build 2 of the latest installer. It now should work with TWRP 2.8.2. See post #235.
[Nexus 5 Android Development] chdloc:
A word of caution when using stereo playback

For those of you using the stereo playback mod, please make sure you read the new "caveat" section in this post.

It basically says that you can expect echo problems with any communications app other than cellular telephony

in speakerphone mode, as the earpiece loudspeaker does not turn off in this context.

(There is a convoluted way by using Tasker and shell scripting to get around that issue, though)
[Nexus 5 Android Development] winamp26:
Hi guys

I flash this and work for me ☺

Stereo speakers and recording 6dB

[emoji106] [emoji106]
[Nexus 5 Android Development] Xanderw:
Thank you!

Thanks for the mod and installer!
[Nexus 5 Android Development] blinqipa:
Happened to me once ,restored all of my /system (had it backed up on TWRP).Then I tried doing again ,and everything was working flawlessly .Gotta install the mod again ,I flashed the 5.0.1 factory image .Thanks [MENTION=2760454]chdloc[/MENTION]
[Nexus 5 Android Development] Creative9170:
Confirm working in 5.0.2 (LRX22G) too, Thanks a lot for this good mod :)
[Nexus 5 Android Development] gpvecchi:
If I would like to change the values, do I need to flash stock back or do I just select them in Aroma? Thanks...
[Nexus 5 Android Development] Xanderw:
Kernel?

I want to try different kernels coming from stock+mod. Some use faux sound some use franco sound. Should I revert mod before flashing kernel? I searched the thread and it seems some kernels apply gains as well. Anyone have some experience with this situation? Thanks in advance!
[Nexus 5 Android Development] Fusionalex:
Does this work on Omnirom?

EDIT: I think it does, I will do some more testing though :)

Thank you!!
[Nexus 5 Android Development] MrObvious:
Any ideas on what to do then? Thanks for your work by the way.
[Nexus 5 Android Development] topgeardave:
[MENTION=4152171]myfluxi[/MENTION] is the main man for CM related patches :)
[Nexus 5 Android Development] ruilong:
U did a great job on this issue. The recording voice sounds more clear than before, even it was a little bit lower.:good::good:
[Nexus 5 Android Development] spacetaxi:
FYI, I have reported the camcorder audio quality issue and chdloc's fix to the AOSP, so perhaps (hopefully) they include chdloc's fix in future AOSP builds:

https://code.google.com/p/android/issues/detail?id=74583
[Nexus 5 Android Development] Random^:
What value did you use for the Mic Gain ?

Thank you
[Nexus 5 Android Development] Yakandu:
I think I understood almost everything but one thing, DEC 6 is the value for the main mic, or the noise suppresion mic?

I mean, we should decrease or increase DEC6 value (I want to do it manually)?
[Nexus 5 Android Development] spacetaxi:
It's the recording level for the main mic.

Only change the DEC6 value from its default (88) if you think that the volume of your recorded videos is too low (-> select a higher value, but expect more white noise) or too high (-> select a lower value, but I think this is unlikely). The possibility to change the DEC6 value is just an added bonus of this fix. It's not needed to prevent the audio distortion coming from that (stock) aggressive noise filtering, as it will be bypassed anyway.
[Nexus 5 Android Development] mgorman:
Thanks. This worked just fine on KTU84Q
[Nexus 5 Android Development] chdloc:
Fix for CM11

OK guys, I need a few brave volunteers that run CM11 on their Nexus 5's.

I sync'ed the CM11 tree last night and baked-in my fix. I'm not familiar with CM and I saw an additional audio

framework based on CAF in hardware/qcom/audio-caf/. AOSP-based ROMs do not have this implementation.

audio-caf did not get built on my machine, so the modified libraries were applied to hardware/qcom/audio/, which

in turn created the modified library.

This mod does the same as the one detailed in the OP.

NOTE: I do not run CM and have not tested it myself.

There are two archives (one with the fix and the other one with the stock files) in the attachment

each containing two files, i.e.

audio.primary.msm8974.so which goes in /system/lib/hw

mixer_paths.xml which goes in /system/etc

Please mind the permissions after the files have been copied. You will need to reboot your device making the changes.

Please report back whether this works for you. Thanks!

WARNING: The files attached here are meant for CM only and will most certainly cause a boot loop on all other ROMs
[Nexus 5 Android Development] spacetaxi:
I've quickly installed CM11-M9 (thanks to MultiROM!) and did some simple tests without and with your fix. As far as I can tell from my short testing it just works. :good:
[Nexus 5 Android Development] Royal King:
Install failed on carbon ROM!

AROMA Installer version 2.70RC2
(c) 2013 by amarullz xda-developers

ROM Name : Camcorder Audio Fix
ROM Version : v2 (installer build 2)
ROM Author : chdloc / spacetaxi @ xda
Device : Nexus 5
Start at : Fri Feb 27 22:41:20 1970

-> Initialising....
-> Please Wait....
script aborted: assert failed: getprop("ro.product.device") == "hammerhead"
assert failed: getprop("ro.product.device") == "hammerhead"

Installer Error (Status 7)

End at : Fri Feb 27 22:41:20 1970
[Nexus 5 Android Development] antipasto:
I've been running the older PAC nightly from earlier in July. It is CAF based and I made a copy using multirom and put in these two files. It works!
[Nexus 5 Android Development] chdloc:
[MENTION=3163883]spacetaxi[/MENTION] may have an idea why the install fails.

To me it appears your /etc/build.prop has no entry called

ro.product.device=hammerhead

Can you verify?

In the meantime, try to install the files manually using "adb push" followed by an adjustment of permissions.
[Nexus 5 Android Development] LMedina270:
Works nice on Mahdi rom! Thank you a lot!
[Nexus 5 Android Development] Royal King:
It's there!
[Nexus 5 Android Development] spacetaxi:
Thanks for reporting, but then there's something strange with your /system/build.prop file. My installer checks the "ro.product.device" string to make sure that it is running on a Nexus 5 device (=hammerhead). Something/somebody has changed this string on your device, so the installer refuses to continue.

I've installed the latest Carbon ROM Nightly just to try my installer with it. It's working without any problem! The same is true for chdloc's fix.

---------- Post added at 08:43 AM ---------- Previous post was at 08:41 AM ----------

Sorry, I've seen your post after posting myself. ;)

That's a really strange issue. I can remove the device check from my installer, but I'm not sure if it's a really good idea to do so...
[Nexus 5 Android Development] D0ubl3_X:
You may submit your changes to the Cyanogenmod repos.

Maybe they'll built it into their rom :)
[Nexus 5 Android Development] menaaboud:
Nexus 5 Android L MIC during calls

Is there a chance to help fix the MIC during calls ? there is a famous problem of others can't hear me while talking during the phone call, becuuase of that MIC issue
[Nexus 5 Android Development] Creative9170:
I like the stereo sound, but can this hurts ear speaker??!!
[Nexus 5 Android Development] spacetaxi:
Just flash with new values. No need to flash stock first.
[Nexus 5 Android Development] rskyline:
Does this mod can work on Nexus 4? We have the same issue :(

Enviado desde mi Nexus 4 mediante Tapatalk
[Nexus 5 Android Development] fatiko85:
Working on rom stock 5.0.1 and HellsCore kernel!!!!!!!!!
[Nexus 5 Android Development] HTCZ715E:
Hello [MENTION=2760454]chdloc[/MENTION] & all!

I did fix camcorder's poor audio in quite easy way on LG G2; just changed audiosource value.

maybe you will find it interesting:

http://xdaforums.com/verizon-g2/development/fix-camcorder-audio-quality-fix-t2980758

or pasting here:

in file VideoRecorder.smali:

sget-object v9, Lcom/lge/camera/app/VideoRecorder;->mMediaRecorder:Lcom/lge/media/MediaRecorderEx;
const/4 v10, 0x5
invoke-virtual {v9, v10}, Lcom/lge/media/MediaRecorderEx;->setAudioSource(I)V

well that 0x5 looks like bad boy

I changed it to 0x1, recompiled LgCameraApp.apk and now you also can "congratz" yourself

Audio is of finest quality!!!
[Nexus 5 Android Development] chdloc:
I doubt a speaker will blow as long as it does not get driven into its non-linear range of operation for a long period of time.

In other words, you should be fine as long as it does not produce audible distortions. Plus, as far as I know, the earpiece speaker

is protected by a current limiter.

The stock value for handset telephony playback level is 84. For stereo playback, I personally now crank it up to 89, which is a 5 dB gain over stock,

and I get almost no audible distortion.

Just use common sense in choosing the gain for the earpiece loudspeaker and you should be fine.

(Since I do not have any datasheets to go by, no guarantees can be given, of course.)

The mod will certainly not work as is on the Nexus 4. The Nexus 4 is based on a different chipset and codec.

You will have to build the fix from the sources (audio HAL) pertaining to the Nexus 4.

I can probably point you in the right direction if you are willing to build AOSP yourself.

To get started, look for a file called platform.c in the Nexus 4 related audio HAL (which eventually will produce

audio.primary.XXX.so in /system/hw, where XXX is the codename of the Nexus 4 chipset)
[Nexus 5 Android Development] chdloc:
Interesting.

I don't know anything about apk manipulation, but your suggestion

may offer the best option to fix camcorder audio on devices where

OS source code is not available, i.e. non-Nexus devices.
[Nexus 5 Android Development] HTCZ715E:
yep, just analyze Gallery (or what do records) for such lines..

---------- Post added at 09:30 PM ---------- Previous post was at 09:11 PM ----------

for AOSP no APK manipulation! we should find source place..

here, possible place:

https://android.googlesource.com/pl...aster/src/com/android/camera/VideoModule.java

1100 mCameraDevice.unlock();
1101 mMediaRecorder.setCamera(mCameraDevice.getCamera());
1102 mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);

lets try here instead:

MediaRecorder.AudioSource.MIC

public static final int CAMCORDER
Constant Value: 5 (0x00000005)

public static final int DEFAULT
Default audio source
Constant Value: 0 (0x00000000)

public static final int MIC
Microphone audio source
Constant Value: 1 (0x00000001)
[Nexus 5 Android Development] chdloc:
That's pretty much exactly what my (simple) mod is doing.

I'm making that change not in the JAVA world, though, but in the audio HAL

directly, thereby affecting all apps requesting the CAMCORDER audio interface.

Still, good find! This may help folks who build their own custom Camcorder app to get rid of that nasty noise suppression without root.

Unless the app has access the the mixer (or the audio samples), the gains will most likely be lower than stock, however.
[Nexus 5 Android Development] HTCZ715E:
good! but changing HAL is too much..

while camera/gallery code changing looks quite acceptable..
[Nexus 5 Android Development] chdloc:
I don't think there is a right or wrong way of doing it.

All that counts is the result. In the end it is all about compromises...
[Nexus 5 Android Development] HTCZ715E:
not right or wrong, but more right then...

imagine: some app wants not NEW-BEST but exactly that poor audio.

yup, it will not get, what it wants..
[Nexus 5 Android Development] chdloc:
It is beyond my capability to imagine an app that may want badly distorted audio.

But hey, go ahead and create a thread that hosts your mod.

In the spirit of Android, having choices is a good thing...
[Nexus 5 Android Development] HTCZ715E:
:) I have not Nexus, but NOT claim any copyright for this change of code, so anyone is welcome to do it!!
[Nexus 5 Android Development] 21plays:
Safe to flash?

Is this mod safe to use on Optipop ROM with Uber SaberMod kernel? Thanks
[Nexus 5 Android Development] Creative9170:
Thanks for reply and description :) Yes I also feel its not making loud sound by ear speaker that hurts it.
[Nexus 5 Android Development] chdloc:
Hard to say without knowing whether this or any other ROM/Kernel combo changes the stock audio subsystem.

An easy way to find out would be to backup your system partition and flash the mod, maybe start with the "simple" mod without noise suppression.

If you find yourself in a boot loop, then one of the system libraries is incompatible and you will have to restore your backup.

If you get no audio either on camcorder recordings or throughout the system, then the problem is likely related to an incompatible mixer_paths.xml.

In this case it is most probably possible to get everything to work by manually merging the two mixer_paths.xml files (the one from your ROM and from the mod).
[Nexus 5 Android Development] 21plays:
Thank you

---------- Post added at 21:27 ---------- Previous post was at 20:49 ----------

Used the aroma installer, worked like a charm [emoji106]

---------- Post added at 21:49 ---------- Previous post was at 21:27 ----------

I get w little buzzing noise when music is playing. Like radio distortion, static
[Nexus 5 Android Development] chdloc:
You need to be a little more specific. Which mod did you flash (with or without noise suppression, with or without stereo playback)? Do you get the distortion only on the loudspeaker(s) or also on headphones? Does the noise go away when you lower the volume? Do Camcorder recordings sound OK?