Audio Codec wm8960 input channel Routing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Audio Codec wm8960 input channel Routing

Jump to solution
5,195 Views
vijay_jay5
Contributor II

Hi,

          I need small information on Audio Codec(WM8960) drivers.I took sabresd reference for my project, in my board Audio Codec working fine( I can able to record & Listen audio),As per imx-wm8960(Machine drivers) routed Audio Codec(WM8960) to MIC(input1 ADC to store audio in Process) & Head_phone(Processor's DAC to output channel).

But As per my requirements i need to play Auxiliary audio stream which connected to 2nd input channel & FM in 3rd input channel(Like below pic).

So how i can route it in imx-wm8960.c file like below.

static const struct snd_soc_dapm_route imx6_audio_map[] = {

    { "Headphone Jack",         NULL,           "HP_L"      },

    { "Headphone Jack",         NULL,           "HP_R"      },

    { "Speaker_L",              NULL,           "SPK_LP"    },

    { "Speaker_L",              NULL,           "SPK_LN"    },

    { "Speaker_R",              NULL,           "SPK_RP"    },

    { "Speaker_R",              NULL,           "SPK_RN"    },

    { "LINPUT1",                NULL,           "MICB"      },

    { "MICB",                   NULL,           "Mic Jack"  },

//    { "LINPUT3",                "LINPUT3 Switch",       "HP_L"   },

//    { "RINPUT3",                "RINPUT3 Switch",       "HP_R"   },

     

}

I am waiting for your reply. Thank you.

Screenshot from 2016-02-16 11_33_32.png

Labels (2)
0 Kudos
Reply
1 Solution
3,210 Views
jimmychan
NXP TechSupport
NXP TechSupport

For your reference: WM8960 audio codec

Check the audio path and the name of the switches. Using amixer or alsamixer to switch on the corresponding switches.

View solution in original post

9 Replies
3,211 Views
jimmychan
NXP TechSupport
NXP TechSupport

For your reference: WM8960 audio codec

Check the audio path and the name of the switches. Using amixer or alsamixer to switch on the corresponding switches.

3,211 Views
vijay_jay5
Contributor II

Thanks for your reply,

By using amixer/alsamixer(from user space) we can switch the channel, but in imx-wm8960.c file we are routing the input & output channels right? so as per my requirements, I had switched(routed) input channel3&2 to output mixer  like below but not working, Pls check it once ,If wrong let me know.

static const struct snd_soc_dapm_route imx6_audio_map[] = {

    { "Headphone Jack",         NULL,           "HP_L"      },

    { "Headphone Jack",         NULL,           "HP_R"      },

    { "Speaker_L",              NULL,           "SPK_LP"    },

    { "Speaker_L",              NULL,           "SPK_LN"    },

    { "Speaker_R",              NULL,           "SPK_RP"    },

    { "Speaker_R",              NULL,           "SPK_RN"    },

    { "LINPUT1",                NULL,           "MICB"      },

    { "MICB",                   NULL,           "Mic Jack"  },

   { "LINPUT3",                "LINPUT3 Switch",       "HP_L"   },                    //for AUX input Is this correct or not?

    { "RINPUT3",                "RINPUT3 Switch",       "HP_R"   },                 // Is this correct or not?

    

   { "LINPUT2",                "LINPUT2 Switch",       "HP_L"   },                    //for FM input Is this correct or not?

    { "RINPUT3",                "RINPUT2 Switch",       "HP_R"   },                 // Is this correct or not?

}

0 Kudos
Reply
3,211 Views
jimmychan
NXP TechSupport
NXP TechSupport

The path is from right to left , like : { “destination”, “switch”, “source” }.

I think you don't need to add the audio path in the machine driver (imx-wm8960.c) because the audio path had already existed in the codec driver (wm8960.c).  You can double check the "static const struct snd_soc_dapm_route audio_paths[]" in codec driver.  You can see something like :

    { "Left Boost Mixer", "LINPUT1 Switch", "LINPUT1" },

    { "Left Boost Mixer", "LINPUT2 Switch", "LINPUT2" },

    { "Left Boost Mixer", "LINPUT3 Switch", "LINPUT3" },

    { "Left Input Mixer", "Boost Switch", "Left Boost Mixer", },

    { "Left Input Mixer", NULL, "LINPUT1", },  /* Really Boost Switch */

    { "Left Input Mixer", NULL, "LINPUT2" },

    { "Left Input Mixer", NULL, "LINPUT3" },

    { "Right Boost Mixer", "RINPUT1 Switch", "RINPUT1" },

    { "Right Boost Mixer", "RINPUT2 Switch", "RINPUT2" },

    { "Right Boost Mixer", "RINPUT3 Switch", "RINPUT3" },

    { "Right Input Mixer", "Boost Switch", "Right Boost Mixer", },

    { "Right Input Mixer", NULL, "RINPUT1", },  /* Really Boost Switch */

    { "Right Input Mixer", NULL, "RINPUT2" },

    { "Right Input Mixer", NULL, "LINPUT3" },

    { "Left ADC", NULL, "Left Input Mixer" },

    { "Right ADC", NULL, "Right Input Mixer" },

    { "Left Output Mixer", "LINPUT3 Switch", "LINPUT3" },

    { "Left Output Mixer", "Boost Bypass Switch", "Left Boost Mixer"} ,

    { "Left Output Mixer", "PCM Playback Switch", "Left DAC" },

    { "Right Output Mixer", "RINPUT3 Switch", "RINPUT3" },

    { "Right Output Mixer", "Boost Bypass Switch", "Right Boost Mixer" } ,

    { "Right Output Mixer", "PCM Playback Switch", "Right DAC" },

    { "LOUT1 PGA", NULL, "Left Output Mixer" },

    { "ROUT1 PGA", NULL, "Right Output Mixer" },

    { "HP_L", NULL, "LOUT1 PGA" },

    { "HP_R", NULL, "ROUT1 PGA" },

    { "Left Speaker PGA", NULL, "Left Output Mixer" },

    { "Right Speaker PGA", NULL, "Right Output Mixer" },

    { "Left Speaker Output", NULL, "Left Speaker PGA" },

    { "Right Speaker Output", NULL, "Right Speaker PGA" },

    { "SPK_LN", NULL, "Left Speaker Output" },

    { "SPK_LP", NULL, "Left Speaker Output" },

    { "SPK_RN", NULL, "Right Speaker Output" },

    { "SPK_RP", NULL, "Right Speaker Output" },

};

