[MAGISK MODULE] Mic Volume Booster and Left/Right Stereo Input Swap - Xiaomi Mi A2 Lite Themes, Apps, and Mods

Basic Disclaimer:
Please use at your own risk, even though there is no risk. I can't guarantee this will work for you, but can do my best to help you if it doesn't. Please let me know if you have any troubles, or know a better way of making these mods.
This was made for the stock Android Pie ROM, so results may vary with other ROMs.
This module was made to work with the latest Magisk v20.4
Tweaks are made to the file /system/vendor/etc/mixer_paths_mtp_global.xml
--------------------------------------------------------------------------------------------------
Mic Volume Booster
The default values are arguably too low. I applied this v1 fix to our mixer_paths XML: https://forum.xda-developers.com/mi-a1/themes/magisk-mic-low-volume-fix-custom-roms-t3910753
Thanks very much to @Ahmed Kassem
What does this do?
It restores the adjusted input volumes from the Tissot (Mi A1) device's mixer path XML.
Original Code:
Code:
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="RX2 Digital Volume" value="84" />
<ctl name="RX3 Digital Volume" value="84" />
<ctl name="IIR1 INP1 Volume" value="53" />
<ctl name="IIR1 INP2 Volume" value="53" />
<ctl name="IIR1 INP3 Volume" value="53" />
<ctl name="IIR1 INP4 Volume" value="53" />
<ctl name="ADC1 Volume" value="4" />
<ctl name="ADC2 Volume" value="4" />
<ctl name="ADC3 Volume" value="4" />
<ctl name="DEC1 Volume" value="84" />
<ctl name="DEC2 Volume" value="84" />
Vol Booster Code:
Code:
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="RX2 Digital Volume" value="84" />
<ctl name="RX3 Digital Volume" value="[COLOR="Red"]78[/COLOR]" />
<ctl name="IIR1 INP1 Volume" value="53" />
<ctl name="IIR1 INP2 Volume" value="[COLOR="red"]84[/COLOR]" />
<ctl name="IIR1 INP3 Volume" value="[COLOR="red"]84[/COLOR]" />
<ctl name="IIR1 INP4 Volume" value="[COLOR="red"]84[/COLOR]" />
<ctl name="ADC1 Volume" value="4" />
<ctl name="ADC2 Volume" value="4" />
<ctl name="ADC3 Volume" value="4" />
<ctl name="DEC1 Volume" value="[COLOR="red"]91[/COLOR]" />
<ctl name="DEC2 Volume" value="84" />
--------------------------------------------------------------------------------------------------
Left/Right Stereo Input Swap
I made a mod like this with my Redmi 2 but never quite got it right. I think this one is good - it surely sounds good to me.
What does this do?
Well, when holding the phone landscape; the left and right mic inputs are based on the volume buttons being underneath, but I find it more comfortable holding it with the volume buttons being on top, although this always left the left/right channels inverted in videos. So this mod inverts them back.
Original Code:
Code:
<!-- Dual MIC devices -->
<path name="speaker-dmic-endfire">
<path name="adc1" />
<ctl name="ADC3 Volume" value="6" />
<ctl name="DEC2 MUX" value="ADC2" />
<ctl name="MI2S_TX Channels" value="Two" />
<ctl name="ADC2 MUX" value="INP3" />
</path>
Inverted Left/Right Code:
Code:
<!-- Dual MIC devices -->
<path name="speaker-dmic-endfire">
<path name="adc1" />
<ctl name="ADC[COLOR="Red"]2[/COLOR] Volume" value="6" />
<ctl name="DEC2 MUX" value="ADC[COLOR="red"]1[/COLOR]" />
[COLOR="red"]<ctl name="DEC1 MUX" value="ADC2" />[/COLOR]
<ctl name="MI2S_TX Channels" value="Two" />
<ctl name="ADC2 MUX" value="INP3" />
</path>
--------------------------------------------------------------------------------------------------
Please feel free to unzip, make your own edits, re-zip, and flash over mine attached here. Also let me know if you want any variations of this, and I will do my best to provide it.
Thanks for reading/using.
--------------------------------------------------------------------------------------------------
Update notes
1. Added the volume booster only (i.e. without the left/right swap) - Mic_VolBoost_A2L.zip
2. Updated main module with change from ADC3 to ADC2 volume (restores spectral balance, fixes buzzing) - Mic_VolBoost_Swap_A2L.zip
--------------------------------------------------------------------------------------------------

