[Android Software Development] chdloc:
modified mixer_paths.xml for various Qualcomm-based devices

The intention of this post is to host the relevant device sections of mixer_path.xml files that enable IIR hardware filtering. Simply replace the relevant section in your mixer with the device-appropriate section below.

Alternatively, try the attached entire IIR-prepared mixer_paths.xml file for your device. However, there may be carrier/country-specific variances between mixer_paths files. Only Nexus devices seem to be immune from this carrier-specific madness. Please make sure to backup your current mixer_paths.xml file before proceeding.

Relevant device in mixer_paths.xml ("headphones") modified for IIR passthrough (bypass) on Nexus 5 and LG G2. Thanks [MENTION=1882442]lordc[/MENTION] !

<path name="headphones">
<ctl name="SLIM RX1 MUX" value="AIF1_PB" />
<ctl name="SLIM RX2 MUX" value="AIF1_PB" />
<ctl name="SLIM_0_RX Channels" value="Two" />
<!-- begin stock routing (commented out) -->
<!-- <ctl name="RX1 MIX1 INP1" value="RX1" /> -->
<!-- <ctl name="RX2 MIX1 INP1" value="RX2" /> -->
<!-- end stock routing (commented out) -->
<ctl name="CLASS_H_DSM MUX" value="DSM_HPHL_RX1" />
<ctl name="HPHL DAC Switch" value="1" />

<!-- enabling IIR filter; coefficients can be modified on-the-fly with tinymix, see below -->
<!-- RX1 plugs into the IIR1 mux and RX2 plugs into the IIR2 mux -->
<ctl name="IIR1 INP1 MUX" value="RX1" />
<ctl name="IIR2 INP1 MUX" value="RX2" />
<!-- IIR1 filter cofficients (pass-through) -->
<ctl name="IIR1 Band1" id ="0" value="268435456" />
<ctl name="IIR1 Band1" id ="1" value="0" />
<ctl name="IIR1 Band1" id ="2" value="0" />
<ctl name="IIR1 Band1" id ="3" value="0" />
<ctl name="IIR1 Band1" id ="4" value="0" />
<ctl name="IIR1 Band2" id ="0" value="268435456" />
<ctl name="IIR1 Band2" id ="1" value="0" />
<ctl name="IIR1 Band2" id ="2" value="0" />
<ctl name="IIR1 Band2" id ="3" value="0" />
<ctl name="IIR1 Band2" id ="4" value="0" />
<ctl name="IIR1 Band3" id ="0" value="268435456" />
<ctl name="IIR1 Band3" id ="1" value="0" />
<ctl name="IIR1 Band3" id ="2" value="0" />
<ctl name="IIR1 Band3" id ="3" value="0" />
<ctl name="IIR1 Band3" id ="4" value="0" />
<ctl name="IIR1 Band4" id ="0" value="268435456" />
<ctl name="IIR1 Band4" id ="1" value="0" />
<ctl name="IIR1 Band4" id ="2" value="0" />
<ctl name="IIR1 Band4" id ="3" value="0" />
<ctl name="IIR1 Band4" id ="4" value="0" />
<ctl name="IIR1 Band5" id ="0" value="268435456" />
<ctl name="IIR1 Band5" id ="1" value="0" />
<ctl name="IIR1 Band5" id ="2" value="0" />
<ctl name="IIR1 Band5" id ="3" value="0" />
<ctl name="IIR1 Band5" id ="4" value="0" />
<ctl name="IIR1 Enable Band1" value="1" />
<ctl name="IIR1 Enable Band2" value="1" />
<ctl name="IIR1 Enable Band3" value="1" />
<ctl name="IIR1 Enable Band4" value="1" />
<ctl name="IIR1 Enable Band5" value="1" />
<!-- IIR2 filter coefficients; same as IIR1 -->
<ctl name="IIR2 Band1" id ="0" value="268435456" />
<ctl name="IIR2 Band1" id ="1" value="0" />
<ctl name="IIR2 Band1" id ="2" value="0" />
<ctl name="IIR2 Band1" id ="3" value="0" />
<ctl name="IIR2 Band1" id ="4" value="0" />
<ctl name="IIR2 Band2" id ="0" value="268435456" />
<ctl name="IIR2 Band2" id ="1" value="0" />
<ctl name="IIR2 Band2" id ="2" value="0" />
<ctl name="IIR2 Band2" id ="3" value="0" />
<ctl name="IIR2 Band2" id ="4" value="0" />
<ctl name="IIR2 Band3" id ="0" value="268435456" />
<ctl name="IIR2 Band3" id ="1" value="0" />
<ctl name="IIR2 Band3" id ="2" value="0" />
<ctl name="IIR2 Band3" id ="3" value="0" />
<ctl name="IIR2 Band3" id ="4" value="0" />
<ctl name="IIR2 Band4" id ="0" value="268435456" />
<ctl name="IIR2 Band4" id ="1" value="0" />
<ctl name="IIR2 Band4" id ="2" value="0" />
<ctl name="IIR2 Band4" id ="3" value="0" />
<ctl name="IIR2 Band4" id ="4" value="0" />
<ctl name="IIR2 Band5" id ="0" value="268435456" />
<ctl name="IIR2 Band5" id ="1" value="0" />
<ctl name="IIR2 Band5" id ="2" value="0" />
<ctl name="IIR2 Band5" id ="3" value="0" />
<ctl name="IIR2 Band5" id ="4" value="0" />
<ctl name="IIR2 Enable Band1" value="1" />
<ctl name="IIR2 Enable Band2" value="1" />
<ctl name="IIR2 Enable Band3" value="1" />
<ctl name="IIR2 Enable Band4" value="1" />
<ctl name="IIR2 Enable Band5" value="1" />
<!-- IIR1 plugs back into RX1 mux and IIR2 plugs back into RX2 mux -->
<ctl name="RX1 MIX1 INP1" value="IIR1" />
<ctl name="RX2 MIX1 INP1" value="IIR2" />
<!-- set IIR1 and IIR2 gain (84<=>0dB; lower this parameter appropriately if any of the biquads introduce gain) -->
<ctl name="IIR1 INP1 Volume" value="84" />
<ctl name="IIR2 INP1 Volume" value="84" />