For example, from LINPUT3 to HP_L, the path is LINPUT3 -> LI2LOVOL[2:0] -> LI2LO switch ->LOMIX -> LOUT1VOL [6:0] -> HP_L

so, please make sure the Volume and the Switch in between LINPUT3 and HP_L are turn on. (tune the volume and turn on the switch in alsamixer/amixer)

3,211 Views
vijay_jay5
Contributor II

Thanks jimmychan​.

I will implement & let you know.

Thank you so much.

0 Kudos
Reply
3,211 Views
vijay_jay5
Contributor II

Actually i had try to install "alsamixer.apk" but it's asking Root Permission.So how i can handle this alsa/alsa mixer. Thanks In advance.

0 Kudos
Reply
3,211 Views
jimmychan
NXP TechSupport
NXP TechSupport

it is an Android apps installation/permission issue, please create a new post. Thanks.

0 Kudos
Reply
3,211 Views
vijay_jay5
Contributor II

Hi jimmychan,

  I created new post & viewing the post in below link

About the Android APK installation/permission

0 Kudos
Reply
3,211 Views
jimmychan
NXP TechSupport
NXP TechSupport

One more information for your reference,

Porting WM8960 to Android jb4.2.2

0 Kudos
Reply
3,213 Views
vijay_jay5
Contributor II

Ok, Thanks for your reply.Already i gone through the given link.

If you get any idea about the alsamixer documentation/ switching methodologies. 

0 Kudos
Reply