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.

ALSA not detecting 3254 codec/ card

Other Parts Discussed in Thread: TLV320AIC3254

Hi

    I am working with the kernel from the IPNC RDK kit. It is a 2.6.37 kernel. Our aim was to get the TLV320AIC3254 Codecs to build into the kernel. The drivers received earlier belonged to an older version Kernel (probably 2.6.32). So we spent some time porting the same file. Then we realized that newer files were available at lxr. These ones belonged to 2.6.39 but were easy to get into the kernel.

On successful build, we booted the kernel to figure that the ALSA detected no sound cards.

So we traced the whole path of the codec instantiation and figured that all the __init functions were executed successfully, in the mentioned order, for the following files:

1)      KERNEL/arch/arm/mach-davinci/ board file

2)      KERNEL/sound/soc/codecs/codec file          -> aic32x4_init()  this is where the i2c_add_driver() call is made

3)      KERNEL/sound/soc/davinci/platform(or say card) file -> evm_init() registers card

 

So how it exactly works during the kernel boot is that the the codecs get registered, then the DAI and finally the card gets registered. Each of them are successful individually but happen to fail in the soc_bind_dai_link() call in the soc-core.c that the ALSA makes to identify instantiated cards.

 

I suspect that the order in which this happens currently may be incorrect (seeing how the core function behaves). Probably the card needs to be registered first (i.e. evm_init() )followed by (aic32x4_init() )the codec and then the DAI to register with the ALSA. The codec and DAI register calls land up calling the snd_soc_instantiate_card() but fail to do so as the card is not available till this point.

 

Please let me know if I am headed in the right direction. There seems no straight methods where I could have the evm_init() execute before aic32x4_init, both being __init functions.

 

Any immediate assistance is duly appreciated.

 

Please let me know if I am headed in the right direction. There seems no straight methods where I could have the evm_init() execute before aic32x4_init, both being __init functions.

 

Any immediate assistance is duly appreciated.

  • An update for the above:

    I was able to change the order to what I wanted to test. So now evm_init executes before the aic32x4_init. But the outcome was still the same.

    I have done a little bit of tracing and now it seems that the platform level 'card' is not getting set in the snd_soc_register_card( )

    So primarily for a sound card to get registered that happens in the snd_soc_instantiate_card( ) [that I was trying to get to work] depends on the card getting registered first.

    Hence the sequence of the init functions do not seem to work.

    Now all of this code being Kernel space I think it probably is just a small link/ structure /flag that I may be missing.

    Please advice.

  • Inputs from Suresh,

        It sounds like string mismatch problem. I observed that some changes in the codec name. I believe the .codec_name should be like "tlv320aic32x4.1-0018" Please let us know if this helps.

     

      Also it will be good to place some prints to see the expected strings inside the failing functions.

     

     

    #ifdef CONFIG_SND_DM365_AIC32x4_CODEC // CONFIG_SND_DM365_AIC3X_CODEC
     .name = "TLV320AIC32X4",/*"TLV320AIC3X", old name ##added*/
     .stream_name = "AIC32x4",/*"AIC3X",##added*/
     .cpu_dai_name = "davinci-mcbsp",
     .codec_dai_name = "tlv320aic32x4-hifi", /*"tlv320aic3x-hifi",*/
     .init = evm_aic3x_init,
     .codec_name = "tlv320aic32x4-codec.1-0018",
     .ops = &evm_ops,
    #elif defined(CONFIG_SND_DM365_VOICE_CODEC)
     .name = "Voice Codec - CQ93VC",
     .stream_name = "CQ93",
     .cpu_dai_name = "davinci-vcif",
     .codec_dai_name = "cq93vc-hifi",
     .codec_name = "cq93vc-codec",
    #endif
     .platform_name = "davinci-pcm-audio",
    };

     Can you please check?

    Best Regards

    Feroz