<!-- uncomment below if desired for cross-feed into second input of the IIR filter (needs kernel mod on hammerhead!) -->
<!-- <ctl name="IIR1 INP2 MUX" value="RX2" /> -->
<!-- <ctl name="IIR2 INP2 MUX" value="RX1" /> -->
<!-- set the gain of the cross-feed (here: cross terms down by 24 dB, i.e 84-60) -->
<!-- <ctl name="IIR1 INP2 Volume" value="60" /> -->
<!-- <ctl name="IIR2 INP2 Volume" value="60" /> -->

<!-- end test filter -->

<!-- back to stock below -->
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="RX2 Digital Volume" value="84" />
<!-- lowered the HPHL[R] Volume from 15 to 10 to significantly reduce THD -->
<ctl name="HPHL Volume" value="10" />
<ctl name="HPHR Volume" value="10" />
</path>

Relevant device in mixer_paths.xml ("headset") modified for IIR passthrough on Note 4 (Snapdragon). Thanks [MENTION=281070]bjrmd[/MENTION] !

<path name="headset">
<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="CLASS_H_DSM MUX" value="DSM_HPHL_RX1"/>
<ctl name="HPHL DAC Switch" value="1"/>

<!-- enabling IIR filter in pass-through mode; coefficients can be modified on-the-fly with tinymix -->
<!-- RX1 plugs into the IIR1 mux and RX2 plugs into the IIR2 mux -->
<ctl name="IIR1 INP1 MUX" value="RX1"/>
<ctl name="IIR2 INP1 MUX" value="RX2"/>
<!-- coefficients below define a no-op filter (0 dB of gain for all frequencies) -->
<ctl name="IIR1 Band1" id="0" value="268435456"/>
<ctl name="IIR1 Band1" id="1" value="0"/>
<ctl name="IIR1 Band1" id="2" value="0"/>
<ctl name="IIR1 Band1" id="3" value="0"/>
<ctl name="IIR1 Band1" id="4" value="0"/>
<ctl name="IIR1 Band2" id="0" value="268435456"/>
<ctl name="IIR1 Band2" id="1" value="0"/>
<ctl name="IIR1 Band2" id="2" value="0"/>
<ctl name="IIR1 Band2" id="3" value="0"/>
<ctl name="IIR1 Band2" id="4" value="0"/>
<ctl name="IIR1 Band3" id="0" value="268435456"/>
<ctl name="IIR1 Band3" id="1" value="0"/>
<ctl name="IIR1 Band3" id="2" value="0"/>
<ctl name="IIR1 Band3" id="3" value="0"/>
<ctl name="IIR1 Band3" id="4" value="0"/>
<ctl name="IIR1 Band4" id="0" value="268435456"/>
<ctl name="IIR1 Band4" id="1" value="0"/>
<ctl name="IIR1 Band4" id="2" value="0"/>
<ctl name="IIR1 Band4" id="3" value="0"/>
<ctl name="IIR1 Band4" id="4" value="0"/>
<ctl name="IIR1 Band5" id="0" value="268435456"/>
<ctl name="IIR1 Band5" id="1" value="0"/>
<ctl name="IIR1 Band5" id="2" value="0"/>
<ctl name="IIR1 Band5" id="3" value="0"/>
<ctl name="IIR1 Band5" id="4" value="0"/>
<ctl name="IIR1 Enable Band1" value="1"/>
<ctl name="IIR1 Enable Band2" value="1"/>
<ctl name="IIR1 Enable Band3" value="1"/>
<ctl name="IIR1 Enable Band4" value="1"/>
<ctl name="IIR1 Enable Band5" value="1"/>
<!-- IIR2 filter coefficients; same as IIR1 -->
<ctl name="IIR2 Band1" id="0" value="268435456"/>
<ctl name="IIR2 Band1" id="1" value="0"/>
<ctl name="IIR2 Band1" id="2" value="0"/>
<ctl name="IIR2 Band1" id="3" value="0"/>
<ctl name="IIR2 Band1" id="4" value="0"/>
<ctl name="IIR2 Band2" id="0" value="268435456"/>
<ctl name="IIR2 Band2" id="1" value="0"/>
<ctl name="IIR2 Band2" id="2" value="0"/>
<ctl name="IIR2 Band2" id="3" value="0"/>
<ctl name="IIR2 Band2" id="4" value="0"/>
<ctl name="IIR2 Band3" id="0" value="268435456"/>
<ctl name="IIR2 Band3" id="1" value="0"/>
<ctl name="IIR2 Band3" id="2" value="0"/>
<ctl name="IIR2 Band3" id="3" value="0"/>
<ctl name="IIR2 Band3" id="4" value="0"/>
<ctl name="IIR2 Band4" id="0" value="268435456"/>
<ctl name="IIR2 Band4" id="1" value="0"/>
<ctl name="IIR2 Band4" id="2" value="0"/>
<ctl name="IIR2 Band4" id="3" value="0"/>
<ctl name="IIR2 Band4" id="4" value="0"/>
<ctl name="IIR2 Band5" id="0" value="268435456"/>
<ctl name="IIR2 Band5" id="1" value="0"/>
<ctl name="IIR2 Band5" id="2" value="0"/>
<ctl name="IIR2 Band5" id="3" value="0"/>
<ctl name="IIR2 Band5" id="4" value="0"/>
<ctl name="IIR2 Enable Band1" value="1"/>
<ctl name="IIR2 Enable Band2" value="1"/>
<ctl name="IIR2 Enable Band3" value="1"/>
<ctl name="IIR2 Enable Band4" value="1"/>
<ctl name="IIR2 Enable Band5" value="1"/>
<!--IIR1 plugs back into RX1 mux and IIR2 plugs back into RX2 mux -->
<ctl name="RX1 MIX1 INP1" value="IIR1"/>
<ctl name="RX2 MIX1 INP1" value="IIR2"/>
<!-- set IIR1 and IIR2 gain (84 equals 0 dB) -->
<ctl name="IIR1 INP1 Volume" value="84"/>
<ctl name="IIR2 INP1 Volume" value="84"/>

<!-- cross-feed into second input of the IIR filter (needs kernel mod on hammerhead!) -->
<!-- <ctl name="IIR1 INP2 MUX" value="RX2" /> -->
<!-- <ctl name="IIR2 INP2 MUX" value="RX1" /> -->
<!-- set the gain of the cross-feed (here: cross terms down by 24 dB, i.e 84-60) -->
<!-- <ctl name="IIR1 INP2 Volume" value="60" /> -->
<!-- <ctl name="IIR2 INP2 Volume" value="60" /> -->

<ctl name="HPHL Volume" value="20"/>
<ctl name="HPHR Volume" value="20"/>
<ctl name="RX1 Digital Volume" value="80"/>
<ctl name="RX2 Digital Volume" value="80"/>
<ctl name="COMP1 Switch" value="1"/>
</path>