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.

sound cards (ALSA)

Guru 20755 points
Other Parts Discussed in Thread: TVP5158

Hello,

I am using 2 MCASP ports with DM8148, each has its own codec, and each mcasp has 2 channels (and each channel playback and capture).

I would like to ask about the configuration of sound card , do I need to configure 2 different cars as following:


static struct snd_soc_card ti81xx_evm_snd_card0 = {
.name = "TI81XX SOUND0",
.dai_link = ti81xx_mcasp_dai_1,
.num_links = ARRAY_SIZE(ti81xx_mcasp_dai),
};


static struct snd_soc_card ti81xx_evm_snd_card1 = {
.name = "TI81XX SOUND1",
.dai_link = ti81xx_mcasp_dai_2,
.num_links = 1,
};

So that each ti81xx_mcasp_dai_x (1,2) each has only one codec defintion such as:

static struct snd_soc_dai_link ti81xx_mcasp_dai[] = {
{
.name = "TVP5158AUDIO",
.stream_name = "TVP-PCM",
.cpu_dai_name= "davinci-mcasp.0",
.codec_dai_name = "tvp5158-hifi",
.platform_name ="davinci-pcm-audio",
.codec_name = "tvp5158-audio",
.ops = &ti81xx_evm_ops,
}}

OR is it that I need to configure one sound card with 1 ti81xx_mcasp_dai array which contain 2 codecs ?

I am not which of the above configuration is suitable in my case.

 

Thank you!

Ran

  • Ran,

    Please explore TI814x DVR RDK approach, it seems to me we have there two McASP instances (McASP0 and McASP2) with two different audio codecs (TVP5158 and TLV320AIC3x):

    linux-dvr-rdk-kernel/sound/soc/davinci/ti81xx-evm.c

    static struct snd_soc_card ti81xx_evm_snd_card0 = {
    .name = "TI81XX SOUND0",
    .dai_link = ti81xx_mcasp_dai,
    .num_links = ARRAY_SIZE(ti81xx_mcasp_dai),
    };

    static struct snd_soc_dai_link ti81xx_mcasp_dai[] = {
    {
    .name = "TVP5158AUDIO",
    .stream_name = "TVP-PCM",
    .cpu_dai_name= "davinci-mcasp.0",
    .codec_dai_name = "tvp5158-hifi",
    .platform_name ="davinci-pcm-audio",
    .codec_name = "tvp5158-audio",
    .ops = &ti81xx_evm_ops,
    },
    {
    .name = "TLV320AIC3X",
    .stream_name = "AIC3X",
    #if defined(CONFIG_MACH_TI810XEVM) || defined(CONFIG_MACH_TI810XDVR)|| defined (CONFIG_MACH_UD8107_DVR)
    .cpu_dai_name= "davinci-mcasp.1",
    #else
    .cpu_dai_name= "davinci-mcasp.2",
    #endif
    .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,
    },
    };


    See also if the below e2e threads will be in help:

    e2e.ti.com/.../261414
    e2e.ti.com/.../812458

    BR
    Pavel

  • Ran Shalit said:
    OR is it that I need to configure one sound card with 1 ti81xx_mcasp_dai array which contain 2 codecs ?

    This is the approach used in DVR RDK, as you can see from the source code.

    BR
    Pavel

  • Hi,

    Thanks,
    I think that in this approach there is 1 sound care which have 2 devices in it,

    Regards,
    Ran
  • Ran,

    Yes, we have one sound card (card0).

    In order to have multiple McASPs working...

    If everything is fine, on kernel bootup you should see multiple sub-devices for the sound card.

    Note that DM81xx HDMI audio codec is mapped also in card0, same as McASP2 audio codec:

    root@dm814x-evm:~# aplay -l

    **** List of PLAYBACK Hardware Devices ****

    card 0: EVM [TI81XX EVM], device 0: AIC3X tlv320aic3x-hifi-0 []

    Subdevices: 1/1

    Subdevice #0: subdevice #0

    card 0: EVM [TI81XX EVM], device 1: hdmi HDMI-DAI-CODEC-1 []

    Subdevices: 1/1

    Subdevice #0: subdevice #0

    BR
    Pavel

  • Hi Pavel,

    Thank you,

    I have an issue when using the 2 devices on the same card, but my case is different bacuase I use exactly the same codec.

    I get error on alsa controls.

    I have posted it here:

    Regards,

    Ran