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.

Linux/AM3352: Multi-codec operation with TDM

Part Number: AM3352
Other Parts Discussed in Thread: TLV320AIC3106

Tool/software: Linux

Hi,

We have a design using an AM335x processor and 3 x TLV320AIC3106 codecs interfaced using a McASP in TDM mode. The topology appears to be similar to the multi-codec case described in SPRAC09A (http://www.ti.com/lit/an/sprac09a/sprac09a.pdf.

We have a 4.14.x kernel build and are hoping to use the simple-audio-card driver, however even with the multi-codec additions to ALSA, our analysis is that there are still some limitations to being able to use this, namely:

Single Codec Limitation:

Codec Timeslot Mask Configuration:

  • Even if the proposed support were added, there doesn’t appear to be an agreed way to configure the TDM masks for each of the codecs

Widget, Control and Route Name Conflict:

  • While it appears possible within ALSA to prefix a codec instance with a prefix via codec_conf, it doesn’t appear to have been considered in the proposed support
  • Without the codec prefixing, widget, control and route names of each codec will conflict

Do TI have some recommended approach to support this topology? It would appear that a custom machine driver is required.

SPRAC09A seems to the topology is feasible, however its unclear if a custom machine driver was used. There has been some discussion of using simple-card in recent threads (e.g. https://e2e.ti.com/support/arm/sitara_arm/f/791/p/628563/2324371), has it been extended, or is there ongoing work to extend it?

Alternatively, are there alternate DTS configurations of the topology, e.g. multiple sounds cards or multiple DAI-link definitions sharing the McASP?

Lastly, do you have any recommendation for master assignment in this configuration? Is assigning the first codec as the master a viable configuration, or is it better to assign the CPU as the master?

Regards,

Paul

  • Hi Paul,

    Kernel 4.14 is not tested and verified on AM335x TI boards. I would suggest you to use kernel version that comes with AM335x TI PSDK. The latest one is 4.9.59 and comes with latest PSDK v4.02:

    software-dl.ti.com/.../index_FDS.html


    Regarding multi-codec support, please check if the below e2e threads will be in help:

    e2e.ti.com/.../428765

    e2e.ti.com/.../647495
    e2e.ti.com/.../1666728

    e2e.ti.com/.../148881
    e2e.ti.com/.../154752

    Regards,
    Pavel
  • Hi Pavel,

    Thanks for the quick response and references, I'm in the process of looking through them.

    Re: the Kernel, understood. I have downloaded the PSDK and have had a quick look through.

    I guess one point I'm trying to get immediate feedback on is whether you think it's possible to support this topology by device tree configuration only, or whether custom machine or other drivers are required. My current thinking is we're probably going to have to develop a machine driver (but not other drivers), as even the PSDK simple-card driver doesn't appear have the multi-codec flexibility. Of course there's some finer details, but it would be good to get some general feedback.

    Regards,

    Paul

  • Paul Richards said:
    I guess one point I'm trying to get immediate feedback on is whether you think it's possible to support this topology by device tree configuration only, or whether custom machine or other drivers are required. My current thinking is we're probably going to have to develop a machine driver (but not other drivers), as even the PSDK simple-card driver doesn't appear have the multi-codec flexibility. Of course there's some finer details, but it would be good to get some general feedback.

    I checked the machine driver file (davinci-evm.c in kernel 4.9.59) and I do not see a place where you can update from one AIC3x codec to three AIC3x codecs regarding AM335x device. Thus I think only DTS file should be updated.

    Regards,
    Pavel