Please grab the updated Mic_VolBoost_Swap_A2L.zip if you already grabbed the first one. The spectral balance wasn't right. I've since done much testing and inspecting of waveforms and the spectral balances with Goldwave, and have made an improvement to the Left/Right inversion. It's not as loud, but there's also less buzzing/hissing, and now left and right are better balanced. Sorry for the trouble.

Related

Bedside Clock and Qi

I'm loving my new Tylt Vu and wireless charging. However, when I drop the phone on the Tylt, after seeing the wireless charging notification pop up, I don't see Daydream appear until my screen times out (which I have set at 10 minutes). I would love it if Daydream would appear instantly, like it does when I plug into the USB/wall charger. I have Daydream configured to turn on for both dock mode and while charging.
Any ideas?
Sent from my SM-N900T using Tapatalk
You could use tasker to do that most likely. I use it to tell me when the phone is charging (says charging) and turns off the screen.
Yeah, I was afraid of that, I think, because Tasker seems intimidating. Or more accurately, I worry that I don't have time for the learning curve.
Sent from my SM-N900T using Tapatalk
I'm certainly not a tasker pro, but there is an app that will launch Daydream https://play.google.com/store/apps/details?id=com.brianco.daydreamlauncher and the script for it then in tasker would be fairly simple. Unfortunately, that does not work on the Note 3 for some reason. The launcher just says it is closing without doing anything.
If it is fixed, then all you do is setup a profile that looks for when plugged into a charger, and run a task which launches the daydream launcher.
Something like (export XML from Tasker) you would just import this into your tasker and it would be setup:
Code:
<TaskerData sr="" dvi="1" tv="4.2u3m">
<Profile sr="prof9" ve="2">
<cdate>1385121313954</cdate>
<edate>1387567353105</edate>
<id>9</id>
<mid0>4</mid0>
<nme>Charging</nme>
<State sr="con0">
<code>10</code>
<Int sr="arg0" val="0"/>
</State>
</Profile>
<Task sr="task4">
<cdate>1385121469149</cdate>
<edate>1387567042690</edate>
<id>4</id>
<nme>SpeakCharge2</nme>
<pri>10</pri>
<Action sr="act0" ve="3">
<code>559</code>
<Str sr="arg0" ve="3">Charging</Str>
<Str sr="arg1" ve="3">default:default</Str>
<Int sr="arg2" val="3"/>
<Int sr="arg3" val="5"/>
<Int sr="arg4" val="5"/>
<Int sr="arg5" val="1"/>
<Int sr="arg6" val="0"/>
</Action>
<Action sr="act1" ve="3">
<code>20</code>
<App sr="arg0">
<appClass>com.brianco.daydreamlauncher.StartDaydream</appClass>
<appPkg>com.brianco.daydreamlauncher</appPkg>
<label>Daydream</label>
</App>
<Str sr="arg1" ve="3"/>
<Int sr="arg2" val="0"/>
</Action>
</Task>
</TaskerData>
This actually speaks "Charging" and then loads the launcher (Which doesn't work).
I sent the dev a note to see if he knows why it won't work on the Note 3.
A programmable NFC tag should work to do this? I don't have any direct experience with them but I am going to buy some and play around with them for my own needs. Something to look into at least.

Earphones sound increase

After finding here and there I found a way to increase earphones output sound
Steps
Step 1. Go into system /etc/ mixer.path.xml
Step 2. Open that file
Step 3.find this lines
<path name="headphones">
<path name="headphones-lite" />
<ctl name="COMP1 Switch" value="1" />
<ctl name="HPHL Volume" value="11" />
<ctl name="HPHR Volume" value="11" />
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="RX2 Digital Volume" value="84" />
</path>
Step 4. Increase the volume by increasing value of Rx1 And Rx2
Step 5. U can increase max at 99 and my suggestion will be 88 or 90 not more than that..
Stpe 6. Save this file
Thanks.
Any similar way to increase the speaker & earpiece volume?
Sound was loud for a second and then it went completely silent. It screwed up the total audio output of phone. Changing back the values did not help. Luckily I made a backup just before trying it. Thanks to twrp.
Sent from my D5322 using XDA-Developers mobile app

Any workaround for low mic volume on whatsapp/audio recording?

Hey, guys, recently installed LOS 14.1 to an A520F and the magisk module for low mic volume fix, but it doesn't fix the audio on whatsapp. I mean it records very low, also on voice recorder.
I search for any change on mixer_paths.xml but none of the lines that I saw are the ones that match on the A5.
thanks.
Have you found a solution ?
In my case the magisc mod did not work. My biggest issue is with the camcorder. My guess is that I have to change these values in mixer_gains.xml
Code:
<!-- camcorder input volume -->
-<path name="gain-camcorder-mic">
<ctl name="MIC1 Volume" value="10"/>
<ctl name="MIC1 Boost Volume" value="1"/>
<ctl name="MIC2 Volume" value="10"/>
<ctl name="MIC2 Boost Volume" value="1"/>
<ctl name="ADC Left Gain" value="145"/>
<ctl name="ADC Right Gain" value="145"/>
</path>
-<path name="gain-camcorder-headset-mic">
<ctl name="MIC3 Volume" value="7"/>
<ctl name="MIC3 Boost Volume" value="2"/>
<ctl name="ADC Left Gain" value="140"/>
<ctl name="ADC Right Gain" value="140"/>
</path>
-<path name="gain-camcorder-headphone-mic">
<ctl name="MIC1 Volume" value="10"/>
<ctl name="MIC1 Boost Volume" value="1"/>
<ctl name="MIC2 Volume" value="10"/>
<ctl name="MIC2 Boost Volume" value="1"/>
<ctl name="ADC Left Gain" value="140"/>
<ctl name="ADC Right Gain" value="140"/>

50 ohm sound volume by default with normal headphones, possible?

What I want is to get the 50 ohm sound volume when I connect a normal headphone
I guess it could be done either:
- Setting the 50 ohms sound volume to the hi-fi value
- Or, that the 50 ohms value is the one that is always triggered, no matter what I connect (normal headphone, high impedance headphone or aux)
Please, has anybody been able to achieve any of these?
I think you need to mess up with the mixer_paths_tavil.xml file but I wans't able to achieve it
My phone is rooted if that makes a difference
You have two options:
1) Buy impedance adapter to set impedance of headphones to 50+ ohm
2) You're right. You can mess with audio_mixer_tavil.xml and this will set it.
Code:
<!-- ESS DAC START -->
<path name="headphones-hifi-dac">
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="1" />
</path>
<path name="headphones-hifi-dac-advanced">
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="2" />
</path>
<path name="headphones-hifi-dac-aux">
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="3" />
</path>
<path name="headphones-hifi-dac-44.1">
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="1" />
</path>
<path name="headphones-hifi-dac-44.1-advanced">
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="2" />
</path>
<path name="headphones-hifi-dac-44.1-aux">
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="3" />
</path>
<path name="headphones-hifi-dacdop">
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="1" />
</path>
<path name="headphones-hifi-dacdop-advanced">
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="2" />
</path>
<path name="headphones-hifi-dacdop-aux">
<ctl name="Es9018 Master Volume" value="0" />
<ctl name="Es9018 AVC Volume" value="0" />
<ctl name="Es9018 HEADSET TYPE" value="3" />
</path>
This will set analog gain to max with any jack connection.
Problem is, in android pie in stock system you will probably won't be able to modify any file in /vendor partition. It must be "replaced" with magisk module.
Next problem is that even with replaced file, stock system will load default file. To solve it you need to open terminal app and type:
su
killall audioserver
After that you will have properly reloaded file, and volume will be maxed, but unfortunately it needs to be applied after every reboot. Oreo is ok, pie is ****ed up. That's why i am using custom rom.

