[OnePlus 3 Themes, Apps, and Mods] abhi08638:
** Added Mono + Disable Camera NS

What is this?

This post is a collection of all the audio related mods I have created from the OnePlus 3. The mods so far are: Mono surround sound, Camcorder Mic Gain, Cam Mic Gain plus Mono Surround sound, and various Camera recording tests. The cam disable NS is the latest for fixing the noise suppression on video recordings. If you have a request, then make it here and I'll try to make it if I can.

Various Mod Explanations

What is it?***Mono Surround***

This mod will activate you front earpiece speaker in conjunction with the bottom main speaker any time Speaker mode is used for example playing music, watching movies, shows, you tube and so on, creating an almost surround sound type of effect. This will not effect notifications because that is a different setting that I don't really care about.

Mono Surround Sound

This version plays all audio through one channel. This basically means that you now have 2 mono speakers. Fair Warning, I find the sound very underwhelming. WARNING: MESSING WITH YOUR EQ WILL ALSO EFFECT THE EARPIECE. IT COULD POTENTIALLY BLOW IT OUT IF YOU INCREASE THE VOLUME OR BASS TOO MUCH

Camcorder Mic Gain

This version increases the microphone gain for the audio recorded through the camcorder only. I did this as a workaround for the way too aggressive noise cancellation that happens. This won't fix the problem but hopefully make it more bearable. If I find a better way to fix this, I will update this mod.

Camcorder Mic Fix Test 1

This version uses a different stereo microphone path to record audio for the camcorder. This is a test and I don't know if it's better than stock or not. Please test and use the poll so I can see if its working or not

Camcorder Disable NS v4

V1: This version attempts to disable the noise suppression for the camcorder in the audio_platform_info.xml.

V2: It also increases the mic gain by 12db for the camcorder only on CM

V3: switches to stereo recording for CM

V4: Increases gain for OOS by 12 db

Prerequisites and installation instructions

MUST be rooted

MUST be on CM (OOS is untested)

MUST have TWRP installed

Flash one of the zips below

reboot

This mod modifies the mixer_path_tasha.xml in the /system/etc folder. I have only tested this on CM13. I don't guarantee it will work for your rom, because this is based off Blisspop rom. Although the worst that'll happen is you'll lose sound and mic. If you do lose sound, flash the revert zip to restore your original file. In a worst case scenario where you messed up the permissions and are in a bootloop, dirty flash your rom.

DIY

Background:

OnePlus is using deep buffering for their audio processing to conserve battery life. If you want to disable deep buffering, go to your build.prop and edit this line to false

Note: Changing this will change the sound mapping in the mixer_paths_tasha

audio.deep_buffer.media=true

audio_platform_info.xml

Speaker is referenced as "quat_i2s" with the interface "SLIMBUS_0_RX"

mixer_paths_tasha.xml

Audio playback for music

<path name="deep-buffer-playback quat_i2s">
<ctl name="QUAT_MI2S_RX Audio Mixer MultiMedia1" value="1" />
</path>

Audio playback for notifications

<path name="low-latency-playback quat_i2s">
<ctl name="QUAT_MI2S_RX Audio Mixer MultiMedia5" value="1" />
</path>

Note: If deep buffering is enabled, all sound will go through the low latency playback path.

Mono Surround Sound

<path name="deep-buffer-playback quat_i2s">
<ctl name="SLIMBUS_0_RX Audio Mixer MultiMedia1" value="1" />
<ctl name="SLIM RX0 MUX" value="AIF_MIX1_PB" />
<ctl name="SLIM_0_RX Channels" value="One" />
<ctl name="RX INT0_1 MIX1 INP0" value="RX0" />
<ctl name="RX INT0 DEM MUX" value="CLSH_DSM_OUT" />
<ctl name="EAR PA Gain" value="G_8_DB" />
<ctl name="RX0 Digital Volume" value="95" />
<ctl name="QUAT_MI2S_RX Audio Mixer MultiMedia1" value="1" />
</path>

To change the volume of the earpiece for audio playback, change RX0 Digital Volume to a value from 1 to 128. Anything above 95 might be dangerous

To disable the speaker and only use the earpiece for audio playback, delete the line <ctl name="QUAT_MI2S_RX Audio Mixer MultiMedia1" value="1" />

Earpiece Volume

<path name="handset">
<ctl name="SLIM RX0 MUX" value="AIF_MIX1_PB" />
<ctl name="SLIM_0_RX Channels" value="One" />
<ctl name="RX INT0_1 MIX1 INP0" value="RX0" />
<ctl name="RX INT0 DEM MUX" value="CLSH_DSM_OUT" />
<ctl name="EAR PA Gain" value="G_6_DB" />
</path>

To modify the earpiece volume for anything that uses the earpiece for output add the line inside the path and modify the volume to your liking from 1 to 128

<ctl name="RX0 Digital Volume" value="95" />

to this path

Earpiece Mic

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

Add the following line inside the path and change the value to your liking from 1 to 124 where 84 is the default. Each increase by 1 corresponds to 1db of gain.

<ctl name="DEC4 Volume" value="84" />

Headphones Volume

This might be the headphones path that is being used but I haven't tested it.

<path name="headphones">
<ctl name="SLIM RX5 MUX" value="AIF4_PB" />
<ctl name="SLIM RX6 MUX" value="AIF4_PB" />
<ctl name="SLIM_6_RX Channels" value="Two" />
<!-- #ifdef VENDOR_EDIT-->
<!-- guoguangyi@MultiMedia,2016/4/7,use 24bits to get rid of 16bits innate noise -->
<ctl name="SLIM_0_RX Format" value="S24_LE" />
<!-- #endif VENDOR_EDIT-->
<ctl name="RX INT1_2 MUX" value="RX5" />
<ctl name="RX INT2_2 MUX" value="RX6" />
<ctl name="RX INT1 DEM MUX" value="CLSH_DSM_OUT" />
<ctl name="RX INT2 DEM MUX" value="CLSH_DSM_OUT" />
<!-- #ifdef VENDOR_EDIT -->
<!-- /*zhiguang.su@MultiMedia.AudioDrv , 2016/02/19, add for hw require*/ -->
<ctl name="HPHL Volume" value="19" />
<ctl name="HPHR Volume" value="19" />
<!-- #endif -->
</path>

Feel free to play around with the volume values

Adjusting Camera Mic Volume

This is only if you have flashed the disable NS Camera Fix

<path name="speaker-stereo-dmic-ef">
<path name="speaker-dmic-endfire" />
<!-- #ifdef VENDOR_EDIT -->
<!-- /*zhiguang.su@MultiMedia.AudioDrv , 2016/04/19, mic power high level mode and add adc volume*/ -->
<ctl name="ADC4 Volume" value="11" />
<ctl name="ADC5 Volume" value="11" />
<ctl name="AMIC_3_4 PWR MODE" value="HIGH_PERF" />
<ctl name="AMIC_5_6 PWR MODE" value="HIGH_PERF" />
<ctl name="DEC4 Volume" value="96" />
<ctl name="DEC5 Volume" value="96" />
<!-- #endif -->
</path>

DEC4 and DEC5 correspond to different channels. If you want to increase the gain equally, adjust DEC4 and DEC5 volume to whatever you like. 84 is the default value which means 0db gain. Each increment by 1 indicates a 1db gain for the corresponding channel. DEC volume ranges from 1 to 124.

Credits

All credits go to [MENTION=2760454]chdloc[/MENTION] for disabling the noise suppression and [MENTION=3497901]mhoppi[/MENTION] for testing

Flashable Zips are below