yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] Origin8:
Just a quick heads up chdloc, I tried the current fix with 5.1 and it causes a bootloop. I know it's for android 5.0.1 but I was curious to see if it worked on 5.1 aswell lol
[Nexus 5 Android Development] spacetaxi:
Hi chdloc, fyi: The following files have the same md5 on Android 5.0.1 and 5.1:

media_profiles.xml

mixer_paths.xml

libaudiopreprocessing.so

All other files (including audio_effects.conf) have been updated for Android 5.1.
[Nexus 5 Android Development] chdloc:
Thanks guys. So the 5.1 update has not improved the camcorder audio quality in any way?

I'll be all over it once Google releases the sources.

With this Android release, my plan is to tidy things up and post the modified sources on github.
[Nexus 5 Android Development] otavioricciotti:
In respect, 5.1 will be installed only when chdloc updates his mod.

That's it.
[Nexus 5 Android Development] AvivEliyahu:
Cant wait for an update , will wait as much as needed!
[Nexus 5 Android Development] chdloc:
...and the Android sources (AOSP and kernel) are up. That was fast!

Time to burn some midnight oil...;)
[Nexus 5 Android Development] spacetaxi:
Sorry, til now I have not had the time to do audio tests on Android 5.1.

But I really do not expect any changes or fixes regarding camcorder audio to be implemented by Google. The N5 is not the top Nexus device anymore, and *if* they had plans to fix this audio issue, they would have fixed it quicker.

BTW, I'll build a new installer, after your updated fix files become available.
[Nexus 5 Android Development] kayl2:
Were you stuck at "Starting Apps?"
[Nexus 5 Android Development] FringeNY:
I also tried to flash it on 5.1 (of course my fault, I was too fast). Just want to let you know, that I am not stuck in a boot loop. But my audio is completely gone (no Alarm, media or ringtone sounds) and I can't take or play a video at all.

Probably the original files, mentioned by Spacetaxi ( e.g. audio_effects.conf), would make it work again. But I don't know where to get them and how to install them.

Anyway, I can wait for the patch (take your time) and if it won't help, I will have to flash the system again ;)

Thanks a lot for your work!
[Nexus 5 Android Development] Flyview:
Yup. Me too. Should have read this before trying to flash!
[Nexus 5 Android Development] Matrix_19:
*edit : wrong thread*
[Nexus 5 Android Development] chdloc:
Camcorder audio mod for Android 5.1

Please see the OP for the new camcorder audio mod working on Android 5.1.

There were no relevant changes to the audio subsystem associated with the new Android release, so I'm fairly confident that this update will work as expected. But keep in mind, though, that the new update is most likely not compatible with earlier versions of Android.

A few things to keep in mind:

the system partition is now bursting at the seams, only showing about 3.5 MByte of free space after a new flash. You may want to delete unused system apps prior to any further modification of the system partition

if you performed a full flash and plan on using aMGC you need to follow the corresponding instructions given in the OP

I decided not to add telephony sidetone to this release. Let me know if you want to see this feature integrated into a future release. Sidetone is now optionally available, see OP and the new Aroma installer
[Nexus 5 Android Development] RoadToNever:
I'd love to see sidetone in future releases.
[Nexus 5 Android Development] Jamith:
I installed Android 5.1 yesterday and made a short video to see how bad is it without your mod, it wasn't so bad like I expected.

www.youtube.com/watch?v=w-0zQKUEctg

Thanks buddy, the new mod supports stereo playback?
[Nexus 5 Android Development] chdloc:
Yes, stereo playback is supported.

After flashing 5.1, I made a 10 second video to confirm that the problem is still there. It was, so I didn't bother to investigate further.

The audio in the video you posted seems a little better than I remember, but still unacceptable to me personally. Google/LG may have backed off with the noise suppression slightly.
[Nexus 5 Android Development] RoadToNever:
Listen carefully with headphones on the spaces between the beats and notes. Notice how the sound fades unnaturally.
[Nexus 5 Android Development] AvivEliyahu:
You're the best, thank you for all the time you used to make this mod make our phone even better
[Nexus 5 Android Development] LemaNzkT:
When will be aroma installer for 5.1 patch?
[Nexus 5 Android Development] piumach:
Yes! [MENTION=3163883]spacetaxi[/MENTION] could you kindly provide us for this version as well? Thanks!
[Nexus 5 Android Development] spacetaxi:
The new installer is ready. I'm just waiting for some final feedback from chdloc. So I think I can post the new installer later today. :cowboy:
[Nexus 5 Android Development] piumach:
Sounds good! :)
[Nexus 5 Android Development] spacetaxi:
Aroma installer of chdloc's audio fix for Android 5.1 stock rom

