"sai_dma_demo" application in MQX_4_1 shows different frame sync frequency for read and write

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"sai_dma_demo" application in MQX_4_1 shows different frame sync frequency for read and write

285 Views
ajitsj
Contributor I

We are trying to build an application for SAI DMA with 8Khz sampling frequency and 16 bits per sample.

We are working with the example project "sai_dma_demo" project in the location Freescale_MQX_4_1\mqx\examples\sai_dma_demo.

We were able to see the transmit working fine

Also we noted that in the Shell_play function the "sai:" device is being opened with the open type as "NULL"

/* Open audio device and set it up */

    if ((device_ptr = fopen(argv[1], NULL)) == NULL)

    {

        printf("  Error: Unable to open a device \"%s\".\n", argv[1]);

        fclose(file_ptr);

        return (SHELL_EXIT_ERROR);

    }

We are observing a frequency of approximately 8Khz for frame sync while we are trying to send the data.

But for the receive path that is in the Shell_record function it is opened with open type as "r"

/* Prepare device */

   if ((device_ptr = fopen(argv[1], "r")) == NULL)

    {

        printf("  Error: Unable to open device \"%s\".\n", argv[1]);

        fclose(file_ptr);

        return (SHELL_EXIT_ERROR);

    }

We are observing a frequency of approximately 120Khz for frame sync while we are trying to receive the data.

Note: I have disabled the sgtl500 codec configurations. As I need to interface K60 with my DSP. I just need to write/read data from DSP.

Due to this we are not able to receive any data from the other DSP device over the I2S port.

Please help us resolving this problem. Please suggest any changes that I need to do in the example code to receive at a sample frequency of 8KHz.

We also used the I2S_demo sample application. Even it showed the same behavior.

0 Kudos
0 Replies