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.

AM335X两路McASP支持两个一样的codec

Other Parts Discussed in Thread: TLV320AIC3104

McASP0、I2C0上挂了一路tlv320aic3104,McASP1、I2C1上挂了一路同样的tlv320aic3104,McASP0_init、McASP1_init 配置正确,i2c_init也修改过了,

除此之外就是修改sound/soc/davinci/davinci-evm.c,这个文件应该怎么修改?

static struct snd_soc_dai_link am335x_evm_dai[] = {
{
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
.cpu_dai_name = "davinci-mcasp.0",
.codec_dai_name = "tlv320aic3x-hifi",
.codec_name = "tlv320aic3x-codec.1-0018",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &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 = evm_aic3x_init,
.ops = &evm_ops,
},
};

如上修改肯定是不行的,大家来指点一下如何修改?除此之外,还需要改其他文件吗?

  • 主要是使能MCASP1的配置。首先要配置PINMUX,然后是PRCM中时钟树对应的MCASP1的相关配置,然后再是模块内部的这些配置。

  • 这些都配好了,单独测试McASP0上的codec和McASP1上的codec播放都很正常,就是不知道怎么样同时支持两个声卡

  • 如果2个codec的驱动程序都能正常工作了,那么同时工作就是应用程序如何调用的问题了

  • 是我没有把问题描述清楚,如果像我贴出来的代码一样修改的话,内核会报错。系统起来之后,一个声卡设备也看不到。如果代码修改正确的话,应该会看到两个声卡设备。我觉得是那个dai_link没有配对,不知道怎么配

  • 你有没有在驱动层把2个MCASP都初始化一下呢。

  • 都初始化过了,我觉得是不是dai_link的name、stream或者codec重名了?

  • Linux上的音频驱动程序都是遵循ALSA架构编写的,ALSA本身是比较复杂的,你可以去CSDN上搜索下应用笔记。

  • 现在已经可以支持两个声卡同时播放声音了,但还是有如下错误:

    tlv320aic3x-codec 2-0018: tlv320aic3x-codec.2-0018: Failed to add PCM Playback Volume: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Right HPCOM Mixer Line2L Bypass Switch: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Left HPCOM Mixer Line2L Bypass Switch: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Right HP Mixer Line2L Bypass Switch: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Left HP Mixer Line2L Bypass Switch: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Mono Mixer Line2L Bypass Switch: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Right Line Mixer Line2L Bypass Switch: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Left Line Mixer Line2L Bypass Switch: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Right Line2R Mux: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Right Line1R Mux: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Right Line1L Mux: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Right PGA Mixer Line1R Switch: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Left Line2L Mux: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Left Line1R Mux: -16
    usb 1-1: device descriptor read/64, error -71
    tlv320aic3x-codec 1-0018: failed to add kcontrol Left Line1L Mux: -16
    tlv320aic3x-codec 1-0018: asoc: failed to add dapm kcontrol Left PGA Mixer Line1L Switch: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Right HPCOM Mux: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Right DAC Mux: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Left HPCOM Mux: -16
    tlv320aic3x-codec 1-0018: failed to add kcontrol Left DAC Mux: -16
    asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok
    asoc: tlv320aic3x-hifi <-> davinci-mcasp.1 mapping ok
    ALSA device list:
    #0: AM335X EVM

    我在网上搜了一下,有人也出过类似的问题,但是没有解决方案,强烈请求支持一下啊!!!