yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] chdloc:
Flash the attached zip in TWRP recovery.

Before you do that, however, make sure that you do not have the file /system/etc/audio_platform_info.xml sitting on your phone. ROMs that are derived from AOSP typically do not have this file, but ROMs derived from CM often do. If you have this file already, flashing this zip may have unintended consequences. In those cases you would need to add

<device name="SND_DEVICE_IN_CAMCORDER_MIC" acdb_id="89"/>

inside the <acdb_ids> tags rather than flash the zip.
[Nexus 5 Android Development] rsmarx:
Hi, I guess this procedure solved the "underwater" audio. I still have to do some tests with similar recordings I did, even with audio messages.

But I noticed the sound is much better; it's not 100% clear, but now the "water" is gone.

Could you please clarify to me why I can't see the files I install with TWRP?

After I installed the zip, I checked the "\system" folder and I didn't find the "etc\*.xml" file. Then I copied manualy with TWRP the folder "etc" to \system, then rebooted and again the file was not there.

Thank you for the support!!
[Nexus 5 Android Development] chdloc:
Your phone would not boot if you did not have xml files in the /system/etc folder. Use a file manager, navigate to

/system/etc, take screenshots of the contents, and post them here.
[Nexus 5 Android Development] rsmarx:
First I checked only using TWRP file manager, but I guess it doesn't show all the files. Then as you said I used a File Manager app and the file was there. Well, I guess the problem is solved!! :victory::laugh::good:

Please check the screenshots.

I'm going to perform this procedure in another Nexus 5 of mine and regarding the Nexus5_simple_camera_fix_aosp_universal.zip file you sent in previous post, there are 3 folders: _MACOSX, META-INF and system.

The only folder necessary is the system one, right?

Thank you so far!
[Nexus 5 Android Development] chdloc:
If you copy the file manually, you only need the single xml file in system/etc, but you need to make sure that the permissions are set to rw-r--r-- (644) after copying.

If you install the mod with TWRP you I need the actual zip file.

In either case you can ignore the _MACOSX folder.
[Nexus 5 Android Development] rsmarx:
First I flashed the zip file, then I didn't see anything, then I copied the *.xml file, than, last, I flashed the zip file again.

Thanks for all the attention and support!!

Best regards.
[Nexus 5 Android Development] complicazio:
Thanks, i will try
[Nexus 5 Android Development] fun12892:
Anybody knows how to make stereo recording work on Nougat? Also to turn off noise suppression. Tried everything that people suggested here. I'm on Euclidian Nougat 7.1.2 with Franco kernel.
[Nexus 5 Android Development] chdloc:
For turning off noise suppression, did you try this?

For stereo recording, post your /system/etc/mixer_paths.xml and /system/etc/media_profiles.xml files.
[Nexus 5 Android Development] fun12892:
Hi. I've attached three files for you to look at:

media_profiles.xml

mixer_paths.xml

audio_platform_info

I extracted these files right from the Euclidian ROM's zip, untouched. Because I messed up with these files on my phone too much that I think I lost BiQuads mod. :(

Also! Could you make my speakers dual mono? :D I did it before but I'm not sure if I did it right. I don't like the stereo because the small speaker is too weak compared to the main speaker. Dual mono is better so that the small speaker and main speaker produce the same sound, louder sound.

Thank you very much! :D
[Nexus 5 Android Development] chdloc:
The attached two files, i.e. mixer_profiles.xml and media_profiles.xml, should enable stereo recording on your ROM, which already seems to have biQuads support built-in. The attached mixer_paths.xml should also includes dual-mono playback. You (your stock ROM) exhibits a channel imbalance with stereo playback since both channels had identical gains, even though the main loudspeaker plays louder than the earpiece. To get a true stereo effect you need to dial down the gain controlling the main loudspeaker by about 8 dB in the "speaker" device, i.e. the "RX7 Digital Volume" control.

Copy those two files to /system/etc, change permissions to 644 (rw-r--r--), and reboot.

