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.

J5-Eco EVM: Audio Data routing from MCASP0(I2S 16/24-bit ) to MCASP1 (TDM 32-bit)

Hi ,


I want to receive the I2S 16/24-bit data over MCASP0(Input-Receive) and route it directly to MCASP1(Output-Transmit) in TDM (32-bit =24bit+8-bit padding) format

How can i proceed with this ? I need to run this continuously for pushing audio samples from MCASP0 to MCASP1.

Whether code should be running in kernel space or user space?

Please, help me in this regard.

  • Hello Manju,

    Such data routing between McASP modules is possible. See the typical block diagram:

    To realize your use case you must apply changes in kernel space in other words in McASP driver.  

    McASP interface capabilities are exposed via struct snd_soc_dai_driver in the CPU DAI driver. McASP driver is located in file davinci-mcasp.c

    See structure: 

    static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
    {
    .name = "davinci-mcasp.0",
    .probe = davinci_mcasp_dai_probe,
    .suspend = davinci_mcasp_suspend,
    .resume = davinci_mcasp_resume,
    .playback = {
    .channels_min = 1,
    .channels_max = 32 * 16,
    .rates = DAVINCI_MCASP_RATES,
    .formats = DAVINCI_MCASP_PCM_FMTS,
    },
    .capture = {
    .channels_min = 1,
    .channels_max = 32 * 16,
    .rates = DAVINCI_MCASP_RATES,
    .formats = DAVINCI_MCASP_PCM_FMTS,
    },
    .ops = &davinci_mcasp_dai_ops,

    .symmetric_samplebits = 1,
    },
    {
    .name = "davinci-mcasp.1",
    .probe = davinci_mcasp_dai_probe,
    .playback = {
    .channels_min = 1,
    .channels_max = 384,
    .rates = DAVINCI_MCASP_RATES,
    .formats = DAVINCI_MCASP_PCM_FMTS,
    },
    .ops = &davinci_mcasp_dai_ops,
    },

    };

    See the current alignment in McASP driver:

    The driver exposes two entries: one for I2S/TDM mode named “davinci-mcasp.0” and one for DIT/SPDIF mode named “davinci-mcasp.1”. These two entries actually refer to the same interface so only one can be used at a time. 

    You must change McASP1 mode to TDM in kernel space.

    Best regards,

    Yanko

  • Dear Yanko,


    With respect to your below saying:

    The driver exposes two entries: one for I2S/TDM mode named “davinci-mcasp.0” and one for DIT/SPDIF mode named “davinci-mcasp.1”. These two entries actually refer to the same interface so only one can be used at a time.


    So when i wan't to read from MCASP0 and i need to forward immediatley to MCASP1, then only i can read from “davinci-mcasp.0” and store and then write on to “davinci-mcasp.1”.This adds latency for recieving and transmission.