This is the aroma installer of chdloc's audio fix for Android 5.1 stock rom. Other installers of the fix are available for 5.0.1 stock rom (see post #235) and 4.4.4 AOSP-based roms (see post #3).

I will keep this post updated if there will be a new version of the installer.

2015-03-13: Updated installer (v1.1) for Android 5.1 stock rom, including fix for "no TX audio bug" when on speakerphone (see post #645)

The installer has the following features:

Camcorder Audio Fix. You can select the level of noise suppression, microphone gain, mono or stereo recording and audio bitrate. Optionally the stereo playback mod and the sidetone config can be installed. You can choose the phone's orientation for stereo playback (micro-usb port to the right or to the left), the gain levels for ear speaker and bottom speaker, the sidetone level for headset and handset use cases. When installing the "advanced" audio fix (6dB or 12dB noise suppression), you can optionally install the prerequisites (tinymix binary and scripts) for chdloc's aMGC implementation. To actually use aMGC you will also have to install the aMGC apk or the Tasker project provided by chdloc.

Install stock audio libs+config. Optionally the stereo playback mod and the sidetone config can be installed. You can choose the phone's orientation for stereo playback (micro-usb port to the right or to the left), the gain levels for ear speaker and bottom speaker, the sidetone level for headset and handset use cases. The aMGC prerequisites (tinymix binary and scripts) will be deleted.

Please make a backup of the system partition by using the recovery (e.g. TWRP) prior to installing this zip, so you can just restore the system partition if you don't like the changes. And there's always a (small) risk that something goes wrong when flashing a zip. Anything you do, you are doing at your own risk. :fingers-crossed:

The installer will overwrite the following files:

/system/etc/media_profiles.xml

/system/etc/mixer_paths.xml

/system/lib/hw/audio.primary.msm8974.so

/system/lib/libaudioflinger.so

/system/lib/soundfx/libaudiopreprocessing.so

/system/vendor/etc/audio_effects.conf

Additionally the following file and directory may be installed or deleted:

/system/bin/tinymix

/data/local/tmp/camera/ (containing some scripts)

Please do not forget to post your experiences with this fix! Happy flashing! :)
[Nexus 5 Android Development] piumach:
Just installed and tested, it works perfectly!

This mod is not only amazing, it's absolutely necessary for the Nexus 5. It turns the Nexus 5 camcorder into a working and useable tool like it should be from the manufacturer :)

Many thanks to [MENTION=2760454]chdloc[/MENTION] for the outstanding works and to [MENTION=3163883]spacetaxi[/MENTION] for the aroma version ;)
[Nexus 5 Android Development] Flyview:
x1000

Sent from my Nexus 5
[Nexus 5 Android Development] LemaNzkT:
Thx works good.

Btw. I feel the dual speakers sounds louder on 5.0.1 : P
[Nexus 5 Android Development] Flyview:
After using aroma installer to install the newest version for Android 5.1, my device became stuck at the colored dots swinging around. I had to power off, and when powering back up it went past that but I was presented with "Android is starting... Optimizing app xx of xx", and when that finishes it's stuck at "Starting apps.". Could this be because the new system partition is as you said, "bursting at the seams"? I installed all of the options except the prerequisites for aMGC. The only other "system mods" I have is I flashed the Nexus 6 Android sounds, and rooted with SuperSU.
[Nexus 5 Android Development] RoadToNever:
I tested sidetone and it works as expected in headset and handset mode. A little faint even with levels cranked, but you can tell it's there. Some unexpected behaviour when I activate speakerphone: voice gets picked up by the top side mic. It makes sense for minimising feedback though. So let this be a heads up to anyone trying the sidetone feature!

One scenario which seems like a bug though: With headphones connected voice is picked up by the top side mic, regardless of speakerphone being activated or not.
[Nexus 5 Android Development] chdloc:
My guess is that the added Nexus 6 sounds filled up all available space of your system partition. You will need to remove some system apps that are of no use to you. Personally, I deleted all foreign keyboard input options.
[Nexus 5 Android Development] Flyview:
Thanks for the swift reply! That's what I was thinking as well, although I was hoping since the old sounds get overwritten (do they?) they wouldn't take more space. How can I check the current size / max size of the system partition? How much space is taken by this mod?
[Nexus 5 Android Development] chdloc:
It not a bug. It is expected (stock) behavior that the top (close to the headset port) microphone is activated both in speakerphone mode as well as in headphone (not headset) mode.