The audio_platform_info.xml of your ROM already has the required parameter to disable noise suppression for camcorder recordings. If the recordings still sound distorted (some describe the sound as "underwater" or "bubbly") then your ROM uses a non-standard audio HAL and/or audio calibration data and there is, unfortunately, nothing I can do for you.
[Nexus 5 Android Development] fun12892:
Thank you very much!! :laugh: I just tested and my videos sound a lot natural now. There are noises but that's to be expected. A little noise is better than losing quality because of the bubbly effect. Thanks!
[Nexus 5 Android Development] Ares03:
Hi all,

I'm trying to run the aMGC but when I open my Google Camera I can't see the VU-meter.

I have:

-ROM: CandySix 6.0.1M MOB30Z

-Kernel: Blu_spark 3.4.0

-App: Google Camera: 3.1.025

What I've done:

I flashed the 6.0.1 zip with Aroma installer and choosed prerequisites for aMGC, then I installed the aMGC apk.

Thanks
[Nexus 5 Android Development] chdloc:
The aMGC "app" requires accessibility privileges. Did you grant them?
[Nexus 5 Android Development] Ares03:
Yes, but nothing changed :(
[Nexus 5 Android Development] chdloc:
If you are certain that root access is not blocked by your root manager, then I'm afraid this mod is incompatible with the ROM you are running.
[Nexus 5 Android Development] adenandrians:
Anybody knows how to make stereo recording work on Nougat? Also to turn off noise suppression. Tried everything that people suggested here. I'm on Aosp Extended Nougat 7.1.2 with stock kernel.
[Nexus 5 Android Development] chdloc:
Post the following three files:

/system/etc/mixer_paths.xml

/system/etc/media_profiles.xml

/system/etc/audio_platform_info.xml

and I'll edit them for you
[Nexus 5 Android Development] adenandrians:
do you have email?

because i don't know how to attach file :'(
[Nexus 5 Android Development] chdloc:
You can push the files to Google Drive or Dropbox and post or PM a link.
[Nexus 5 Android Development] Nolfer:
I'm on Lineage 7.1.2 caf

Could you do simple fix with stereo playback please?
[Nexus 5 Android Development] chdloc:
The files you attached indicate that the simple fix is already in place.

To get stereo playback to work, all you need to do is to replace the "speaker" device in your mixer_paths.xml file with

<path name="speaker">
<ctl name="SLIM RX1 MUX" value="AIF1_PB" />
<ctl name="SLIM RX2 MUX" value="AIF1_PB" />
<ctl name="SLIM_0_RX Channels" value="Two" />
<ctl name="RX1 MIX1 INP1" value="RX1" />
<ctl name="RX7 MIX1 INP1" value="RX2" />
<ctl name="RX1 Digital Volume" value="89" />
<ctl name="RX7 Digital Volume" value="81" />
<ctl name="SPK DRV Volume" value="6" />
<ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />
<ctl name="DAC1 Switch" value="1" />
</path>

and reboot.
[Nexus 5 Android Development] Nolfer:
I did and it didn't work.
[Nexus 5 Android Development] chdloc:
Which part did not work, turning off noise suppression or stereo loudspeaker playback?
[Nexus 5 Android Development] jacomail95:
I put together a flashable zip and edited the mixer file as said by [MENTION=2760454]chdloc[/MENTION], the stereo playback seems to work
[Nexus 5 Android Development] gr-e:
This simple fix should work for your build:
[Nexus 5 Android Development] Nolfer:
Stereo playback doesn't work

---------- Post added at 12:08 PM ---------- Previous post was at 11:39 AM ----------

Flashed, didn't work :/
[Nexus 5 Android Development] jacomail95:
I flashed my zip in the latest unofficial LineageOS 15 Oreo, it works on my device, so I don't know what the problem can be, sorry
[Nexus 5 Android Development] Nolfer:
I'm on lineage 7.1.2 caf and viper4android. Don't know if this info will help, but I'll write it anyway.
[Nexus 5 Android Development] jineshpatel30:
[MENTION=2760454]chdloc[/MENTION]

I'm facing an issue which is not exactly related to this topic but since you have much more experience than anyone regarding Nexus 5 Sound,

I'm gonna shoot it here :p

I use ARISE mod for sound improvement and I get very minor & random "cracking" while listening to Songs over Headphone.

Deep buffer removed

ElementalX Kernel (with Stock cracking occurrence is less but not completely eliminated )

Screen ON/OFF doesn't matter (mostly)

ROM doesn't matter (same issue on Stock 6.x , custom 6.x & 7.1.2 DarkRom currently)

Increasing Low CPU freq. helps (well if i increase it to 500 from 300) but i think this is not proper fix as i personally don't use extra ARISE features (Dolby n all) just V4A (just for surround sound only no other weird processing enabled) & ICE Sound both of which requires very less processing.

So my guess is there should be some Gain or some other value that we can change that should help with this, but i don't know much about which value to tweak. (i tried changing Headset LH & RH gain little bit but it didn't help)

So if you have some insights that may help kindly share :)

