This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ASOC codec driver problem on ti816x

Expert 2990 points
Other Parts Discussed in Thread: TLV320AIC32

Hi 

Now I need two channel audio .So I used two tlv320aic32 codec chip,which one is connected to ti816x mcasp0,and anther is connected to ti816x mcasp1.
This is snd_soc_dai_link
static struct snd_soc_dai_link ti81xx_mcasp_dai[] = {
{
.name = "TLV320AIC3X0",
.stream_name = "AIC3X0",
.cpu_dai_name= "davinci-mcasp.0",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.1-0018",
.platform_name = "davinci-pcm-audio",
.init = ti81xx_evm_aic3x_init,
.ops = &ti81xx_evm_ops,
},
{
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name= "davinci-mcasp.1",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.2-0018",
.platform_name = "davinci-pcm-audio",
.init = ti81xx_evm_aic3x_init,
.ops = &ti81xx_evm_ops,
},
#ifdef CONFIG_SND_SOC_TI81XX_HDMI
{
.name = "HDMI_SOC_LINK",
.stream_name = "hdmi",
.cpu_dai_name = "hdmi-dai",
.platform_name = "davinci-pcm-audio",
.codec_dai_name = "HDMI-DAI-CODEC", /* DAI name */
.codec_name = "hdmi-dummy-codec",
},
};

When the kernel is loaded.It will have some problem,it is the dmesg

asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok

tlv320aic3x-codec 2-0018: tlv320aic3x-codec.2-0018: Failed to add PCM Playback Volume: -16
asoc: failed to add dapm kcontrol Right HPCOM Mixer Line2L Bypass Switch: -16
asoc: failed to add dapm kcontrol Left HPCOM Mixer Line2L Bypass Switch: -16
asoc: failed to add dapm kcontrol Right HP Mixer Line2L Bypass Switch: -16
asoc: failed to add dapm kcontrol Left HP Mixer Line2L Bypass Switch: -16
asoc: failed to add dapm kcontrol Mono Mixer Line2L Bypass Switch: -16
asoc: failed to add dapm kcontrol Right Line Mixer Line2L Bypass Switch: -16
asoc: failed to add dapm kcontrol Left Line Mixer Line2L Bypass Switch: -16
asoc: failed to add kcontrol Right Line2R Mux
asoc: failed to add kcontrol Right Line1R Mux
asoc: failed to add kcontrol Right Line1L Mux
asoc: failed to add dapm kcontrol Right PGA Mixer Line1R Switch: -16
asoc: failed to add kcontrol Left Line2L Mux
asoc: failed to add kcontrol Left Line1R Mux
asoc: failed to add kcontrol Left Line1L Mux
asoc: failed to add dapm kcontrol Left PGA Mixer Line1L Switch: -16
asoc: failed to add kcontrol Right HPCOM Mux
asoc: failed to add kcontrol Right DAC Mux
asoc: failed to add kcontrol Left HPCOM Mux
asoc: failed to add kcontrol Left DAC Mux
asoc: tlv320aic3x-hifi <-> davinci-mcasp.1 mapping ok
asoc: HDMI-DAI-CODEC <-> hdmi-dai mapping ok

This is my audio card device file.
root@dm816x:~# ls -l /dev/snd/
/dev/snd/controlC0 /dev/snd/pcmC0D0p /dev/snd/pcmC0D1p /dev/snd/timer
/dev/snd/pcmC0D0c /dev/snd/pcmC0D1c /dev/snd/pcmC0D2p

Now the two audio channel can work.But I don't know the what is the failed message and how to remove