BTW, you want sidetone to be faint. If sidetone is too hot you will tend to speak too softly. Similarly, if the sidetone is non-existent or too faint you tend to speak too loud. The default values should be relatively close to what has been recommended for enterprise telephony.
[Nexus 5 Android Development] RoadToNever:
Thanks for clarifying. :)
[Nexus 5 Android Development] chdloc:
You can check your current system partition either with an app like Titanium Backup or via the adb shell command 'df'.

This mod takes up very little additional space, maybe on the order of 100 kByte as it mainly replaces existing files. aMGC needs a little more (tinymix, busybox, and shell scripts)

I'm guessing you already completely maxed out your available disk space with the Nexus 6 sounds which may not have overwritten the old ones, but I'm not sure.
[Nexus 5 Android Development] Flyview:
I reflashed system.img, free space was 5.36mB. I then flashed this audio mod (and reflashed elementalX kernel, but i don't think that affects /system much), and free space is now 2.89mB! I should redo the test with completely stock system and kernel.
[Nexus 5 Android Development] marquimsp:
beautiful sound, sciroccos are awesome. Fantastic low end!

After the mod, of course [emoji1]
[Nexus 5 Android Development] Pilatus47:
I tried the new fix for Android 5.1 with Cataclysm (dirty flash). While the audio playback is perfect,when I make a phone call, the ear speaker is to low (even if I have the max volume). And if I put it on speaker mode, the person on the other end, reports a very very low sound.

To me, it seems that the fix is not working on calls but I can´t be sure. I´m going to do a clean install and report back. Is anyone else getting similar results?

Btw latest version for 5.0.1 was perfect :good:

Saludos
[Nexus 5 Android Development] chdloc:
Are you sure you are posting in the correct thread? This mod has never claimed to do anything for phone calls, other than the new sidetone support.

However, you could manually edit your mixer_paths.xml file to boost some of the gains relevant to telephony.
[Nexus 5 Android Development] Pilatus47:
You right. But I tough it was because of the mod. Because with 5.0.1 and the latest mod for it. I had to take down the volume to half because in some places people around could hear the volume from the ear speaker. And with speaker mode, volume was really really good. I mean the playback sound was equal to the phone call audio in therms of quality and loudness which was very good.

But maybe it was Cataclysm 5.0.1 :) I'm gonna try the mod again with a clean install and see if I get the results I had with the 5.0.1 version.

Saludos
[Nexus 5 Android Development] adnan.selimagic:
I can confirm this. If I turn on speaker during call, the person on the other end can not hear anything.

I'm on stock rooted android 5.1 with franco kernel and nothing else, no other mods
[Nexus 5 Android Development] LemaNzkT:
Same here
[Nexus 5 Android Development] chdloc:
OK, I was able to reproduce the problem. I traced it down to the audio HAL. I guess I was not careful enough in porting my changes to the new sources. Thanks for reporting!

Stay tuned...
[Nexus 5 Android Development] Sanjay Varma:
I'm not much into Video recording, but I've a problem with Audio recording. While recording with (Hi-Q MP3 Voice Recorder) if I get a phone call in between recording, the recording will be lower'd as of the voice is coming from water or something.

So If I apply this, can that be fixed ? I'm on StockROM L5.1 + Code Blue Kernal

:)
[Nexus 5 Android Development] chdloc:
No, unfortunately.

Are you having the same problem when you use a different audio recording app, like "Easy Voice Recorder [Pro]" or "Voice Recorder"?

One thing my mod would do for you is to allow you to record in stereo if you use "Easy Voice Recorder Pro".
[Nexus 5 Android Development] chdloc:
New version uploaded to OP which fixes the "no TX audio bug" when on speakerphone.

Those of you who feel comfortable pushing files manually, download the new archive, camcorder_audio_fix_plus_stereo_playback_LMY47D_v1_1.tar.gz, grab the audio HAL, audio.primary.msm8974.so, push it to /system/lib/hw, set the permissions to 644, and reboot.
[Nexus 5 Android Development] spacetaxi:
Updated installer

I've posted an updated installer including this fix, see post #627.
[Nexus 5 Android Development] Flyview:
Ok I did this again.