Thanks !
[Nexus 5 Android Development] chdloc:
The fact that the CPU clock speed seems to be correlated points to the CPU starving for resources and not being able to keep up with the audio processing done in ARISE. I'm guessing that what you are hearing are discontinuities at buffer boundaries (dropped samples due to underruns). I would suggest you reinstate deep-buffer processing which should help avoid buffer underruns. Note that other than introducing a little more delay, "deep-buffer" audio processing should produce the same exact audio signal that "low-latency" audio processing is producing.
[Nexus 5 Android Development] jineshpatel30:
Actually,

there's no deep buffer section by default in DarkRom 7.1.2 (and also on LOS 14.1 on which it's based).

On stock rom keep deep buffer would lead to no processing of V4A, still i will give it try by manually adding deep buffer.

Let's see how it's pans out on custom rom.
[Nexus 5 Android Development] jineshpatel30:
Too soon to tell with confidence but initial test shows improvement with Deep Buffer enabled (unlike stock v4a is processing on custom 7.1.2 rom)

Thanks again :good:

btw what is it that deep-buffer exactly do ? in simple language :p

you give a hint in last reply but i didn't understand what's "buffer underruns"
[Nexus 5 Android Development] chdloc:
The audio subsystem deals with audio in chunks that come in at regular intervals.

Ignoring the DSP offloading for the moment, the Nexus 5 by Google-default supports low-latency and deep-buffer audio playback schemes. At a high level, the only difference between low-latency and deep-buffer is the size of the chunks being fed to the audio subsystem from the audio playback app. Simply put, the bigger the chunk size the more time the audio subsystem can spend on signal processing and the likelihood of audio dropouts goes down as signal processing algorithms are generally more efficient with larger chunks of audio. Generally, you want deep-buffer playback if you plan on applying a lot of audio effects to your audio stream. The only disadvantage of deep-buffer playback is that audio latency is proportional to the audio chunk size. There are apps where latency matters a lot (such as synthesizers, sequencers, VoIP, some games, etc) and those typically avoid deep-buffer audio playback. For pure music playback apps, the additional latency added by deep-buffer playback is irrelevant.
[Nexus 5 Android Development] jineshpatel30:
Thanks for Explanation.

I did more testing and till now no cracking with deep-buffer so It's working :)

With Deep buffer enabled some apps stops V4A processing (ex. YouTube) but other effects still works & i would always choose loosing universal functionality of V4A rather than hearing constant random cracking in music player, where audio effects matters the most :p
[Nexus 5 Android Development] Nolfer:
Stereo Playback doesn't work. Now that I think of it, I don't even know if noise suppression does.
[Nexus 5 Android Development] chdloc:
Please post the contents of your /vendor/etc folder
[Nexus 5 Android Development] Nolfer:
Thank you anyway, but I decided for a variety of reasons to go back to non-CAF LineageOS. Too much instability. Calls not working in recent updates, microphone gain really low, overall performance high, but subject to hiccups and instability.

