Flashable zip files kindly offered by @springer.music
Lollipop
Marshmallow
Nougat <= 7.1.1
Nougat 7.1.2
In spending a lot of quality time with audio on the Nexus 5, I found a way to enable stereo recording that, with only minor modifications, works
also on the Nexus 6. Let me preface the below by saying that I do not have access to a Nexus 6, but @springer.music was kind enough to work
with me throughout the testing phase. Thanks!
On to the details:
The Nexus 6 has three microphones. The main microphone sits behind the lower speaker grille. The other two have their ports open toward
the back of the phone, i.e. one of them near the USB port and the other one near the camera lens. For camcorder recordings, the Nexus 6 uses
the front microphone by default.
This mod changes two system files, i.e. /system/etc/media_profiles.xml and /system/etc/mixer_paths.xml.
While the changes in media_profiles.xml simply enable two-channel processing, the more interesting changes occur in mixer_paths.xml.
After some experimentation, we have found that the microphone close to the USB port is associated with ADC1 (channel one of the analog-to-digital
converter in the audio codec), the microphone close to the rear camera is associated with ADC4, and the main microphone is associated with ADC3.
The mixer file now contains a new audio device called camcorder-stereo (only called when the "camcorder" device is requested) that uses the
microphone by the camera lens as the left channel and the microphone close to the USB port as the right channel. The gains are kept at stock
camcorder levels, i.e. ADC1=ADC4=8. These gains are by no means set in stone. You can adjust them as you like, making the microphone more or
less sensitive in the process. Indeed, you may need/want to do that when you plan on recording, say, a club visit or rock concert.
Keep in mind, though, that you need to reboot your phone anytime you make changes to the mixer_paths.xml file as
the new values are read only upon a system boot.
Welcome side effect: In addition to the camcorder now being able to capture stereo audio, all audio recording apps that allow the microphone
to be changed to the "camcorder" microphone (provided the app itself offers stereo processing) can take advantage of this mod, too.
Apps that are capable of recording stereo audio with this mod are "Voice Recorder" and "Easy Voice Recorder Pro".
Any idea if Viper4Android makes any changes to these files that this mod will overwrite?
SolsticeZero said:
Any idea if Viper4Android makes any changes to these files that this mod will overwrite?
Click to expand...
Click to collapse
Possibly. I would install Viper4Android first and then consolidate the two mixer_paths.xml (and maybe media_profiles.xml) files manually.
chdloc said:
...
Installation:
make a backup of your stock media_profiles.xml and mixer_paths.xml files (attached in the "stock" archive for convenience)
manually push the two files in the "stereo_mod" archive to /system/etc/
adjust the permissions of the two files to 644 (rw-r--r--)
reboot
@springer.music will be providing a flashable zip soon for those of you who don't feel comfortable pushing system files manually.
Click to expand...
Click to collapse
Thanks for all the work @chdloc!
Here's a zip file that can be flashed through recovery (TWRP). It replaces both media_profiles.xml and mixer_paths.xml
https://drive.google.com/open?id=0B4ACjWKfxD7wSkNHeU5Rb0xSb1k&authuser=0
Here are flashable zip files for the stock media_profiles.xml and mixer_paths.xml files if you need to revert the mod.
https://drive.google.com/open?id=0B4ACjWKfxD7wWHlxcUZNVm8ydGs&authuser=0
https://drive.google.com/open?id=0B4ACjWKfxD7wVFBxTjNFb0dub28&authuser=0
Use All three MICs
Hi chdloc,
Thank you so much for your post! Really helpful!
Based on your work, I wanna make some change------using all three MICs(including camcorder, the mic near USB in the back, and the default mic in the front). I wanna keep your revised media_profiles file. Just make some changes in mixer_paths file.
Like this:
<path name="camcorder-stereo">
<ctl name="AIF3_CAP Mixer SLIM TX3" value="1" />
<ctl name="AIF3_CAP Mixer SLIM TX5" value="1" />
<ctl name="AIF1_CAP Mixer SLIM TX7" value="1" />
<ctl name="AIF1_CAP Mixer SLIM TX8" value="1" />
<ctl name="AIF2_CAP Mixer SLIM TX9" value="1" />
<ctl name="AIF2_CAP Mixer SLIM TX10" value="1" />
<ctl name="SLIM_0_TX Channels" value="Two" />
<ctl name="SLIM TX3 MUX" value="DEC4" />
<ctl name="SLIM TX5 MUX" value="DEC4" />
<ctl name="SLIM TX7 MUX" value="DEC3" />
<ctl name="SLIM TX8 MUX" value="DEC6" />
<ctl name="SLIM TX9 MUX" value="DEC3" />
<ctl name="SLIM TX10 MUX" value="DEC6" />
<ctl name="DEC6 MUX" value="ADC1" />
<ctl name="DEC4 MUX" value="ADC3" />
<ctl name="DEC3 MUX" value="ADC4" />
<ctl name="ADC1 Volume" value="8" />
<ctl name="ADC2 Volume" value="0" />
<ctl name="ADC3 Volume" value="8" />
<ctl name="ADC4 Volume" value="8" />
<ctl name="ADC5 Volume" value="0" />
<ctl name="ADC6 Volume" value="0" />
</path>
Is that ok to use all three MICs for recording in the same time?
sherlock1127 said:
Hi chdloc,
Thank you so much for your post! Really helpful!
Based on your work, I wanna make some change------using all three MICs(including camcorder, the mic near USB in the back, and the default mic in the front). I wanna keep your revised media_profiles file. Just make some changes in mixer_paths file.
Like this:
<path name="camcorder-stereo">
<ctl name="AIF3_CAP Mixer SLIM TX3" value="1" />
<ctl name="AIF3_CAP Mixer SLIM TX5" value="1" />
<ctl name="AIF1_CAP Mixer SLIM TX7" value="1" />
<ctl name="AIF1_CAP Mixer SLIM TX8" value="1" />
<ctl name="AIF2_CAP Mixer SLIM TX9" value="1" />
<ctl name="AIF2_CAP Mixer SLIM TX10" value="1" />
<ctl name="SLIM_0_TX Channels" value="Two" />
<ctl name="SLIM TX3 MUX" value="DEC4" />
<ctl name="SLIM TX5 MUX" value="DEC4" />
<ctl name="SLIM TX7 MUX" value="DEC3" />
<ctl name="SLIM TX8 MUX" value="DEC6" />
<ctl name="SLIM TX9 MUX" value="DEC3" />
<ctl name="SLIM TX10 MUX" value="DEC6" />
<ctl name="DEC6 MUX" value="ADC1" />
<ctl name="DEC4 MUX" value="ADC3" />
<ctl name="DEC3 MUX" value="ADC4" />
<ctl name="ADC1 Volume" value="8" />
<ctl name="ADC2 Volume" value="0" />
<ctl name="ADC3 Volume" value="8" />
<ctl name="ADC4 Volume" value="8" />
<ctl name="ADC5 Volume" value="0" />
<ctl name="ADC6 Volume" value="0" />
</path>
Is that ok to use all three MICs for recording in the same time?
Click to expand...
Click to collapse
I'm not sure what the (even theoretical) benefit would be to use three microphones simultaneously for camcorder recordings. Two of them are relatively close together, so there would be very little additional spatial information. As a use-case I can only come up with using the front microphone to pick up narration, but there will be a lot of cross-talk between the channels (if that use-case is desired then it may be better to attach a separate close-talking microphone to the headset port). Plus, in order to play back the recorded audio you would need to implement some sort of 3 ch->2 ch down-mix paradigm. (Unless you use the three microphones to design a steerable first-order or even second-order differential microphone array for a more flexible acoustic front-end capable of recording spatial sound)
Theory aside, in the "camcorder-stereo" device in mixer_paths.xml you would need to change
Code:
<ctl name="SLIM_0_TX Channels" value="Two" />
to
Code:
<ctl name="SLIM_0_TX Channels" value="Three" />
if that is even supported by your device. Also, you would need to update /system/etc/media_profiles.xml to support not two but three channels. Then the questions is whether Android (libaudioflinger) knows what to do with three channels. I don't have a Nexus 6, so I cannot test.
chdloc said:
I'm not sure what the (even theoretical) benefit would be to use three microphones simultaneously for camcorder recordings. Two of them are relatively close together, so there would be very little additional spatial information. As a use-case I can only come up with using the front microphone to pick up narration, but there will be a lot of cross-talk between the channels (if that use-case is desired then it may be better to attach a separate close-talking microphone to the headset port). Plus, in order to play back the recorded audio you would need to implement some sort of 3 ch->2 ch down-mix paradigm. (Unless you use the three microphones to design a steerable first-order or even second-order differential microphone array for a more flexible acoustic front-end capable of recording spatial sound)
Theory aside, in the "camcorder-stereo" device in mixer_paths.xml you would need to change
Code:
<ctl name="SLIM_0_TX Channels" value="Two" />
to
Code:
<ctl name="SLIM_0_TX Channels" value="Three" />
if that is even supported by your device. Also, you would need to update /system/etc/media_profiles.xml to support not two but three channels. Then the questions is whether Android (libaudioflinger) knows what to do with three channels. I don't have a Nexus 6, so I cannot test.
Click to expand...
Click to collapse
Firstly, many thanks for your reply!
Because we are working on speech enhancement algorithms, three MICs recording is much better than two MICs even though that two MICs are close to each other.
I used the revised mixer_paths.xml then tired
<ctl name="SLIM_0_TX Channels" value="Two" />
and
<ctl name="SLIM_0_TX Channels" value="Three" />
with camcorder stereo recording. But the results are the same as the normal two MICs recording instead of three MICs. Only the camcorder and the MIC on the back near the USB port working. My guess is that, there will be a file to state how to store recording data from two MICs into one buffer (Like two MICs stereo recording is left right left right...). So if we want to do three MICs recording we have to find that file and revise it to make it be able to store recording data from three MICs into one buffer.
Based on your experience, what do you think?
Thanks again and best regards!
sherlock1127 said:
Because we are working on speech enhancement algorithms, three MICs recording is much better than two MICs even though that two MICs are close to each other.
Click to expand...
Click to collapse
Interesting. Please do share some details on what exactly you would like to accomplish.
My guess is that, there will be a file to state how to store recording data from two MICs into one buffer (Like two MICs stereo recording is left right left right...). So if we want to do three MICs recording we have to find that file and revise it to make it be able to store recording data from three MICs into one buffer.
Click to expand...
Click to collapse
For camcorder recordings -- as I alluded to before -- in addition to modifying mixer_paths.xml as you did above, you also need to modify the file /system/etc/media_profiles.xml. In that file, change
Code:
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="12000000"
width="1280"
height="720"
frameRate="30" />
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="1" />
</EncoderProfile>
<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="1" />
</EncoderProfile>
to
Code:
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="12000000"
width="1280"
height="720"
frameRate="30" />
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="[COLOR="red"]3[/COLOR]" />
</EncoderProfile>
<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"]3[/COLOR]" />
</EncoderProfile>
and change
Code:
<AudioEncoderCap name="aac" enabled="true"
minBitRate="758" maxBitRate="288000"
minSampleRate="8000" maxSampleRate="48000"
minChannels="1" maxChannels="1" />
to
Code:
<AudioEncoderCap name="aac" enabled="true"
minBitRate="758" maxBitRate="288000"
minSampleRate="8000" maxSampleRate="48000"
minChannels="1" maxChannels="[COLOR="red"]3[/COLOR]" />
followed by a reboot.
You may not need to modify media_profiles.xml if you find an DAW app (or write one yourself) that is designed to work with more than two channels and that uses the "CAMCORDER" device when setting up the audio subsystem. You could also look into using ALSA directly from the command line to try to capture all three audio channels simultaneously.
I've updated the file generously provided by springer.music to contain the modifications to Android M Preview 3 stock files to enable stereo recording. I've attached it.
Thanks zefie.
I've been playing around with with the input gain in mixer_paths.xml and after a numbers of tests I then changed the ADC1 and ADC4 values to "0" instead of "8" on my Note 6 (the zip file I posted in my previous post had the input gain set to "8").
I discussed this with chdloc some months ago and he told me that "8" should be the default value. However, with ADC1 and ADC4 set to 8, I used to get some unwanted audio clipping (it sounded like some sort of limiter kicked in, it was not distortion due to saturation) with high volume audio sources, such as live music and the like.
Setting ADC1 and ADC4 to "0" seems to provide more balanced results.
Here's a new/alternative zip file for Lollipop/5.1.1 with the ADC values set to 0 if anyone would like to try it.
https://drive.google.com/uc?export=download&id=0B4ACjWKfxD7wSkZfZDQ5cGdBM2M
springer.music said:
I discussed this with chdloc some months ago and he told me that "8" should be the default value. However, with ADC1 and ADC4 set to 8, I used to get some unwanted audio clipping (it sounded like some sort of limiter kicked in, it was not distortion due to saturation) with high volume audio sources, such as live music and the like.
Click to expand...
Click to collapse
Unfortunately, without having access to the codec's documentation, only experimentation and measurements can determine what the default value "should" be. Without having access to a Nexus 6, all I can say is that "8" was the (default) value chosen by the Google and/or Motorola guys.
chdloc said:
Unfortunately, without having access to the codec's documentation, only experimentation and measurements can determine what the default value "should" be. Without having access to a Nexus 6, all I can say is that "8" was the (default) value chosen by the Google and/or Motorola guys.
Click to expand...
Click to collapse
You're right, the trial and error method can quite often be the best solution.
Still, I don't understand why stereo audio recording is not a standard feature on the Nexus 6. The mics are there and they seem to work decently. Go figure...
Working really well on the m preview rom , thanks!
Sent from my Nexus 6 using Tapatalk
Just wanted to report that this works like a charm on the official 6.0 release :good:
@springer.music @chdloc
Which one of these files work good on 6.0.0 ?
kryddan said:
@springer.music @chdloc
Which one of these files work good on 6.0.0 ?
Click to expand...
Click to collapse
Here's a version for Android 6/Marshmallow:
https://drive.google.com/uc?export=download&id=0Byg2gRuMx9SFdnJmYm5HanBvWDA
springer.music said:
Here's a version for Android 6/Marshmallow:
https://drive.google.com/uc?export=download&id=0Byg2gRuMx9SFdnJmYm5HanBvWDA
Click to expand...
Click to collapse
Thank you, you saved my evening. Going to a Danko Jones concert tonight
Ok, ofcourse I will have other equipment to bring, but still
springer.music said:
Here's a version for Android 6/Marshmallow:
https://drive.google.com/uc?export=download&id=0Byg2gRuMx9SFdnJmYm5HanBvWDA
Click to expand...
Click to collapse
Flashable zip??
bmakk2055 said:
Flashable zip??
Click to expand...
Click to collapse
Yes
springer.music said:
Yes
Click to expand...
Click to collapse
thanks
---------- Post added at 05:40 PM ---------- Previous post was at 04:52 PM ----------
springer.music said:
Yes
Click to expand...
Click to collapse
One more thing, will this work on my Nexus 7 2013?
Hi there,
So I've upgraded to lollipop and I actually like it but Xposed now no longer work and with no framework insight I downgraded to KitKat. Then I installed Xposed and a few modules but realized the I preferred Lollipop. So now I'm back on Lollipop.
What I would like to know is there any changes I can make to the system to improve some features like Xposed did. For example, Disable SMS to MMS Conversion, remove safe volume warning, kill email/gmail attachment limits, etc.
I'm sure these could be modified by editing an xml or something. Does anyone have any ideas?
I know that some of the Xposed module features can be obtained by a 3rd party app but I don't want to run have to run numerous apps.
Thanks,
Mick
One that I've used is the volume boost:
etc->mixer_paths.xml
<!Play Scenario -->
....
<path name="speaker">
...
<ctl name="RX7 Digital Volume" value="81" /> ---------------> change to 89 or higher (Mines at 90 and distorts slightly on some sounds)
...
<path name="headset">
...
<ctl name="HPHL Volume" value="20" /> --------------- > change to 30
<ctl name="HPHR Volume" value="20" /> --------------- > change to 30
<ctl name="RX1 Digital Volume" value="77" /> ---------> change to 85 (or higher, depends how loud you want it)
<ctl name="RX2 Digital Volume" value="77" /> --------> change to 85 (or higher, depends how loud you want it)
Many thanks to everyone who contributed
Hey everyone, i have a problem about the microphone on my Lg G2 D802 running cm13 (latest snapshot) let me explain :
-recording ONLY audio makes absurd sounds, sizzling and distortion
-doesn't happen in calls
-whatsapp & any recording apps have that problem
-somehow it works fine recording videos
-tried an app called smart voice recorder & disabled AGC, set the factor to 1 and disabled silence skipping mode and it sounds fine
And here's the part necessary from mixer_paths file :
<ctl name="RX1 Digital Volume" value="62" />
<ctl name="RX2 Digital Volume" value="62" />
<ctl name="RX3 Digital Volume" value="84" />
<ctl name="RX4 Digital Volume" value="84" />
<ctl name="RX5 Digital Volume" value="84" />
<ctl name="RX6 Digital Volume" value="84" />
<ctl name="RX7 Digital Volume" value="84" />
It'd be great if someone would help. Thanks for your help in advance guys.
/system/build.prop
ro.qc.sdk.audio.fluencetype=fluence
to
ro.qc.sdk.audio.fluencetype=none
Change that value and it should be all fixed
jl10101 said:
/system/build.prop
ro.qc.sdk.audio.fluencetype=fluence
to
ro.qc.sdk.audio.fluencetype=none
Change that value and it should be all fixed
Click to expand...
Click to collapse
It kinda did but the problem is it records all outside sounds too much, so can't we change the fluence type or fluence effect range or something? I appreciate the effort though
Sorry for necroposting but i still have the problem, any suggestions?
Hi !
i wanted to make my galaxy a5 Speaker Louder .
i Rooted My device And found "mixer_paths.xml" file in /etc/mixer_paths.xml but there is not any Value or Path for changing the Volume Options. like:
<path name="speaker"> or <path name="headphones">
How can i Increase it's Sound?
Hello! I have A5 2015 edition and before update to marshmallow the battery life it was 2 days with medium utilisation. After update...max 20 hours with power save (. I want to go back to lollipop but i don t know how
mahdi008 said:
Hi !
i wanted to make my galaxy a5 Speaker Louder .
i Rooted My device And found "mixer_paths.xml" file in /etc/mixer_paths.xml but there is not any Value or Path for changing the Volume Options. like:
<path name="speaker"> or <path name="headphones">
How can i Increase it's Sound?
Click to expand...
Click to collapse
Yes, I came from f to fd rom i too face the low volume issue with fd rom
Use speaker boost by Omega centauri software on play.
mahdi008 said:
Hi !
i wanted to make my galaxy a5 Speaker Louder .
i Rooted My device And found "mixer_paths.xml" file in /etc/mixer_paths.xml but there is not any Value or Path for changing the Volume Options. like:
<path name="speaker"> or <path name="headphones">
How can i Increase it's Sound?
Click to expand...
Click to collapse
in a5 2016 it is like this in mixer_paths.xml,
Code:
<!-- Output volume stage -->
<!-- media playback volume -->
<path name="gain-media-handset">
<ctl name="S2801 MIX1_LVL" value="0" />
<ctl name="DAC Gain" value="128" />
<ctl name="Earphone Volume" value="8" />
</path>
<path name="gain-media-speaker">
<ctl name="S2801 MIX1_LVL" value="0" />
<ctl name="DAC Gain" value="130" />
<ctl name="Speaker Volume" value="9" />
</path>
but nothing changed when i change the value, it doesn't sound louder, i tried up to 190 for dac gain & upt to 18 for speaker volume value
there is also a mixer_.paths_rev08.xml and i edited that one also but no luck.
I hope someone finds it because i am not used to have a phone with no volume mod It's no use to install an app that give a boost to play music or media louder inside the app itself because that does not make alarm or incoming calls louder (etc)
Try this.
cornelushh said:
Hello! I have A5 2015 edition and before update to marshmallow the battery life it was 2 days with medium utilisation. After update...max 20 hours with power save (. I want to go back to lollipop but i don t know how
Click to expand...
Click to collapse
Try Viper Audio.
contrinsan said:
in a5 2016 it is like this in mixer_paths.xml,
Code:
<!-- Output volume stage -->
<!-- media playback volume -->
<path name="gain-media-handset">
<ctl name="S2801 MIX1_LVL" value="0" />
<ctl name="DAC Gain" value="128" />
<ctl name="Earphone Volume" value="8" />
</path>
<path name="gain-media-speaker">
<ctl name="S2801 MIX1_LVL" value="0" />
<ctl name="DAC Gain" value="130" />
<ctl name="Speaker Volume" value="9" />
</path>
but nothing changed when i change the value, it doesn't sound louder, i tried up to 190 for dac gain & upt to 18 for speaker volume value
there is also a mixer_.paths_rev08.xml and i edited that one also but no luck.
I hope someone finds it because i am not used to have a phone with no volume mod It's no use to install an app that give a boost to play music or media louder inside the app itself because that does not make alarm or incoming calls louder (etc)
Click to expand...
Click to collapse
and the headset volume for louder Music? please help me
http://forum.xda-developers.com/sam...ent/a510f-viper4android-installer-mm-t3470028
try this