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.

AudioSample for OMAPL138

Other Parts Discussed in Thread: OMAPL138

Hi All,

I am using omapl138 evm board and trying to run AudioSample provided by psp driver( Version 01_30_01).

My problems are the following:

1  Based on my understanding of this example, the frequency (on LINE OUT) should be the same with that on LINE IN. However, scope shows they are different. (LINE IN matches the input wave, but LINE OUT is a mess).  Also, I noticed that slot width of the Codec is set to 16 bits while the slot size of McASP Channel is set to 32 bits. Is this correct? Could this be the reason for the mess on LINE OUT?

2 I experimented some setting on Codec and McASP. Seems like the AudioSample stopped working with anything I changed.

a) I want to try to set the codec to 32 bits, matches the Mcasp slot size, with the following change in audioSample_main.c.

Void audioUserAic31Init(Void)
{
    Aic31_init();
    audioAic31Params = Aic31_PARAMS;
    audioAic31Params.acCtrlBusName = "/i2c0";
    audioAic31Params.acSlotWidth = ICodec_SlotWidth_32;  <--- this is added to set the slot size of codec.
}

With this change, the output is empty (I could hear anything on the LINEOUT).


b) With a) not working, so I tried to change McASP instead of codec with the following configuration in audioSample_io.c

Mcasp_HwSetupData mcaspRcvSetup = {
        /* .rmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
        /* .rfmt     = */ 0x00008070, /* <---- changed from 0x000080F0 -- from slot size 32 to 16  */
     
        /* .afsrctl  = */ 0x00000000, 
        /* .rtdm     = */ 0x00000001,
        /* .rintctl  = */ 0x00000003,
        /* .rstat    = */ 0x000001FF,
        /* .revtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
        {
             /* .aclkrctl  = */ 0x00000000,
             /* .ahclkrctl = */ 0x00000000,
             /* .rclkchk   = */ 0x00000000
        }
} ;

Mcasp_HwSetupData mcaspXmtSetup = {
        /* .xmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
        /* .xfmt     = */ 0x00008070, /* 
<---- changed from 0x000080F0 -- from slot size 32 to 16  */
        /* .xtdm     = */ 0x00000001, /* slot 1 is active (DSP)               */
        /* .xintctl  = */ 0x00000007, /* sync error,overrun error,clK error   */
        /* .xstat    = */ 0x000001FF, /* reset any existing status bits       */
        /* .xevtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
        {
             /* .aclkxctl  = */ 0x00000000,
             /* .ahclkxctl = */ 0x00000000,
             /* .xclkchk   = */ 0x00000000
        },

};


/* McBsp channel parameters                                  */
Mcasp_ChanParams  mcasp_chanparam[Audio_NUM_CHANS]=
{
    {
        0x0001,                    /* number of serialisers      */
        {Mcasp_SerializerNum_12, }, /* serialiser index           */
        &mcaspRcvSetup,
        TRUE,
        Mcasp_OpMode_TDM,          /* Mode (TDM/DIT)             */
        Mcasp_WordLength_16,       <---- changed, since slot size can NOT be less than word length.
        //Mcasp_WordLength_32,
        NULL,
        0,
        NULL,
        NULL,
        1,                        /* number of TDM channels      */
        //Mcasp_BufferFormat_1SER_MULTISLOT_NON_INTERLEAVED,
        Mcasp_BufferFormat_1SER_1SLOT,
        TRUE,
        TRUE
    },
    {
        0x0001,                   /* number of serialisers       */
        {Mcasp_SerializerNum_11,},
        &mcaspXmtSetup,
        TRUE,
        Mcasp_OpMode_TDM,
        Mcasp_WordLength_16,       
<---- changed, since slot size can NOT be less than word length.
        //Mcasp_WordLength_32,      /* word width                  */
        NULL,
        0,
        NULL,
        NULL,
        1,                        /* number of TDM channels      */
        Mcasp_BufferFormat_1SER_1SLOT,
        TRUE,
        TRUE
    }
};

 

LINEOUT is still nothing with this change. Did I missing something that need to change?

3 How is the buffer size handled? Do I need different buffer size with 32 bits or 16 bits configuration?

 

The tools that I am using:

CCS V4.2.1.00004

BIOS 5_41_10_36

EDMA edma3_lld_01_10_00_01

pspdrivers_01_30_01

 

Any help would be greatly appreciated,

Sarah

  • Hi Sarah,

    Sarah Zhang said:

    1  Based on my understanding of this example, the frequency (on LINE OUT) should be the same with that on LINE IN. However, scope shows they are different. (LINE IN matches the input wave, but LINE OUT is a mess).  Also, I noticed that slot width of the Codec is set to 16 bits while the slot size of McASP Channel is set to 32 bits. Is this correct? Could this be the reason for the mess on LINE OUT?

    Could you please mention how are you measuring the frequency at Line In and Line Out?

    Basically, the BCLK and MCLK (pin 38 and 37 respectively )of AIC31 can be measured, have you measured these pins? if yes, is it according to your configuration?

    Apart from this, are you able to execute the sample application provided with the BIOS PSP? Could you please comment on the result?

    Thanks and Regards,

    Sandeep K

  • Hi,

    Thank you for your reply. I have just found the answer to my question. I am able to execute the sample application provided with PSP. Because the output is a copy of the input (implemented in the code), so I expected the output is the similar wave with the input.  However, they are different measured using scope.  The answer is that channel gain in the example has been set 30. Once it is changed to 100, output is what I expected.

    Also, the Slot width of McASP with one time slot need to the 32 bits because of left/right channel (each 16 bits output from codec).


    Thanks,

    Sarah

  • Hi Sarah,

    Thanks for the update.

    Since the problem is solved, Could you please close the thread?

    Thanks and Regards,

    Sandeep K