Flashed the zip by jacomail:

now it works. Would reallly like an easy way to set the various gains fast.
[Nexus 5 Android Development] Nolfer:
Now I have installed viper4android for nougat, and stereo playback doesn't work anymore. How can I fix this? I really like viper4android
[Nexus 5 Android Development] chdloc:
It appears that Viper is messing with the mixer. Post your current (post viper install) mixer. The dual loudspeaker mod will need to be applied manually to that file.
[Nexus 5 Android Development] Kusie:
Is this MOD still usable? Tried to install the ZIP via TWRP and install the AGC app on my rooted 6.0.1 Stock ROM N5 I don´t get a VU meter in google Camera. Files seem to be put in the right place and right permissions by the Aroma installer.

Could be a problem that "Google Now" has been replaced by the "Google Assistant" lately and I don´t know where and how "hotwork detection on any screen" might need be deactivated - I don´t find that option anywhere.

First time I started google camera after installation I got and "unable to connect to camera" error. Rebooted, now it works but it takes a few seconds until i´m able to record video...
[Nexus 5 Android Development] chdloc:
Did you give the AGC app Accessibility privileges? Those are needed to detect that the Google Camera app is being used.

Try toggling Settings->Google->Search->Voice->Voice Match->Say "OK Google" any time
[Nexus 5 Android Development] Nolfer:
Back here once again. LineageOS 7.1.2, no audio platform xml, though.

Could you do simple fix, stereo playback? I cannot find the "speaker" device in mixer paths. There are multiple ones but they seem to be sub-somethings.
[Nexus 5 Android Development] chdloc:
There is a "speaker" device in the mixer file you attached. Replace the content of that device with the one outlined here

To enable the simple fix, you need to create (or add to) the audio_platform_info.xml file with the content as posted here.
[Nexus 5 Android Development] LaVelete:
On 6.0.1 I could record stereo without noise reduction, now on Nougat the simplex mod, doesn't allow it, only mono no stereo. Please could you do a stereo mod? To work like on 6.0.1, I use my phone A LOT to record.

Regards.
[Nexus 5 Android Development] Nolfer:
Where is audio platform info located? Also, I'm not able to edit mixer paths even mounting system as rw in script manager
[Nexus 5 Android Development] chdloc:
This mod was always meant to track the official Google ROM. As Google has stopped support for this phone, there will be no more updates for this mod.

However, post /system/etc/mixer_paths.xml as well as /system/etc/media_profiles.xml and I'll let you know which lines to modify to support stereo recording.

In /system/etc. If it is not there, you need to create it with the contents as described in the post you quoted.
[Nexus 5 Android Development] LaVelete:
I can't attach the files directly so I uploaded it to zippyshare. Here.

Explain me what to do, because I think I update to Oreo very soon. Thank you.

Regards.
[Nexus 5 Android Development] chdloc:
In you mixer_paths.xml replace

<path name="camcorder-mic">
<path name="handset-mic" />
<ctl name="ADC1 Volume" value="15" />
<ctl name="DEC6 Volume" value="88" />
</path>

with

<path name="camcorder-stereo">
<!-- chdloc: settings referring to the top (auxilliary) microphone; left channel -->
<ctl name="AIF1_CAP Mixer SLIM TX4" value="1" />
<ctl name="SLIM TX4 MUX" value="DEC4" />
<ctl name="DEC4 MUX" value="ADC3" />
<ctl name="ADC3 Volume" value="15" />
<ctl name="DEC4 Volume" value="84" />
<!-- chdloc: settings referring to the bottom (main) microphone; right channel -->
<ctl name="AIF1_CAP Mixer SLIM TX6" value="1" />
<ctl name="SLIM TX6 MUX" value="DEC6" />
<ctl name="DEC6 MUX" value="ADC1" />
<ctl name="ADC1 Volume" value="15" />
<ctl name="DEC6 Volume" value="84" />
<ctl name="SLIM_0_TX Channels" value="Two" />
</path>