Fresh system.img with 0 modifications: 11.9mB free

+ElementalX 2.11 kernel: 9.52mB free

+SuperSU: 2.89mB free

+Camcorder/Stereomod/sidetone mod: 2.88mB free

Removing Hindi, Korean and Pinyin keyboards frees about 25mB.

So it looks like this audio mod takes basically no additional space (10kB).
[Nexus 5 Android Development] Pilatus47:
Thanks for the update [MENTION=2760454]chdloc[/MENTION] and [MENTION=3163883]spacetaxi[/MENTION] for the installer.

Working perfectly. With clean flash of Cataclysm 5.1 beta. Speakerphone issue is gone and sidetone feature is working perfectly with stock values.

Playback audio is perfect just like the previous versions. Btw, in using this values for playback audio: ear speaker 96 speaker 86 perfect stereo sound sweet spot. Maybe a little bit to high for some users (YOLO) but I been using similar values since the release of the mod and the speakers are good at the time of this post. I would not recommend go higher at least on the ear speaker, because there´s distortion. I will update if anything happen.

About the volume on the calls, it´s not as loud as it was on Android 5.0.1 and with the clarification that this mod doesn´t affect audio while calling, maybe it could be the new Android 5.1 radio. Anyway the volume stills good.

Saludos
[Nexus 5 Android Development] adnan.selimagic:
I just have to restart my phone because the person on the other end cannot hear anything. I wasn't using speakerphone.

After restart everything is OK.

I'm on latest version v1.1
[Nexus 5 Android Development] chdloc:
This is odd behavior. I would expect things to either work or not work. Consistently. My mod does not do anything "adaptive" in the context of telephony. The mixer turns things either on or off. Did you choose to install the sidetone add-on?

It is possible that your problem happened as a result of "stock" dual-microphone processing that has been described widely to potentially cause sudden drops of TX levels.

Next this happens to you please capture and share your logcat and kernel messages before you reboot.
[Nexus 5 Android Development] adnan.selimagic:
Yes it is odd. I didn't install sidetone add-on...if it happens again I'll send you logcat.

Thanks [MENTION=2760454]chdloc[/MENTION] :good:
[Nexus 5 Android Development] gpvecchi:
Ehm, sorry, what's the new setting in aroma version for 5.1 that enables sidetone?
[Nexus 5 Android Development] spacetaxi:
Not sure if I understand your question correctly. The new setting is "Enable sidetone?" and the options are:

No

Headphone/Headset only

Headphone/Headset + Handset

The first option keeps sidetone disabled. The latter two options enable sidetone for headphone/headset use case or headphone/headset + handset use cases. See post #574 for further details.
[Nexus 5 Android Development] gpvecchi:
Thanks, my question was not clear in effects... I mean: what's a sidetone?
[Nexus 5 Android Development] spacetaxi:
Please read post #574, where chdloc explains what it is and how it works.
[Nexus 5 Android Development] Pilatus47:
Enable sidetone (stock values recommended), grab your headphone or earphones and use them while your placing a call and hear it for yourself ;)

If you don't like it, you can always go back to stock with spacetaxi's installer.

Saludos
[Nexus 5 Android Development] explorer-10:
Since the attached audio fix for 5.1 on the first page is stereo playback, is the one in this link dual mono playback? http://xdaforums.com/showpost.php?p=59392397&postcount=627
[Nexus 5 Android Development] spacetaxi:
No, the file from post #627 is just the fix from post #1 wrapped up in a flashable installer for convenient installation.
[Nexus 5 Android Development] D.martijn:
Hi,

I want to flash this mod but I'm wondering what the basic settings are for overall good audio?

I 've looked at the settings in the aroma installer but I'm not sure what settings are the best.

some input would be great :)
[Nexus 5 Android Development] spacetaxi:
Sorry, but each device is a little bit different and each user has different preferences. So you'll have to try out and find your personal preferred settings on your own. The default settings in the installer are a good starting point.
[Nexus 5 Android Development] spacetaxi:
Nexus 6 here I come

Hi all, today I'm leaving the Nexus 5 community, as I'm replacing my Nexus 5 with a Nexus 6. So I will no longer be able to provide updated aroma installers, as I will not have a device for testing. [MENTION=2760454]chdloc[/MENTION] told me that he will take over that task. So from now on you will get updated audio fixes and updated installers from a single source. ;)

I want to thank you all for using my installers and I'd be very happy to see you in the Nexus 6 (or some future device) forum here at xda.

