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/DRA745: MCASP0 transmits 4 stereos in parallel on 2 data pins

Part Number: DRA745

Tool/software: Linux

Hi experts:

     we uses DRA745 + AK4616 in next project.  we plan to  transmits 4 stereos  in parallel on 2 data pins of McASP0 by TDM mode.

1、How to store these 4 stereo(8 channel, sampling depth is 16 bit) data in the audio buffer?I am referring to what order to store the 8 channels?

(stereo1 leftChannel, stereo2 leftChannel, stereo3 leftChannel, stereo4 leftChannel, stereo1 rightChannel,stereo2 rightChannel,stereo3 rightChannel.......)

or (stereo1 leftChannel, stereo1 rightChannel, stereo2 leftChannel, stereo2 rightChannel,....) ?

2、How to config  McASP0 and DMA?

  • Could you specify how you want to see the samples shifted out in the two data pins?

    In general, if you have you samples stored in the audio buffer in the following order: A B C D E F G H, they will be consumed by the two McASP serializers as follows:
    AXR0 = A C E G
    AXR1 = B D F H

    The McASP node can be configured in your dts file as follows (assuming AXR0 and AXR1 are used for TX):

    &mcasp0 {
    ...
    op-mode = <0>; /* MCASP_IIS_MODE */
    tdm-slots = <4>;
    /* 4 serializer */
    serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
    1 1 0 0
    >;
    }

    Make sure that the number of entries in the "serial-dir" property matches the number of serializers in the particular instance of McASP you want to use. Some instances support 4 serializers, others 16 serializers.

    I have excluded the clock related properties of the McASP node. Please check the TI DRA7 EVM for reference on how to configure it.

    Nothing else needs to be configured for DMA. The driver configures the transfer parameters according to the audio params that you pass from userspace (i.e. aplay -f S16_LE -c 8 ...).