Trying to increase the in-call volume on PixelExperience Plus whyred-11.0 (Xiaomi Redmi Note 5 Pro)

Hi!
I'm trying to mod my PixelExperience slightly by modifying vendor/etc/mixer_paths.xml file. The goal is to increase in-call volume.
However, for some reason any changes I do in this file are completely ignored.
I'm not really experienced in Android mods, so I might be missing something here...
I've tried changing the handset path name volume:
XML:
<path name="handset">
<ctl name="RX1 Digital Volume" value="92" />
to some larger values but no effect.
I also tried bumping all the values here:
XML:
<!-- Volume controls -->
<ctl name="HPHL Volume" value="9" />
<ctl name="HPHR Volume" value="9" />
<ctl name="EAR PA Gain" value="POS_1P5_DB" />
<ctl name="EAR PA Boost" value="ENABLE" />
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="RX2 Digital Volume" value="84" />
<ctl name="RX3 Digital Volume" value="84" />
<ctl name="RX4 Digital Volume" value="84" />
<ctl name="RX5 Digital Volume" value="84" />
<ctl name="ADC1 Volume" value="8" />
<ctl name="ADC2 Volume" value="8" />
<ctl name="ADC3 Volume" value="8" />
<ctl name="DEC1 Volume" value="92" />
<ctl name="DEC2 Volume" value="84" />
<ctl name="DEC3 Volume" value="84" />
<ctl name="DEC4 Volume" value="84" />
Again... no effect.
I attached my mixer_paths.xml file.
Will be very grateful for any insight on this issue.

Categories

Resources