yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] winamp26:
its optional to install.

ok.

Camcorder Audio Quality Fix with Stereo Recording and Playback Support and LolliViper

I add viper4android to Audio Quality Fix , you can choice to install or not.

if you want install make nandroid backup(optional but recommended) for when to restore to stock MusicFX.

viper4android works on lollipop with Permissive SELinux and for change it you need to SELinuxModeChanger(http://xdaforums.com/showthread.php?t=2524485]) by @MrBIMC

thanks

@chdloc for Camcorder Audio Quality Fix mod

@ AndrasLOHF for Lolliviper(http://xdaforums.com/google-nexus-5/themes-apps/discussion-viper4android-t2543796)

after booted up phone add

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

after last line in build.prop and install driver then reboot phone.

Enjoy!

im not responsible for any damages to your phone.
[Nexus 5 Android Development] chdloc:
Experimental M-Preview Support

Update (06/11/2015): Do not try to install the mod that offers 6 dB or 12 dB of noise suppression as your phone will not boot successfully. The "simple" mod without noise suppression works as expected. The stereo recording, stereo playback, and sidetone option work as well.

To my surprise I found that Google seems to have made the entire (?) M-Preview source tree available, so I built the camcorder audio fix to (hopefully) work with this first iteration of M.

I'm not running M-Preview -- I'll probably wait for the final release before I upgrade -- but I think the attached Aroma installer should do the trick.

Please check it out and report back.
[Nexus 5 Android Development] mpkothari:
Installation of the M-Preview version posted above failed using latest TWRP...would like to provide more details. where does TWRP store the error log?
[Nexus 5 Android Development] dr_iggy:
Zip file is not compressed right. I have recompressed it, and aroma installer started, but I got bootloop.
[Nexus 5 Android Development] chdloc:
Hmm, I just used the "compress" function on the Mac. I was not aware that a different compression scheme would be necessary. Which one is known to work?

Please try TWRP 2.8.5.3. This Aroma installer is known to have issues with 2.8.6.0 (and maybe 2.8.6.1). All I did was take [MENTION=3163883]spacetaxi[/MENTION] 's latest installer and replace the appropriate libraries. If you still get a "boot loop" with TWRP 2.8.5.3 try to grab the logs.

You can alternatively look at the logcat while you phone is booting as I'm assuming you are not really boot looping at the kernel level. Instead Android is likely trying to read a library or configuration file that it can't for whatever reason.

You did delete some system apps to make space on the system partition, correct?
[Nexus 5 Android Development] dr_iggy:
The folder structure in the zip file isn't right. After changing that and recompressing, I flashed it with TWRP 2.8.6.1 and entered the boot loop. After flashing again with stock libraries, the phone booted without problems.
[Nexus 5 Android Development] chdloc:
OK, I have changed the directory structure and re-uploaded the archive.

If this installer does not work with TWRP 2.8.6.1 please flash TWRP 2.8.5.3 and try again.
[Nexus 5 Android Development] dr_iggy:
Aroma installer is ok now, but still boot looping after flashing with TWRP 2.8.5.3.
[Nexus 5 Android Development] chdloc:
OK, we have a few options until I find the time to flash M Preview in order to debug this myself

Flash the simple mod (without noise suppression) with TWRP 2.8.5.3

Copy all necessary files manually as described in the README file of the new (tar.gz) archive attached to this post

In either case I will need the logcat messages that show up during the "boot loop" after the mod has been flashed.

It is entirely possible that the published sources don't align with the published M Preview image.
[Nexus 5 Android Development] dr_iggy:
I'm afraid I'm not familiar with logcats, could you suggest me the easiest way to do it?
[Nexus 5 Android Development] chdloc:
if necessary, install adb on your computer. There are numerous threads on XDA (or Google, of course) that can help you to get up and running.

if you haven't already done so, you will need to enable the "Developer options" on your phone by tapping the "Build number" field a bunch of times in the "About phone" screen in settings.

enable "USB debugging" in the "Developer options" screen

connect your phone to your PC via USB, open a shell on your PC, and enter

adb shell logcat

as soon as the colored dots start flying.
[Nexus 5 Android Development] dr_iggy:
OK, everything's clear, I'll try that as soon as I solve the problem with booting my PC ?
[Nexus 5 Android Development] chdloc:
OK, just went through this exercise myself. (I pushed all files manually, though.)

Upon reboot, logcat returns the following error:

mediaserver: type=1400 audit(0.0:35): avc: denied { execute } for path="/system/lib/libaudioflinger.so" dev="mmcblk0p25" ino=16386 scontext=u:r:mediaserver:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=0

It appears to me that SELinux blocks access to the modified libraries and, hence, prevents the system from booting.

SELinux is currently above my pay-grade and, at this point, my only two suggestions are:

stay with Lollipop until proper root is obtained

try installing the mod using a permissive kernel
[Nexus 5 Android Development] dr_iggy:
I do have Code Blue M beta permissive kernel and proper root. I managed to run aroma installer (only noise suppression, stereo recording, other default) and to catch logcat messages. The repeating messages that i get are:

06-08 08:59:11.670 759 881 I ServiceManager: Waiting for service media.audio_policy...
06-08 08:59:11.672 759 759 I ServiceManager: Waiting for service media.audio_flinger...
06-08 08:59:12.670 759 881 W AudioSystem: AudioPolicyService not published, waiting...
06-08 08:59:12.672 759 759 W AudioSystem: AudioFlinger not published, waiting...
[Nexus 5 Android Development] chdloc:
What you are showing here are the effects and not the cause of the problem. Could you please obtain a complete logcat while the system is trying to boot

adb logcat -f /sdcard/log.txt

and post (or PM) the resulting log.txt?

Edit: BTW, with proper root I meant "native" SuperSU support and not the workaround via a fully permissive kernel.
[Nexus 5 Android Development] dr_iggy:
With that command I got "couldn't open output file" error.
[Nexus 5 Android Development] chdloc:
Sorry, my mistake. The correct command is:

adb logcat -f /sdcard/log.txt
[Nexus 5 Android Development] dr_iggy:
No change, same error message. I suppose it's better to wait for native SuperSU.
[Nexus 5 Android Development] chdloc:
Alternatively, simply run

adb logcat

or

adb shell logcat

as you did before and copy-and-paste the output in its entirety.

Edit: Please also paste the complete output of the following commands

adb shell ls -alZ /system/lib/hw

adb shell ls -alZ /system/etc
[Nexus 5 Android Development] chdloc:
Did you run these commands while your phone was "boot looping"?

If so, I'm running out of ideas. The only interesting line in your logcat refers to a dead media server. There is no indication as to why it may have died.

I wonder whether the simple mod (the one without noise suppression) would allow M Preview to boot. I'm starting to think that the published sources don't line up with the factory image...

Edit: did you see errors in the recovery when trying to install the mod? (the logs can be found in /cache/recovery/last_log)
[Nexus 5 Android Development] dr_iggy:
Yes I did, so, it remains mystery for now ☺
[Nexus 5 Android Development] chdloc:
Thanks for your debugging efforts!

I may flash M Preview back within the next few days to try out a couple of things, but I'm not very hopeful.

My current suggestion is to either keep running Lollipop or run M Preview without the mod.
[Nexus 5 Android Development] KimSeiji:
5.1.1

Hello,

Does it work on 5.1.1 LMY48B??

Thanks!
[Nexus 5 Android Development] dr_iggy:
Yes.
[Nexus 5 Android Development] KimSeiji:
Hello,

Does it work on 5.1.1 LMY48B??

Thanks!
[Nexus 5 Android Development] August208:
waiting for new version for build LMY48B AOSP and Stock :)
[Nexus 5 Android Development] chdloc:
No need to wait, this one works on LMY48B.
[Nexus 5 Android Development] mpiwosal:
it influences my microphone volume in calls somehow. the other person can't hear me almost at all. does anyone have the same problem? i'm on cataclysm 5.1.1, installed 6db + aMGC and it is a perfection aside from calling :(
[Nexus 5 Android Development] chdloc:
Can you confirm that in-call microphone volume is consistently higher when you remove the mod?

The only instance where my mod is modifying in-call audio in any way is when the sidetone option is installed. Even then, though, the microphone level is not modified.

By default, an adaptive dual-microphone noise suppression scheme is used (by pretty much any modern smartphone) while using the handset in a call. Both microphones need to be working properly. Here are some trouble shooting tips:

Have you by any chance installed a new case that may block one of the microphones?

Do you happen to cover one of the microphones with your finger when holding the phone to your ear?

does the microphone seem to work properly when using (any) sound recording app (most use the main/bottom microphone)?

does the microphone seem to work properly when switching to speakerphone during a call (uses the top/auxiliary microphone)?

do you have any other sound mod installed?

If you'd like you can post (or PM) the contents of your /system/etc/mixer_paths.xml file and I'll take a look
[Nexus 5 Android Development] mpiwosal:
*no case at all

*no way I cover my mic with anything

*when using camera everything is okay, you know the situation during calls, and i THINK that when recording something in any app it's reasonably quiter than it should (and used to) be

*when on speaker everythings seems to be fine (just checked)

*stable cataclysm, your mode is the only one on my phone

I'll PM you with my mixer_paths.xml in a moment, it's a bit too much to post here.

One more question: during the recording (google camera) aMGC acts a bit strange. i know it takes time after the click to change the value on screen but it seems to change by itself. ex. I had -47db for a moment and after a second it changed to +6db with no interaction on my side. maybe I don't understand it, but isn't it supposed to represent the value that i choose?
[Nexus 5 Android Development] chdloc:
This is actually the intended behavior. The number that is constantly changing is the instantaneously measured RMS level of the recorded sound. After you change the gain it flashes the current gain differential with respect to the stock setting. For example you start the camcorder app, wait for aMGC to become active and tap the downward arrow, it should quickly flash -6 dB (as each short tap changes the gain by 6 dB) and then go back to updating the current level. If you tap the same arrow again it should quickly flash -12 dB, and so on.

Not well documented, I have to admit...
[Nexus 5 Android Development] mpiwosal:
Oh that is right! I didn't notice that. Thank you, i know everything now, the mod rocks! (i'll finally be able to record a concert gig at decent quality! i'll feedback with my results from MUSE concert next tuesday;))

///Edit:

To everyone facing the same problem as I: I managed to fix it by reflashing the zip. turns out that the last time i flashed it, it left unfinished mixer_paths.xml resulting in not being heard on voice calls :)
[Nexus 5 Android Development] mpiwosal:
After a few more test i have one thought: what about if you placed "current RMS level" next to the dB switcher? IMO this would make it much easier. it wouldnt take much more space, and this way there would be no confusion. user could see all the time the dB level he is over (or under) the default settings. because (again, IMO) when you want to change the settings quickly it is really hard to do it (even in peaceful environment, not to mention at a gig). This would make this MOD perfect. I wasn't even sure this kind of thing was possible, and when i finally saw this thread my pulse went up to 200 for a moment. consider my idea, please :)
[Nexus 5 Android Development] chdloc:
I think having two dB numbers show simultaneously will confuse most people, unless there is some sort of explanation in the UI, for which there is no room. Note that aMGC is also compatible with "Cinema FV-5" which offers much less screen real estate to place the UI.

Also, no two acoustic environments are the same, so I'm not sure whether your approach will speed things up for folks.

Two notes on aMGC that may not be widely known:

you can flash the current gain delta for a second at any time when tapping on the text showing the instantaeous RMS measurement

a long-tap on one of the arrows will move the gain by 12 dB as opposed to 6 dB when the arrows are short-tapped
[Nexus 5 Android Development] chdloc:
Update on camcorder mod and M Preview

Just finished running some tests on M Preview. The simple mod (no noise suppression) works as expected. The stereo recording/playback as well as sidetone options work as well.

However, the mod with noise suppression which requires a modified libaudioflinger fails. Even when I push an unmodified libaudioflinger that I've built from the M Preview sources the phone refuses to boot.

This leads me to believe that the updated sources which are required to build libaudioflinger that ships with the Preview image have not been pushed to AOSP yet.
[Nexus 5 Android Development] dr_iggy:
I can confirm that simple mod works on my side too (M Preview).
[Nexus 5 Android Development] chdloc:
This is great. Thanks for sharing!

Please allow me to add a few thoughts below.

I don't think you want 12 db of noise suppression when you record music. Even 6 db is really pushing it. I decided to couple aMGC with the noise suppression scheme, so my mod will have minimum impact on the rest of the system. I can elaborate more on that if desired.

I personally was only able to test this while blasting my car stereo at (for me) insane volumes. This still would not compare to a live concert. I was able to get decent quality audio at RMS levels of -6 dB, but I always start out at the default level. Not sure whether that may make a difference.

One idea I'm kicking around is to show a "concert" button before the aMGC UI comes up. If pressed, the levels will be low right out of the gate. What do you guys think?
[Nexus 5 Android Development] mpiwosal:
I thought so, I just wanted to try out as many options as possible, but on the other hand I didn't want to sit on my phone constantly during a concert :D

I also tried it on my home speakers (100W) and yes, -6dB was fine. but concert is a completely different story. my first videos were on -6dB (i mean RMS lvl) but they were terrible (even though the red light didn't show at all)

100% yes
[Nexus 5 Android Development] partner22:
What about a simple app that let you preconfigure the levels? So it wouldn't be too low (not all concerts require the same settings). I'm thinking in a app similar to the current interface (A VU meter, the current levels and a couple of keys to change the level). That would let us know the right levels without a test recording :)

Concert button sounds great anyway
[Nexus 5 Android Development] d0rkster:
sorry noob here. I flashed the zip file and went through the aroma installation. Now what? How do I enable the mod
[Nexus 5 Android Development] chdloc:
If you don't want or need aMGC (see OP), then you are done. The mod is automatically applied as soon as you use the Google Camera app as a camcorder.
[Nexus 5 Android Development] marquimsp:
chdloc, is there a way to have the aMGC working in other apps (specifically periscope)?

Cheers!
[Nexus 5 Android Development] chdloc:
Absolutely, and you can do it yourself fairly easily if you are running the Tasker version of aMGC. The step-by-step instructions are:

EDIT: Prerequisite: The app you would like to have supported by aMGC needs to have its audio recorded through the CAMCORDER audio device.

open Tasker and navigate to the "Profiles" tab with the "Camera", "CinemaFV5", and "EVRP" profiles

"Clone" one of the "Profiles", say "Camera" (long-tap the string "Camera"-> three dots -> Clone) and rename it to, e.g, the name of the app you want to control, say "Periscope"

tap on "Periscope" and then on the "Camera" image. Find your app in the "App Selection" list that comes up

go to the Tasks tab, clone "Camcorder Tasks" and name it something appropriate (maybe "Periscope Tasks" in your case)

now you need to edit one task in the newly created "Periscope Tasks". Find the one that runs the following shell command:

cat /proc/$ps | grep GoogleCamera | awk '{print $2}')/oom_adj

