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/OMAPL138B-EP: Audio input to output loopback example project for the OMAPL138 evaluation board

Part Number: OMAPL138B-EP
Other Parts Discussed in Thread: OMAPL138, CODECOMPOSER

Tool/software: Code Composer Studio

Hi. 

1. I want to purchase the OMAPL138. Before that, I would like to be able to build a simple project that simply takes each input frame (one by one, no buffers) and output it to the D2A.

Is there such an example project I can use?

2. I am trying to build the mcasp example from the StarterWare. However, I get a build error saying:

"../edma.c", line 117: error: identifier "SOC_EDMA3_NUM_DMACH" is undefined

besides that, this example's code is pretty long and I think it uses buffers ( I want it to be realtime one by one, no buffers are needed).

I think a few lines of code should be enough to redirect the input into the output...

Thanks.

  • the example in Starterware is realtime, the buffers are only setup as the since the EDMA is used in ping pong configuration as described here:

    The redirect form input to output is done using the code

    memcpy((void *)txBufPtr[lastSentTxBuf],
    
                      (void *)rxBufPtr[lastFullRxBuf],
    
                      AUDIO_BUF_SIZE);

    This is the simplest form of MCASP loop back code we have for non-OS developers besides the example here:

     

    Note: The rCSL code was created for OMAPL138 EVM not for OMAPL138 LCDK board so this is only for reference not a ready to use example for the LCDK board.

    How are you building the starterware example, ussing CCS or using make? The parameter is conditionally defined in edma3.h or soc_OMAPL138.h file 

    #if defined(am1808) || defined(omapl138) || defined(c6748)
    #define SOC_EDMA3_NUM_DMACH                 32
    #define SOC_EDMA3_NUM_QDMACH                8
    #define SOC_EDMA3_NUM_PARAMSETS             128
    #define SOC_EDMA3_NUM_EVQUE                 2
    #define SOC_EDMA3_CHMAPEXIST                0
    #define SOC_EDMA3_NUM_REGIONS               4
    #define SOC_EDMA3_MEMPROTECT                0
    #endif

    Please ensure the OMAPL138 macro is defined or if the soc_OMAPL138.h file is included in the build. I don`t see any issues with the CCS build.

    Regards,

    Rahul

    Regards,

    Rahul

  • Hi Rahul, I can't build the example of the MCASP.

    1. Firstly, in the StartWare folder, the authors didn't supply a CodeComposer project file for the example that I can easily open and build. They only supplied .c and .h files.

    So I created a new project and selected the LCDK6748 device. Then I imported the 5 files from ti\C6748_StarterWare_1_20_04_01\examples\lcdkC6748\mcasp to the project, and tried to build.

    It failed, because .h files were missing. Apparently I had to manually add to the include folders of the project all the subfolders of ti\C6748_StarterWare_1_20_04_01\include.

    Then I tried to build again, and it failed. I says a lot of linker errors such as "Unresolved symbol EDMA3ClrIntr...". Feels like there some lib files that we need to add to the project.. Is it explained somewhere?

    Can you attach a zip file with all the files required to run these examples? 

    2. In file mcaspPlayBk.c the buffer is specified to be: #define NUM_SAMPLES_PER_AUDIO_BUF             (2000u)

    I need to process sample by sample. Would it work if I change the buffer size to be 1?

    3. What is the difference between LCDK and EVM? 

  • There are CCS projects for all the examples provided in Starterware.

    the projects can be found under :
    OMAPL138_StarterWare_1_10_03_03\build\c674x\cgt_ccs\omapl138\lcdkOMAPL138

    We would strongly recommend that you use those projects or the makefile based build to build these examples as you may miss out on some settings if you manually create the project and build them. Once you have the projects imported building and verified on the board then you can test modifications of the source code.

    The EVM refers to fully featured Logic PD EVM which also had audio IO capabilities. This EVM is now EOL life and no longer orderable. The major difference from MCASP perspective is that the EVM used different MCASP serializers as compared to the LCDK.


    Regards,
    Rahul

  • Thanks.

    1. We managed to build the project file found at ti\C6748_StarterWare_1_20_04_01\build\c674x\cgt_ccs\c6748\lcdkC6748\mcasp for the C6748 LCDK board.

    2. Is there a simpler way of taking an input signal and send it to the output, as described here for example? (simple polling, instead of ping-pong, etc).

    3. Can you confirm that the maximum samplng rate of the Codec of this board is 96khz? Will it work for us when we process a 40khz ultrasound input signal? (Just verifying that there aren't any low pass filters that will block 40khz sounds)

    Thanks

  • No, if you are referring to the AIC codec then yes, maximum support freqeuncy is 96Khz but the audio examples that we provide usually support 44.1Khz or 48Khz which are the typical sampling rate for audio. We have also tested speech based algorithms with this platform that work with 16Khz sampling rate so there shouldn`t be issues working with 40Khz signal.

    The MCASP example in starterware is fairly strraight forward. It enables FIFO and uses EDMA to move data but if you look at the buffer format, the data is organized as LR, LR, LR,.... data so you can process individual samples directly from the receive buffer and place it in the same format in the output buffer instead of the memcpy implemented for loopback function:

     /* Copy the buffer */
                memcpy((void *)txBufPtr[lastSentTxBuf],
                       (void *)rxBufPtr[lastFullRxBuf],
                       AUDIO_BUF_SIZE);
    

    The AIC codecs don`t have a low pass filter implementation on the input.  There may be a low pass reconstruction filter for to DAC for producing the analog output but it will not filter out the 40Khz signal. Please check the AIC codec datasheet for these details.

    Regards,

    Rahul

    PS: We have simple equalizer implementation using MCASP on another device K2G with AIC3106 which you may want to look at. 

     

  • Hi Rahul,

    We ran the StarterWare examples for audio loopback. We connect a Signal Generator to the input, and a Spectrometer (Audacity) to the output, and it only passes frequencies up to 23-24khz (which is half of 48khz).

    We need to understand what we're missing here.

  • NAdav,

    The sampling rate on the AIC Codec is set to 48Khz so which as per Nyquist frequency for signals at 24Khz so for higher frequency signals, you need to increase the AIC codec sampling rate. for how to set the AIC codec please look at the AIC datasheet and make sure the I2C commands are setting thhe AIC codec correctly.

    Regards,
    Rahul
  • Hi Rahul,

    1. Before I was writing the question I already changed the define value to be:

    #define SAMPLING_RATE                         (96000u) 

    The define is used here:

     AIC31SampleRateConfig(SOC_I2C_0_REGS, AIC31_MODE_BOTH, SAMPLING_RATE);

    It doesn't pass a 24khz+ signal from the input to the output, only lower frequencies.

    Is there something else we need to change to make it work?

    I did an experiment - when I generated a 40khz myself in the code - it went okay to the output, so it feels that maybe the problem is on the input side..

    Need your help.

  • Rahul,
    I apologize.

    Everything works now, it was our configuration problem.
    It passes 40khz with no problem.

    Thanks for the help!