Keep on rocking! :cool:
[Nexus 5 Android Development] eddie_gordo:
Thank you for your work and dedication! :good:
[Nexus 5 Android Development] marquimsp:
Hey chdloc, long time no see!

After all 5.1 cataclysm updates I decided to reinstall the mod and it works, but no led indicator and the +/- buttons show up everywhere (photo, gallery), what am I doing wrong?

thanks in advance!
[Nexus 5 Android Development] chdloc:
It sounds like you have hotword detection on any screen enabled, with which aMGC is unfortunately incompatible.
[Nexus 5 Android Development] marquimsp:
Exaaaaactly! But hotword detection on any screen is totally dispensable, this mod isn't [emoji41]

Thanks again!
[Nexus 5 Android Development] Matrix_19:
Is the new build 5.1 (LMY47I) compatible with the fix?
[Nexus 5 Android Development] adnan.selimagic:
Yes it is
[Nexus 5 Android Development] [Gorgasm]:
I have just one question about the aMGC : Cinema FV-5 has the possibility to use an external microphone for audio recording, and I would like to know if the aMGC is still useable in this context ? Thanks ! :)
[Nexus 5 Android Development] chdloc:
Using aMGC with an external microphone (via the headset port) is not possible with the current mod as it has only an effect when the CAMCORDER device is being used. This was a design decision as I wanted to only impact CAMCORDER recordings with no modification of the system in other contexts.

Having said that, it is very easy to modify audio_effects.conf and one of the required shell scripts to allow aMGC to work with an external microphone. I just tested the efficacy of the changes. However, these changes may activate my code in the context of other apps with unknown side effects. Let me know whether you or anyone else would like to experiment and I'll post the required edits.
[Nexus 5 Android Development] RoadToNever:
I'm in!
[Nexus 5 Android Development] chdloc:
[Experimental] aMGC for external microphones

What follows is a proof-of-concept way to enable aMGC for external microphones (via the headset port) when using Cinema FV-5.

Note that it is certainly possible to support other apps that allow for selecting external microphones.

In order for aMGC to show anything useful, at the end of /system/vendor/etc/audio_effects.conf replace

pre_processing {
voice_communication {
aec {
}
ns {
}
}
camcorder {
ns_webrtc {}
}
}

with

pre_processing {
voice_communication {
aec {
}
ns {
}
}
camcorder {
ns_webrtc {}
}
mic {
ns_webrtc {}
}
}

This modification enables my processing (which at this point is limited to 48 kHz sampling rate) for any app the requests the "MIC" device. I have no idea which apps may be asking for the "MIC" device, so there may be unintended side effects.

To be able to change the external microphone gain, add the following two lines to the end of the file /data/local/tmp/camera/adjust_gain.sh

tinymix "ADC2 Volume" $adc
tinymix "DEC5 Volume" $dec

Note that this change is quick-and-dirty as gains are adjusted based on the mixer settings pertaining to the main microphones. A "final" solution needs to be implemented more carefully.

It is even possible to force "Google Camera" to use the external microphone.

If you'd like to try to record with an external microphone (mono only) when using "Google Camera" replace

<path name="voice-rec-mic-mod">
<path name="camcorder-stereo" />
</path>

with

<path name="voice-rec-mic-mod">
<path name="headset-mic" />
</path>

in your /system/etc/mixer_paths.xml. Also, you need to modify the adjust_gain.sh script as shown above. Do

not

modify audio_effects.conf in this context, so unintended side effects can be kept to a minimum.

In certain scenarios, this is actually a quite elegant solution to get around the poor microphones (in terms of SNR) that are built into the Nexus 5. For instance, one could use a headset adapter to hook up a good-quality dynamic microphone. I'm not sure whether the microphone preamp in the WCD9320 is powerful enough to drive that microphone, but it would be worth a shot. (Of course, the best answer to the quality problem would be to use a high-quality microphone + preamp + ADC tied in via USB.)

If there are enough folks interested in this I'll be packaging external microphone support in a future release of my mod. Let me know...
[Nexus 5 Android Development] sivarticus85:
Ringer and notification volumes are nice and loud, but alarms are much quieter... To the point I almost didn't even hear it go off this morning. Anyone else have that issue?
[Nexus 5 Android Development] aeoveu:
Okay, maybe its just me, but the loudspeaker dual stereo mod doesn't work. Is anyone else also facing this issue?

It was fine before the minor update to 5.1.