Thanks

  • I have opened the debug info

    which is the detailed info

    ALSA sound/core/control.c:345: control 2:0:0:Right HPCOM Mixer Line2L Bypass Switch:0 is already present
    asoc: failed to add dapm kcontrol Right HPCOM Mixer Line2L Bypass Switch: -16
    ALSA sound/core/control.c:345: control 2:0:0:Left HPCOM Mixer Line2L Bypass Switch:0 is already present
    asoc: failed to add dapm kcontrol Left HPCOM Mixer Line2L Bypass Switch: -16
    ALSA sound/core/control.c:345: control 2:0:0:Right HP Mixer Line2L Bypass Switch:0 is already present
    asoc: failed to add dapm kcontrol Right HP Mixer Line2L Bypass Switch: -16
    ALSA sound/core/control.c:345: control 2:0:0:Left HP Mixer Line2L Bypass Switch:0 is already present
    asoc: failed to add dapm kcontrol Left HP Mixer Line2L Bypass Switch: -16
    ALSA sound/core/control.c:345: control 2:0:0:Mono Mixer Line2L Bypass Switch:0 is already present
    asoc: failed to add dapm kcontrol Mono Mixer Line2L Bypass Switch: -16

    who can help me to analysis the problem

    Thanks

  • Hi Quan,

    Are you using EZSDK 5.05.02.00? Are you planning to use I2C0 to control/configure the tlv320aic32 codec chips?

    Please check the below links, might be in help:

    http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide#Audio_driver_.28McASP.29

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_AUDIO_Driver_User_Guide

    Regards,

    Pavel

  • Hi Quote

    I am using DVRRDK3.0.
     
    The mcasp0 connected to the tlv320aic32 which is controled by I2C0

    The mcasp1 connected to anther tlv320aic32 which is controled by I2C1

    When I configured  any channel alone to capture and playback audio ,It can works.

    However when I configured the two channel, the kernel would have the above failure .

    This is the struct snd_soc_dai_link

    static struct snd_soc_dai_link ti81xx_mcasp_dai[] = {
    #if 1  
        {
      .name = "TLV320AIC3X0",
      .stream_name = "AIC3X0",
      .cpu_dai_name= "davinci-mcasp.0",
      .codec_dai_name = "tlv320aic3x-hifi",
      .codec_name = "tlv320aic3x-codec.1-0018",
      .platform_name = "davinci-pcm-audio",
      .init = ti81xx_evm_aic3x_init,
      .ops = &ti81xx_evm_ops,
     },
    #endif
    #if 1
     {
      .name = "TLV320AIC3X",
      .stream_name = "AIC3X",
      .cpu_dai_name= "davinci-mcasp.1",
      .codec_dai_name = "tlv320aic3x-hifi",
      .codec_name = "tlv320aic3x-codec.2-0018",
      .platform_name = "davinci-pcm-audio",
      .init = ti81xx_evm_aic3x_init,
      .ops = &ti81xx_evm_ops,
     },
    #endif

  • Hi ,

    I met the same problem. Could you give me some clues?

    Thank you!

    BR

    Steven

  • Hi Steven,

          I haven't faced the problem but I saw that   is making progress with it, maybe you can get some good comments from him;)

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/246455/1193254.aspx#1193254

    -David

  • Hello,

    I have the same issue.
    Did anyone reolve it.
    Can you give a hint ?

    Thanks,
    Ran
  • Hi Ran,

    Please upgrade the ASOC driver in kernel version v2.6.37 to newer...

    Refer to the following link for more information

    DVRRDK kernel git repository: arago-project.org/.../
    ASoC related patchs: http://opensource.wolfsonmicro.com/cgi-bin/gitweb.cgi?p=linux-2.6-asoc.git;a=summary

    The related patch is ASoc-Add-optional-name_prefix-for-codec-kcontrol.patch

    Thanks

  • Hi Steven,


    Thank you very much !
    I currently have 2 devices in same card.
    I thought that if I seperate each to have its own card, it might also resolve this issue.
    What do you think of it as an alternative ? Will using 2 cards each with one device can reolve this problem ?

    Thank you very much!
    Ran
  • Hi Ran,
    Hi Ran,
    Yes, I think it will be resolve to seperate each to have its own card. but I dont tried...
    There are three codecs in one card in my usecase.
    Add name_prefix for codec kcontrol patch solve the kcontrol failed issue.

    BR,
    Steven
  • Hi Stevens,

    Can you please share the /sound/soc/davince/ti81xx-evm.c that you changed according to patch ?

    Thanks,
    Ran