Rerouting android's right channel's audio to left channel (ROOT)

My Android phone's right speaker stopped working, so any audio going to the right audio channel was gone.

And I'm not a fan of switching phone's too quickly before giving things a try.

So I found out how to reroute the right audio channel in android to go to the left audio channel, so all audio comes out from the working speaker (left).

Android's audio devices config files can be found in /vendor/etc/mixer_paths_*.xml

With little searching I found out that my phone's audio devices config file is /vendor/etc/mixer_paths_tasha.xml

After reading the file a bit, I found out the speaker configs.

  • speaker-fluid : left speaker (right and left channels go to left)
  • speaker: normal (right channel goes right, left channel goes left)
    <path name="speaker">
        <ctl name="COMP7 Switch" value="1" />
        <ctl name="COMP8 Switch" value="1" />
        <ctl name="AIF4_VI Mixer SPKR_VI_1" value="1" />
        <ctl name="AIF4_VI Mixer SPKR_VI_2" value="1" />
        <ctl name="SLIM_4_TX Format" value="PACKED_16B" />
        <ctl name="SLIM RX0 MUX" value="AIF_MIX2_PB" />
        <ctl name="SLIM RX1 MUX" value="AIF_MIX1_PB" />
        <ctl name="SLIM_0_RX Channels" value="Two" />
        <ctl name="RX INT7_1 MIX1 INP0" value="RX0" />
        <ctl name="RX INT8_1 MIX1 INP0" value="RX1" />
        <ctl name="SpkrLeft COMP Switch" value="1" />
        <ctl name="SpkrRight COMP Switch" value="1" />
        <ctl name="SpkrLeft BOOST Switch" value="1" />
        <ctl name="SpkrRight BOOST Switch" value="1" />
        <ctl name="SpkrLeft VISENSE Switch" value="1" />
        <ctl name="SpkrRight VISENSE Switch" value="1" />
        <ctl name="SpkrLeft SWR DAC_Port Switch" value="1" />
        <ctl name="SpkrRight SWR DAC_Port Switch" value="1" />
        <ctl name="VI_FEED_TX Channels" value="Two" />
        <ctl name="SLIM0_RX_VI_FB_LCH_MUX"  value="SLIM4_TX" />
        <ctl name="SLIM0_RX_VI_FB_RCH_MUX"  value="SLIM4_TX" />
    </path>

    <path name="speaker-fluid">
        <ctl name="COMP7 Switch" value="1" />
        <ctl name="SLIM RX0 MUX" value="AIF_MIX1_PB" />
        <ctl name="SLIM_0_RX Channels" value="One" />
        <ctl name="RX INT7_1 MIX1 INP0" value="RX0" />
        <ctl name="SpkrLeft COMP Switch" value="1" />
        <ctl name="SpkrLeft BOOST Switch" value="1" />
        <ctl name="SpkrLeft VISENSE Switch" value="1" />
        <ctl name="SpkrLeft SWR DAC_Port Switch" value="1" />
    </path>

All we have to do is replace the normal speaker's config, with the speaker fluid config like so.

    <path name="speaker">
        <ctl name="COMP7 Switch" value="1" />
        <ctl name="SLIM RX0 MUX" value="AIF_MIX1_PB" />
        <ctl name="SLIM_0_RX Channels" value="One" />
        <ctl name="RX INT7_1 MIX1 INP0" value="RX0" />
        <ctl name="SpkrLeft COMP Switch" value="1" />
        <ctl name="SpkrLeft BOOST Switch" value="1" />
        <ctl name="SpkrLeft VISENSE Switch" value="1" />
        <ctl name="SpkrLeft SWR DAC_Port Switch" value="1" />
    </path>

    <path name="speaker-fluid">
        <ctl name="COMP7 Switch" value="1" />
        <ctl name="SLIM RX0 MUX" value="AIF_MIX1_PB" />
        <ctl name="SLIM_0_RX Channels" value="One" />
        <ctl name="RX INT7_1 MIX1 INP0" value="RX0" />
        <ctl name="SpkrLeft COMP Switch" value="1" />
        <ctl name="SpkrLeft BOOST Switch" value="1" />
        <ctl name="SpkrLeft VISENSE Switch" value="1" />
        <ctl name="SpkrLeft SWR DAC_Port Switch" value="1" />
    </path>

Now the right audio channel will come out from the left speaker :)

This is the 2nd part of this series, you can read the first here: Rerouting android's loud speaker calls audio to left audio channel (ROOT)