I believe it is task #20.

you need to replace the string GoogleCamera with the one that uniquely identifies your app in the process list (shell command 'ps'). For that, type 'ps' into an adb shell while your app is running in the foreground and find it in the list (something like com.vendor.appname). Find a unique app identifier in that line and replace GoogleCamera with the one you found

go back to the "Profiles" tab, tap on your newly created profile ('Periscope') and long-tap the green arrow; you need to swap the Task from "Camcorder Task" to "Periscope Tasks" and you should be good to go

if you don't like the position the UI is placed on top of your app, you can fine-tune it in the "Show Scene" task within your list of "Periscope Tasks" (around task #34.

(As the array of tasks only differ in one string of one task between apps, I'm sure all of this can be done way more efficiently.)
[Nexus 5 Android Development] marquimsp:
Hummmm I'm not using the tasker version... I did everything you said above and it doesn't work. I suppose I should revert to the tasker version of the mod altogether?

PS. : Sorry, it WORKS!! But led isn't working.

Thanks again!
[Nexus 5 Android Development] chdloc:
My apologies, I forgot a crucial detail in that the app you would like to have supported by aMGC needs to record audio through the CAMCORDER audio device. I'm guessing this is the problem in your case. You can verify that by checking which audio device is being used while the app is recording:

logcat |grep in_snd_device

You will only have a chance to get it to work if you see "voice-rec-mic-mod" as a selected input device.
[Nexus 5 Android Development] marquimsp:
yeah, it says voice-rec-mic (not mod).

Well, the gain buttons work (I listened to my broadcast afterwards), so I'll keep on using it without the leds. Do you think that's ok? or is it just increasing gain to the horrible oem audio?

Cheers!
[Nexus 5 Android Development] chdloc:
The only problem with using the aMGC UI without the LED that I see is that you would be adjusting the gain without any feedback.
[Nexus 5 Android Development] explorer-10:
Would this mod work with any other camera app, like LCamera for example? I was out at this asian event last night, the 626 Night Market and while i was recording, one was used by the Google Camera app, while 5 other videos were recorded using the LCamera app. Audio was garbage to the point where it not only was it cut multiple times, but it messed with the video as well. Was it a terrible idea to record with the LCamera app?
[Nexus 5 Android Development] chdloc:
The basic mod works with all apps that request the CAMCORDER audio interface, so likely all camcorder apps and other audio recording apps that let the user select the input device.

aMGC (which you will likely need for events like the one you visited), however, currently only supports "Google Camera", "FV-5 Cinema", and "Easy Voice Recorder Pro" out-of-the-box. If you are running the Tasker version of aMGC, then you can add other apps to the supported list by following this post.

For those of you who don't run the Tasker version of aMGC and would like to see your favorite audio/video recording app (that records via the CAMCORDER device) supported, run item #6 from here and post the corresponding 'ps' line. I will then add that app to the next update of this mod, which is likely around the time Android M (final) is released.
[Nexus 5 Android Development] explorer-10:
Can someone post a loud concert environment sample with the modded nexus 5 audio? Is it really improved?
[Nexus 5 Android Development] [Gorgasm]:
I would like to thank [MENTION=2760454]chdloc[/MENTION] again for his amazing work on this mod, some samples here :

https://youtu.be/2QdzT5AZya8

https://youtu.be/J7UvLJRPE_s

https://youtu.be/db4XXFjVsUk

Be careful, it is death metal ;)