In media_profiles.xml, search for all references to "channels" in the Audio aac codec settings and increase them from 1 to 2, for instance

<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="17000000"
width="1920"
height="1080"
frameRate="30" />
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="[COLOR="Red"]2[/COLOR]" />
</EncoderProfile>

Also, increase the maximum supported channels for the AAC codec to two, i.e.

<AudioEncoderCap name="aac" enabled="true"
minBitRate="758" maxBitRate="288000"
minSampleRate="8000" maxSampleRate="48000"
minChannels="1" maxChannels="[COLOR="red"]2[/COLOR]" />

After the changes you need to reboot for them to take effect.
[Nexus 5 Android Development] LaVelete:
It worked changing the string "camcirde-stereo" to the original "camcorder-mic".

I see in that android is compatible with flac and opus, and hevc, there`s a way to use them on the nexus 5? I can set a higher bitrate on audio and video profiles, but it'll be interesting to choose other codecs.

Regards and thank you!!
[Nexus 5 Android Development] gr-e:
I've updated my Nexus 5 to LineageOS 15.1 and here are my observations so far:

audio_platform_info.xml file is located in system/

vendor

/etc folder. It enables the "simple fix" by default.

media_profiles.xml is now called media_profiles_V1_0.xml and is also located in system/

vendor

/etc.

mixer_paths.xml is ready for stereo recording out of the box. You only need to make some changes in media_profiles_V1_0.xml:
[Nexus 5 Android Development] Fefe9110:
Hi guys, does anyone know how to fix the problem with Oreo roms? I have the aosp extended 5.4. Thank you very much.
[Nexus 5 Android Development] chdloc:
Take a look at this post.

On Oreo ROMs, the relevant file (audio_platform_info.xml) may have moved from /system/etc to /vendor/etc.

If that file is present on the ROM you are using with the relevant entry as described in the linked post, then that would be all that can be done.

If that file is not present try adding it.
[Nexus 5 Android Development] rsmarx:
Hi [MENTION=2760454]chdloc[/MENTION] !

First you helped me with this problem and we fixed it for stock ROM Marshmallow (6.0). I made great videos with this phone!

Since Google won't update Nexus 5 anymore I flashed, yesterday, the custom ROM RR 6.1.0 (Android Oreo 8.1) and now I'm facing the same problem with the camcorder.

I checked the link above you mentioned but it didn't work.

-> I created the audio_platform_info.xml file;

-> Change the permission to 0644 using TWRP;

-> Copy to /system/etc and to /vendor/etc (just to make sure) and rebooted.

I know it's not up to you to support custom ROMs, but if you could I'll appreciate.

Regards!
[Nexus 5 Android Development] chdloc:
A couple of things come to mind:

at least on my Pixel, the newer releases of Android prohibit direct modification of /system or /vendor. It appears you are changing or adding a file, but everything is back to stock after a reboot. This may be a result of the A/B boot slot setup on the Pixel but it may also be true for older devices

you may need to change the acdb_id value inside the audio_platform_info.xml file. To which value? No idea, trial-and-error (reboot after each modification!) is the only option
[Nexus 5 Android Development] rsmarx:
Hi, thanks for the reply!

I found the file and it is located in /vendor/etc/audio_platform_info.xml

Inside the file is written below and nothing more.

<audio_platform_info>
<acdb_ids>
<!-- empty -->
</acdb_ids>

<backend_names>
<!-- empty -->
</backend_names>

<pcm_ids>
<!-- empty -->
</pcm_ids>

<device_names>
<!-- empty -->
</device_names>
</audio_platform_info>
[Nexus 5 Android Development] chdloc:
Well, that's your problem then.

The contents of audio_platform_info.xml that disables noise suppression is shown here.
[Nexus 5 Android Development] rsmarx:
Thank you [MENTION=2760454]chdloc[/MENTION] that really solved the camcorder audio issue!!!

Again, thank you very much!!

Best regards!!
[Nexus 5 Android Development] faddys123:
hi guys I have the xiamoi mi a1 that runs the android one program and on the stock rom there is no microphone suprression at all, however every Custom ROM i've tried has microphone suppression and low volume when recording in 3rd party apps like Snapchat & Instagram.

I am wondering if someone could he me here, I can send you the files required of the stock and also of the custom roms
[Nexus 5 Android Development] sumade:
Hi,

I am trying to do this on ZTE Axon 7 and wonder if you can help, this is what I have done so far (attached), no changes to mixer_paths.xml (apart from a few changes to existing gain values which I am not sure altered much as I'm not sure I'm editing the right thing). I think the abcd ID in audio platform xml may be different for this device, although not sure what I am aiming for. If you can help, would be very much appreicated, I have tried all sorts to get rid of noise cancellation, but no luck.

I followed this here, https://xdaforums.com/xiaomi-redmi-3s/how-to/fix-fixing-bad-sound-video-recording-t3523171/page13

but I did not make any changes to mixer_paths.xml yet as although the files for this device seem a bit more similar, they are not exactly as described so didn't want to screw anything up.

Thanks
[Nexus 5 Android Development] chdloc:
First, you need to make sure that you are changing the ACDB of the device that is actually used for the recording mode you are trying to fix.

For that open an adb shell and run

logcat | grep audio_hw

While the logcat is still running start the audio recording with an app that produces bad audio. Post the result here, so I can give you suggestions on what to do next.
[Nexus 5 Android Development] sumade:
Thanks very much indeed, hopefully this will stop the guesswork! I'll take a look tomorrow.
[Nexus 5 Android Development] sumade:
Hi, I ran adb with the command. I have attached the output.

If you can help would be really appreciated. Thanks.
[Nexus 5 Android Development] chdloc:
The device enabled for your recording session is "handset-mic"

What you will need to do is to change the acdb_id number

<device name="SND_DEVICE_IN_HANDSET_MIC" acdb_id="1"/>

in your audio_platform_info.xml from 1 to some other number X, and reboot.

It is impossible for me to predict what X needs to be to disable noise suppression on your phone.

Unfortunately, all you can do is go by trial-and-error. Change the number X, reboot, and make a recording. Does it still sound bad? Rinse and repeat...
[Nexus 5 Android Development] sumade:
Thanks for your help.

I wonder, since I am using lineage is it possible to look at source files to determine abcd id? I guess it is not but thought I'd mention that I am not on stock rom in case it is relevant.

Thanks
[Nexus 5 Android Development] chdloc:
OK, start with 62 and if that does not improve the audio, then try 4, 44, and 89. Don't forget to reboot prior to testing a new ACDB value.
[Nexus 5 Android Development] youssef1222:
record internal sound

how i can install it for pixel
[Nexus 5 Android Development] sant514:
At the post 1071, there is a report about the Nexus 5, the acdb_id for the CAMCORDER device is 61.

But in the post 1072, " New simpler "simple" mod", in the file audio_platform_info.xml, acdb_id for the CAMCORDER device is 89.

Which is the right number, finally ?
[Nexus 5 Android Development] Enzissimo:
Hi! Is it possibile to use this fix on a MI 11 Ultra? I have the same problem!
[Nexus 5 Android Development] santi1993:
hi my friend, how we can port the Audio Fix to latest https://xdaforums.com/t/eol-rom-11-0-official-crdroid-android-v7-19-hammerhead.3931587/page-29 crDroid 11
[Nexus 5 Android Development] spacetaxi:
Sorry, but I can't help here. The fix was created by xda user chdloc. I just built the installer. But that's long ago. I'm not into Android development anymore.