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.

CCS/TMS320C5515: writing data of codec audio to sd card whitout lost samples.

Part Number: TMS320C5515


Tool/software: Code Composer Studio

Hi,

I try to writing data of codec audio to sd card whitout lost samples. for this finish I use  example of library:

- CSL_MMCSD_SdCardFSExtExample 

combinate this project whit the input audio codec, I get a file whit sample adquired to audio codec, but the problem his the lost of sample while DSP write in sd. readind the forum i see that i should to use DMA ping pong mode to dont lost samples. in this point and using how reference the example CSL_MMCSD_PingPongExample dont get a file whitout lost samples.

the question is exist  any project for dataloggind data in sd card?.

Thanks.

  • Hi,

    I've notified the C5000 team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • Daniel,
    What is your audio sampling rate?
    Have you explored all the other examples in C:\ti\c55_lp\c55_csl_3.07\ccs_v6.x_examples\mmc_sd ?
    I foudn it a bit difficult to understand from reading your post, but you tried to make a pinpong based example, but you were still seeing list samples?

    Lali
  • The sampling frequency is 8000Hz. 
    Look at the other MMCSD projects but many of them do not allow me to read data later on a computer because I do not generate a file.
    That's why I chose this project (csl_mmcsd_atafs_ext_example) although I'm not sure if it's the right one.
    my code first read aic3204 and after write to file:

    for(n=0;n<30;n++)
    {

        for(index = 0; index < CSL_MMCSD_ATA_BUF_SIZE; index++)
         {
           aic3204_codec_read(&left_input, &right_input); //read aic3204
           mono_input = stereo_to_mono(left_input, right_input);
           gMmcWriteBuf[index] =mono_input+32768;

          }

    /* Write data to the file */
    ATA_seek (pAtaFile, n*CSL_MMCSD_ATA_BUF_SIZE);
    ata_error = ATA_write(pAtaFile, gMmcWriteBuf, CSL_MMCSD_ATA_BUF_SIZE);//write file block data


    printf("FIN\n");
    ATA_close(pAtaFile);

    The result of acquiring a 1000Hz sinusoidal signal is:

    The signal has discontinuities and this is the problem.While writing in file lost samples.(yellow).The loss of samples is every 256 samples, the size of the buffer.
    Looking at the forum people comment that it would be convenient to use the DMA ping pong mode to avoid losing samples, but I am lost in the DMA configuration and implements in my code.
    I need help or suggestion of how to acquire data without losing samples while writing to file.
    Thanks.
  • Daniel,

    Please see the application note www.ti.com/.../sprac51.pdf
    The code is located at git.ti.com/.../master

    This example uses ping pong DMA on the C5515 and should show you a clear implementation of this technique which would be the best approach to avoiding your lost samples. Please keep in mind that this example is taking audio samples from I2S, not a codec, but the method should be the same.

    You will obviously have to dissect the code and use the DMA specific parts you will need. Hope this helps you out.
    Lali