Sent from my Nexus 5 with Tapatalk
[Nexus 5 Android Development] explorer-10:
Are there concerts which involve regular or heavy usage of bass?

P.S. was that death metal concert recorded with a Nexus 5?
[Nexus 5 Android Development] krneki10:
[MENTION=2760454]chdloc[/MENTION] I have flashed Aroma installer (running 5.1.1), installed APK and busybox. However, when I try to record with camera, up/down arrows do appear, but dB value changes automatically and I cannot control them. Any ideas, what may be wrong?

edit: well recorded sound gets louder and quieter as I press those up/down arrows, but displayed dB value is still changing randomly.
[Nexus 5 Android Development] chdloc:
There is nothing wrong. The numbers that keep changing is not the gain but the calculated RMS level of the signal currently being recorded. Just tap on the number field between the up and down arrow to see (for a couple of seconds) the relative gain you have applied.
[Nexus 5 Android Development] Jayowend:
Just for this mod, for the first time I backed up, unlocked, wiped, flashed custom recovery, rooted, learned the adb shell—basically stopped being an innocent vanilla user. Just to get this working. Because I can look past all the other small nitpicks of vanilla N5, but not this one since stock mic recording is literally ****. But damn was worth it. The differences in sound quality are pretty incredible. Awesome job, and thanks @spacetaxi for the easy aroma installer still working on 5.1.1

- Busybox isn't included in the installer, is that right? I had to use a third-party app (BusyBox by Stericson) to because it wasn't installed for some reason.. on TWRP 2.8.5.2.

- aMGC indicator doesn't seem to work with 0db noise suppression (the simple fix). The arrows work, but it just displays "% db" for the RMS level, and no LED. using the apk/non-tasker version.

- The adjusted gain value sometimes gets overwritten by the RMS level too quickly for me to read. Maybe there is a way to show the gain value (i.e. the +12db) constantly elsewhere in brackets or something for readability

Otherwise, super solid work! :good: :good:

With the audio fix, even snapchat videos sound like 100x better... now someone just needs to make a video fix and we can rival the iPhone camera heh :))

It actually blows my mind how much of a difference it makes without the crappy noise suppression forced on by Google :mad: and stereo recording is just such a step up. I mean sure, there is some white noise now, but hell I'll gladly take that over choppy audio any day of the week.

This is a must-get mod if you want to record anything on the Nexus 5!!

---

Here are some samples I recorded!!

Music is from the Child of Light soundtrack (Aurora's Theme and Cœur de pirate - Off to Sleep for the singing) since I was playing the game just now lol. about a feet away from speakers, & the lovely voice courtesy of Google Translate :laugh: