yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] chdloc:
I do not plan on porting the camcorder mod to CM. However, I do plan on uploading the required source code changes to github. One of CM's Nexus 5 maintainers could pick up the ball from there.
[Nexus 5 Android Development] chdloc:
FYI, I added aMGC support to the camcorder mod for Marshmallow. Get it here.
[Nexus 5 Android Development] sutobe:
I have a serious problem with this mod on my Nexus 5, still running on the latest 5.1.1 (hoping for some bug fixes in marshmallow considering faulty file transfer and not sticking USB MTP default settings).

Anyways, when I apply the mod, doesn't matter which version, voice dial doesn't work when the phone is connected to my car stereo's bluetooth module.

It won't recognize anything I say anymore.

When I undo the mod it works perfectly fine again.

Is there anything I can try??
[Nexus 5 Android Development] chdloc:
Before I can give some guidance I need to get a few more details:

how do you connect to your car's Bluetooth system? Is it via your phone's Bluetooth or via a (wired) headset dongle?

are you running stock 5.1.1 or a custom ROM variant?

do you have any other sound mods installed?

how do you activate voice dial?

when you say "doesn't matter which version" do you mean any combination of options given by the installer?

are you facing this issue even if you only install the simple mod without any additions (in particular the sidetone mod)?

do you have hotword detection on any screen enabled?
[Nexus 5 Android Development] sutobe:
Hey and thanks for the quick reply, I have to apologize, was on the jump to the race track from where I just returned. To your questions:

how do you connect to your car's Bluetooth system? Is it via your phone's Bluetooth or via a (wired) headset dongle?

-I connect my Nexus 5 direclty to my Pioneer car stereo's external (optional) bluetooth box. I can select two sources on the radio, one is Phone, the other is Audio (for playing music via BT). I think this only to separate Phone and Music Player use, it gives some extra controls for playing media audio or using the phone.

are you running stock 5.1.1 or a custom ROM variant?

I am running the very latest 5.1.1, totally stock and rooted of course. I upgraded to 6.0 but did a rollback because some other issues with that OS.

do you have any other sound mods installed?

No, I only use SoundAbout to force the phone to use the Dynamic Mono Channel, or else I wouldn't hear any voice prompts. The Bluetooth Box of my car stereo can't handle the prompts over the A2DP channel. It works fine without applying the CamCorder Quality Fix. If I want to listen to music I have to turn off SoundAbout or tell it to use A2DP, if I don't do that the music will also be played in Mono. The car stereo is a little older so I have to use it like that.

how do you activate voice dial?

When I selected Phone as the BT source, it gives me a Voice Dial button on the car stereo's touchscreen. If I press it the phone opens the app I set as standard for voice dialing. I use Cyberon Voice Commander at the moment because it still won't work with the Google App (have this since KitKat), I will only get a grey screen on the phone, saying "Initalizing".

With Cyberon Voice Commander performing a voice dial works fine.

when you say "doesn't matter which version" do you mean any combination of options given by the installer?

I probably have no idea which to use, I usually went with the standard setting in the Aroma installer. Maybe this performs a microphone setting, which isn't sensitive enough?

As soon as the Camcorder fix is installed, the phone doesn't seem to hear me.

are you facing this issue even if you only install the simple mod without any additions (in particular the sidetone mod)?

I went for the simple version because I have problems to understand what the other ones do. May be connected to the fact that English isn't my first language.

do you have hotword detection on any screen enabled?

I usually don't, I only tried it with OK GOOGLE....but since the Google App won't work (as mentioned before) I turned hotword detection off.

[/QUOTE]

I hope this helps you a little bit. As I also said, I have the feeling the phone doesn't hear me. I am also lost which variant of the mod I should install.

Thanks
[Nexus 5 Android Development] chdloc:
Cyberon Voice Commander unfortunately does not play nice with the "advanced" camcorder mod, i.e. the option that adds moderate (either 6 dB or 12 dB of) noise suppression.

(Technical explanation: Cyberon also asks for noise suppression, but at a sampling rate that is currently not supported by my mod).

However, after a quick test it seems that Cyberon does work OK with the "simple" mod, i.e. the one without any noise suppression.
[Nexus 5 Android Development] sutobe:
I have to try this, but I think I already did and it didn't work.

Is this the right Aroma Installer for 5.1.1 LMY48M?

http://xdaforums.com/showpost.php?p=59392397&postcount=627

I made a Nandroid backup, but still want to install the proper one (if I'd have to undo the mod with Aroma Installer)

Should I raise the microfon gain on like 103 or something and use standard?
[Nexus 5 Android Development] chdloc:
Are you sure? I do not see a reason why Cyberon would not work with the "simple audiofix". Note that the simple option is not the default in the installer.

Yes.

As you are using Cyberon, your only option is to use the "simple" fix (0 dB of noise suppression). You may want to skip the sidetone mod as well. You can, however, use any of the stereo mods if you like.

The microphone gain offered by the installer will not have any effect on Cyberon. It will only have an effect on apps that request "CAMCORDER" as its recording device, which very few of them do.
[Nexus 5 Android Development] sutobe:
thanks for the reply, I appreciate your help.

Going to try it later, maybe tomorrow and let you know how it went.

I assume there aren't any log files etc. that I can provide you with if it doesn't work?
[Nexus 5 Android Development] gerd99:
A big thank you!

I have yesterday under the Marshmallow the Fix v1. 0 flashed. I have the standard settings used. The app camcorder behaves as well as under Android Lollipop.
[Nexus 5 Android Development] Syntaxer:
Is it possible to use this fix (simple) with Viper4Android on Marshmallow?
[Nexus 5 Android Development] DevilRockr:
Yeah, it's working completely just like the Lollipop version does :)
[Nexus 5 Android Development] Syntaxer:
And what is the correct way of installing those two together?
[Nexus 5 Android Development] aeoveu:
Install this mod first, then proceed with Viper's installation.
[Nexus 5 Android Development] DevilRockr:
Hi Guys, can anyone please suggest me any audio recording application that supports this mod as video takes up huge spaces. Also audio recorder from sony was on lollipop and was using this mod, however that same application does not seem to be using camcorder libraries in Marshmallow if I am not wrong...
[Nexus 5 Android Development] chdloc:
I suggest "Easy Voice Recorder Pro", a paid app.

When selecting the "rear" microphone, 48 kHz sampling rate, and setting "Noise suppression" and "Echo cancellation" to "default" in the app, my mod is fully supported. As an added bonus, stereo recording and aMGC are supported as well.
[Nexus 5 Android Development] DevilRockr:
You man made my day.......you rock :highfive:
[Nexus 5 Android Development] indigobv:
Does aMGC work with Marshmallow? I've tried anything I could think of and nothing seems to make it show up (No LED, no UI).

The tests were done using Google Camera (v 2.7.008) as it comes from the Marshmallow install.

The way I tried to test it is as follows:

- fresh install of marshmallow (with modified boot for SuperSU)

- removed a few keyboards from /system/app to make space in /system

- installed Busybox (v 1.23.2-Stericson to /system/xbin)

- flashed mod (with aroma installer)

Settings used during setup: 6db, stereo audio channels, 288kbps, tinymix + scripts, stereo playback (micro-usb to the right), sidetone (headphone/headset only).

- installed aMGC and checked in Accessibility Settings to be On (I even switched it Off and On again at some point).

- started manually aMGC (just to be sure it started)

- started camera, went to recording (aMGC requested superuser permissions), started recording and no LED or UI showed up.

I checked all the files and they seem to be installed correctly, including permissions.

In order to see if the mod works I connected the phone to my PC and through adb I looked at the logcat and I could see all the db values aMGC uses, so the mod works, but the UI or the LED, doesn't show up.

As a second approach, I tried to test with Tasker:

- removed aMGC

- installed Tasker and imported profile

- enabled Accessibility Settings for Tasker

- tried to record and nothing

I took into account the known issues while I did the testing, in case that might have created this issue.

I'm out of ideas on how to debug this problem, so if anyone has any suggestion on how to install this mod in order to work as intended, I'm all ears.
[Nexus 5 Android Development] chdloc:
aMGC should work on Marshmallow. Here are my ideas:

are the shell scripts in /data/local/camera executable?

do you have hotword detection from any screen and "touch sounds" disabled?

use logcat, issue "ps | grep GoogleCamera" while the Google Camera app is running, and post the result

The next level of debugging would be to take a look at the Tasker logs after the aMGC was supposed to come up.
[Nexus 5 Android Development] chdloc:
There seems to be a problem detecting the status of the Google Camera app. Please run the following command in logcat as root while you have the Google Camera app in the foreground:

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

Anything but '0' results in the UI/LEDs not to become active.
[Nexus 5 Android Development] indigobv:
Sorry for my late response, I had a busy day.

I ran the command with the camera on foreground and the result was this:

/system/bin/sh: cat: /proc/10047: No such file or directory
/system/bin/sh: cat: 2000/oom_adj: No such file or directory

The result was the same if I ran the command while recording, or if I ran the command as su.

It seems you were right about camera not being detected, but I don't know why. I haven't modified anything regarding the camera. No updates installed either.
[Nexus 5 Android Development] chdloc:
It seems that there was a line-break in the command as I can see two responses.

Let's break up the problem. First issue

ps | grep GoogleCamera

On my phone I get the following response:

u0_a47 28412 216 1788696 180948 sys_epoll_ b6cf57e8 S com.google.android.GoogleCamera

The second column shows the process ID (PID), i.e. 28412.

Then issue as root

cat /proc/<enter your PID here>/oom_adj

and post the result.
[Nexus 5 Android Development] indigobv:
I ran

ps | grep GoogleCamera

and got this:

20804 10047 1:31 {id.GoogleCamera} com.google.android.GoogleCamera
32619 2000 0:00 grep GoogleCamera

And with this:

cat /proc/20804/oom_adj

I got 0 with the camera in foreground.

After my last post I managed to get the two PIDs and I tried to ran that as a single command but it broke like last time. Initially I thought it might be something from Windows, so I tried to change $2 to $1 in Tasker and no results. I'm not that good at Linux, so I don't know how to rewrite that in order for the command to stop being broken apart.

The awk part seems to be the culprit when used inside another command. As a standalone command the output is correct, otherwise, even if the output is saved in a variable, if I try to use that in another command it has line breaks for some reason, so the result is inconsistent like in my previous post.
[Nexus 5 Android Development] chdloc:
Interesting, it appears that we are running different versions of 'ps'. Try the following command:

cat /proc/$(busybox ps | grep 'com\.google\.android\.GoogleCamera' | awk '{print $1}')/oom_adj
[Nexus 5 Android Development] indigobv:
This one works perfectly. I tested it in Tasker as well and now it shows up on Google Camera.

Any way this could be implemented in aMGC as an alternative? Or could you tell me how to build it myself, in case that's not too much to ask. I would rather have aMGC instead of Tasker since this mod is the only reason I have Tasker installed.

But if it's not possible, that's ok too. I'm glad it works.
[Nexus 5 Android Development] chdloc:
Thanks for your help in identifying the problem. Your bug reports have been very valuable.

I uploaded a new version of both the aMGC app and the Tasker project here. This update is geared toward those of you who have not been able to get the aMGC UI to show up. No changes have been made to the mod itself.
[Nexus 5 Android Development] Official_Rainbow_Dash:
stuck on boot animation with these. did basic camera audio fix. good thing reverting fixes it :) will stay tuned for a fix, unless im doing something wrong :|
[Nexus 5 Android Development] chdloc:
What ROM and recovery are you running? Do you have any other audio mods installed?
[Nexus 5 Android Development] Official_Rainbow_Dash:
I tried a few but removed them, one didn't fully flash, v giving me error 7 in recovery. I would like to use v4a but every time it tells me to install the driver over and over, every reboot.

I'm using stock 6.0 nexus 5. And using CM recovery. Thanks for taking the time to solve my issue. :)
[Nexus 5 Android Development] chdloc:
Please try flashing the camcorder mod with TWRP recovery.
[Nexus 5 Android Development] Official_Rainbow_Dash:
I tried version 6.0, that didn't work, so I uninstalled that, then tried 5.1, still didn't work. Just suck on boot animation. When I first installed the 6.0 version, I installed the gain changer, but it it got stuck on boot, then I did the same thing without the gain changer. I really don't want to reflash the stock ROM as I already did that 8 times for v4a.
[Nexus 5 Android Development] chdloc:
I'm not suggesting you reflash your ROM, but only install (or boot into) TWRP recovery and install (only) this camcorder mod from there.
[Nexus 5 Android Development] Official_Rainbow_Dash:
That's exactly what I did. Only the first file as I wanted to make sure the basic camcorder function would work before flashing the tweaking zip.
[Nexus 5 Android Development] chdloc:
What version of TWRP are you running?

In order to find out what's going on we need to pull a few files after you have flashed the mod and while your phone is stuck on the Android splash screen.

Please do the following (after having made sure that you enabled USB debugging in the Android developer options):

flash the "simple mod" (0 dB of noise suppression)

after the installation has completed, stay in the recovery, go to "Advanced", and copy the log to SD card

reboot your phone

while your phone is stuck on the splash screen, grab three files using adb. If you don't have adb installed or don't know how to use it please install it and familiarize yourself with its use prior to proceeding (or posting)

adb pull /sdcard/recovery.log .

adb pull /system/etc/mixer_paths.xml .

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

grab a logcat (while your phone is stuck on the splash screen)

adb shell logcat > logcat.txt

let the command run for a seconds and abort it with CTRL-C. You will end up with a file named logcat.txt in your current directory.

check the permissions of the two files that are modified by the mod (while your phone is stuck on the splash screen) and report back

adb shell ls -l /system/etc/mixer_paths.xml

adb shell ls -l /system/lib/hw/audio.primary.msm8974.so

by now you should have four files in the current directory of your PC (recovery.log, mixer_paths.xml, audio.primary.msm8974.so, and logcat.txt). Post the four files in this thread or PM them to me

BTW, Many folks don't seem to be familiar with the fact that adb works as soon as the Android splash screen shows up and that many things can be done to debug and fix certain problems if the phone is rooted, like fix permissions or copy backed up system files back into place.
[Nexus 5 Android Development] Official_Rainbow_Dash:
Using ClockworkMod Recovery V6.0.4.5

Below is from using Nexus5_6.0_MRA58K_v1.0_audiofix_aroma.zip

Wow! Surprisingly once i flashed with 0db of suppression it booted up! Looks like i cant use the 6db version or the advanced options.

Did a camera test, looks like it working, no artifacts were present in the audio.

Huh... :silly: :highfive:

Sorry for being an idiot :eek:
[Nexus 5 Android Development] MrMarques01:
Why are you using CWM recovery? It was clearly suggested to use TWPR. That's also a good idea for any future flashes since CWM seems to cause headaches for a lot of people.

I can confirm that the audio fix presented here works flawless on marshmallow if flashed via TWPR.
[Nexus 5 Android Development] amkirk94:
Am I the only one who thinks that this should start being implemented on every custom ROM? :p
[Nexus 5 Android Development] aeoveu:
Nope! [emoji14]
[Nexus 5 Android Development] treehugger38294:
Does this work on the November security build?
[Nexus 5 Android Development] onesolo:
Love to know that also...
[Nexus 5 Android Development] chdloc:
I did not see anything in the changelog that suggests that the current mod would not work with the November security update.
[Nexus 5 Android Development] [Gorgasm]:
Hi [MENTION=2760454]chdloc[/MENTION] :)

Can you tell me which task I have to choose as "Launch task" in Tasker to export it as an app ? I just would like to change the icon of the app for a personal one, so I imported your project and made my changes, but I'm blocked at this step. I think it is very easy but I'm not really familiar with Tasker ^^

Thanks for your help !
[Nexus 5 Android Development] chdloc:
I don't think it really matters as actions are triggered by an external event (launching of the Camera app). I chose "Camcorder Tasks".
[Nexus 5 Android Development] [Gorgasm]:
Ok thank you ! :)

Sent from my Nexus 5
[Nexus 5 Android Development] nmlssit:
Can I avoid reflashing the mod everytime I update my rom?

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Nexus 5 Android Development] Matrix_19:
I switched to 6P, thank you chdloc for your work :)
[Nexus 5 Android Development] aeoveu:
I switched to 5x, so I think we'll be needing chdloc there too! ;)

Basically, sound isn't watered down in the Nexus 5x out of the box, but its mono (only the bottom microphone works). And since the top speaker grill exists, I wonder how much chdloc could play around with the 5x to overcome these shortcomings.

Damn. I wanted the 6p, but it wasn't shipping when I purchased it (and I had to purchase it quickly cause I was in the US at that time, and had little time to do so).
[Nexus 5 Android Development] chdloc:
No, unfortunately. The Aroma installer makes flashing the mod a breeze, though.
[Nexus 5 Android Development] chdloc:
It is one of my weaknesses that I rarely turn down a challenge...

You will likely need to edit two files.

First, edit /system/etc/mixer_paths.xml and change

<path name="camcorder-mic">
<path name="handset-mic" />
</path>

to

<path name="camcorder-stereo">
<ctl name="AIF1_CAP Mixer SLIM TX7" value="1" />
<ctl name="AIF1_CAP Mixer SLIM TX8" value="1" />
<ctl name="SLIM TX7 MUX" value="DEC7" />
<ctl name="DEC7 MUX" value="DMIC1" />
<ctl name="SLIM TX8 MUX" value="DEC10" />
<ctl name="DEC10 MUX" value="DMIC3" />
<ctl name="SLIM_0_TX Channels" value="Two" />
<ctl name="DEC7 Volume" value="84" />
<ctl name="DEC10 Volume" value="84" />
</path>

<path name="camcorder-mic">
<path name="camcorder-stereo" />
</path>

Second, edit /system/etc/media_profiles.xml and change

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

to

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

Also, change all occurrences of

<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="1" />

to

<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="[COLOR="red"]2[/COLOR]" />

Reboot your phone after all above changes have been made.

Warnings:

this mod is for the Nexus 5x only

I do not have a 5x to test; the above mod is an educated guess

make a backup of mixer_paths.xml and media_profiles.xml and make sure you know how to restore them if something goes south

make sure that both files have the permission 644 (rw-r--r--) after editing

It seems that the Nexus 5x has three microphones; I'm not sure which two microphones this mod enables

the microphone gains, i.e. "DEC7 Volume" and "DEC10 Volume", may require adjustment
[Nexus 5 Android Development] aeoveu:
Umm... That looks... complicated? [emoji14]

The Nexus 5x actually has only two mics - the 6P has three. The two mics are located on the top and bottom side. Also, the bottom speaker is the loud speaker, so stereo mode would be super cool.

Maybe we should take this up one by one. The changes you wrote - are those for the stereo mics with some cancellation, or are they for the speakers?

I guess I'll have to tinker with this when I get home in a few days - so till then, I'll let somebody else experiment.

Also, you should get the Nexus 5x as well, because, you know... ;)
[Nexus 5 Android Development] chdloc:
Actually, it is pretty straightforward, especially if you've edited a system file before.

Are you sure? I've seen multiple references to three microphones being present in the 5x:

mixer_paths.xml uses two different microphone pairs for defined devices, i.e. "handset-dmic-endfire" and "speaker-dmic-endfire"

/system/etc/audio_platform_info.xml has an entry, "input_mic_max_count", that suggests that there are three microphones

bullhead-specific commit to AOSP

a comment on the ifixit teardown site (search for "microphones"; this guy is *very* specific in terms of actual part number)

last but not least: Google's own spec page

I thought the bottom grille only covered a microphone? This assumption is corroborated by the contents of Google's spec page.

This is only a stereo microphone mod, with stock noise suppression.

Are there other 5x users that still read this thread? I'm hesitant to post this over in the 5x forum as the mod is completely untested.

I personally don't see a reason to upgrade as long as the (sufficiently capable) Nexus 5 still gets updates from Google, especially since I have all audio-related problems (camcorder, telephony, and headphone audio) of this phone under control.
[Nexus 5 Android Development] aeoveu:
Aaah - my bad. I'll hunt around to see which speaker grill has the mic. The teardown didn't say much, but Google's spec sheet does say it has three mics. I'll try blowing air into the top and bottom speaker grill - perhaps this is why it doesn't have stereo sound...?

Bah! I dunno.

Also, I said it LOOKS intimidating. ;)

Ah okie. Thanks!

---------- Post added at 02:23 PM ---------- Previous post was at 01:30 PM ----------

Update: it appears only one side records the audio, despite there being three microphones (officially) - I'll have to check your mod when I go home tomorrow.

I wonder what Google's up to - I always thought they'd introduce stereo recording with both the N5x and 6P -- guess only the 6P has it.
[Nexus 5 Android Development] nmlssit:
Does this mod also optimize general audio? I've seen the mixer_paths.xml inside the zip

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Nexus 5 Android Development] chdloc:
This mod deals primarily with camcorder audio, but also offers stereo recording, stereo playback, and sidetone for telephony. I have a mod

here that can improve audio played via headphones. It is, unfortunately, rather complicated, but there is a high payoff.

During the course of my tinkering with Android audio I have gained a decent understanding of most aspects of the audio subsystem, in particular the Qualcomm codecs and mixer. There is a good chance that I can help you with other aspects that involve the mixer (mixer_paths.xml).