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.

Using Audio booster pack wifi demo app example CC3200.

Other Parts Discussed in Thread: CC3200

All,

I have procured Audio booster pack for CC3200.I have connected it as mentioned in the user guide. 
Also i have only 1 CC3200 launchpad.

I have imported the wifi audio app program into my ccs 6.0 workspace.

What changes should i do so that i can use this app as a loopback application i.e playout and capture on the same CC3200.
I dont have multiple boards to test the default example.

Also i see a MACRO called NETWORK defined in the network.c file. Can simply undefining this will do the job?


Also how can i enable the on board mic in the default example.

Regards,
Sreenivasa

  • Hi Sreenivasa,


    To use wifi audio app as a loopback you need to follow following steps:
    1. Undefined NETWORK macro in network.h
    2. Don't create speaker task and network task in main.c
    3. make g_ucMicStartFlag = 1


    By default all three input channels (Onboard mic, line in and mono in) are enable. To enable only one input channel you need to define following macro:
    1. LINE_IN - To enable line in path only
    2. MONO_MIC - To enable mono mic only
    3. ONBOARD_MIC - To enable onboard mic only


    Regards,
    Aashish
  • Aashish,

    Thanks for the response.

    I will check and get back.

    By default all three input channels (Onboard mic, line in and mono in) are enable: Does this mean if there is line in and mono mic connected, the signals from all the three sources will be mixed together?

    Regards,

    Sreenivasa

  • Hi Aaashish,

    BTW this is what i meant by loop back:

    Capture using the onboard-mic or line in or mono mic and play out through the speaker connected to line-out or the headphone connected to line out.

    Did u mean the same? if not can u clarify on that too.


    Regards,
    Sreenivasa
  • Hi Sreenivasa,


    For loopback we are on the same page. And yes by default signal from all three channels will be mixed together.


    Regards,
    Aashish
  • Hi Aashish,
    I verified and the loop back works fine. Captured using on-board or line in and it plays out.
     Thanks

    Regards,
    Sreenivasa

  • Hi Sreenivasa,


    Please walk through Microphone task and pcm_handler.c. We are writing audio data using FillBuffer API, it will copy data from microphone buffer that filled inside the ISR code to speaker buffer that used by ISR code to playback.


    Regards,
    Aashish
  • Hi Aashish,

    I am facing a strange problem.

    I load the wifi demo loop back mode program to CC3200 using CCS and run it in free run mode, things work fine as expected.
    When i terminate the debug session in CCS, the program execution stops on the board.

    If i try to load the same program again ( press F11 or debug ) and then free run , program is not executed as expected.

    The program will execute as expected only if i reset/reboot the CC3200 and load and run it .


    Why can this happen.

    Thanks.

    Regards,
    sreenivasa
  • Hi,

    I am facing a strange problem.

    I load the wifi_audio_demo loop back mode program to CC3200 using CCS and run it in free run mode, things work fine as expected.
    When i terminate the debug session in CCS, the program execution stops on the board.

    If i try to load the same program again ( press F11 or debug ) and then free run , program is not executed as expected.

    The program will execute as expected only if i reset/reboot the CC3200 and load and run it .


    Why can this happen.

    Thanks.

    Regards,
    sreenivasa

  • Hi Sreenivasa,


    You need to reset hardware before every run as it reset the peripherals that not get reset on code load.


    Regards,
    Aashish
  • Aashish,

    Thank you.

    Regards,
    Sreenivasa U.
  • Hi Aashish,

    I have a UDP socket example application program. As i observe this program keeps working even after i stop the debug session.
    Also The program works normally if i load the program again without the need of a reset.

    But i observe the Wifi_audio_Demo application needs a reset before i load the program each time. Also the program stops execution once i stop the debug session.

    Regards,
    Sreenivasa U.
  • Hi Aashish,

    In the wifi audio demo example , the default code configuration is like stereo capture and stereo playout.

    What modifications should i do to ensure only mono capture and playout is happening?

    I am here mentioning the code changes i did for achieving the same in the default wifi audio demo applciation. But i dont achieve the desired result.

    I have tried to disable config and DMA tranfer part for stereo use case. Please let me know if this change is right and suggest if anything else is needed.

    I have modified 2 files. I have enabled a macro called MONO.

    file pcm_handler.c : only " #ifndef MONO" is the added part. so the code iside it is disabled in case of MONO macro enabled.

    "//*****************************************************************************
    //
    //! configuring the DMA transfer
    //!
    //! \param psAudPlayerCtrl is the control structure managing the input data.
    //!
    //! This function
    //! 1. setting the source and the destination for the DMA transfer.
    //! 2. setting the uDMA registers to control actual transfer.
    //!
    //! \return None.
    //
    //*****************************************************************************
    void SetupPingPongDMATransferTx()
    {
    puiTxSrcBuf = AudioCapturerGetDMADataPtr();
    pusTxDestBuf = (unsigned short*)GetWritePtr(pTxBuffer);

    SetupTransfer(UDMA_CH4_I2S_RX,
    UDMA_MODE_PINGPONG,
    CB_TRANSFER_SZ,
    UDMA_SIZE_16,
    UDMA_ARB_8,
    (void *)puiTxSrcBuf,
    UDMA_CHCTL_SRCINC_NONE,
    (void *)pusTxDestBuf,
    UDMA_CHCTL_DSTINC_16);
    #ifndef MONO
    /* second channel in case of stereo audio */
    pusTxDestBuf += CB_TRANSFER_SZ;
    SetupTransfer(UDMA_CH4_I2S_RX|UDMA_ALT_SELECT,
    UDMA_MODE_PINGPONG,
    CB_TRANSFER_SZ,
    UDMA_SIZE_16,
    UDMA_ARB_8,
    (void *)puiTxSrcBuf,
    UDMA_CHCTL_SRCINC_NONE,
    (void *)pusTxDestBuf,
    UDMA_CHCTL_DSTINC_16);
    #endif

    }

    void SetupPingPongDMATransferRx()
    {
    puiRxDestBuf = AudioRendererGetDMADataPtr();
    pusRxSrcBuf = (unsigned short *)GetReadPtr(pRxBuffer);

    SetupTransfer(UDMA_CH5_I2S_TX,
    UDMA_MODE_PINGPONG,
    CB_TRANSFER_SZ,
    UDMA_SIZE_16,
    UDMA_ARB_8,
    (void *)pusRxSrcBuf,
    UDMA_CHCTL_SRCINC_16,
    (void *)puiRxDestBuf,
    UDMA_DST_INC_NONE);
    #ifndef MONO
    pusRxSrcBuf += CB_TRANSFER_SZ;
    guiDMATransferCountRx += CB_TRANSFER_SZ;

    /* second channel in case of stereo audio */
    SetupTransfer(UDMA_CH5_I2S_TX|UDMA_ALT_SELECT,
    UDMA_MODE_PINGPONG,
    CB_TRANSFER_SZ,
    UDMA_SIZE_16,
    UDMA_ARB_8,
    (void *)pusRxSrcBuf,
    UDMA_CHCTL_SRCINC_16,
    (void *)puiRxDestBuf,
    UDMA_DST_INC_NONE);
    #endif

    }
    //*****************************************************************************
    //
    // Close the Doxygen group.
    //! @}
    //
    //*****************************************************************************

    "
    file mcasp_if.c : i have made some portion of the code under " #ifndef MONO " so that they are disabled in mono use case.

    "void McASPInit()
    {

    MAP_PRCMPeripheralClkEnable(PRCM_I2S,PRCM_RUN_MODE_CLK);
    #ifndef MONO
    MAP_PRCMI2SClockFreqSet(512000);// 512000 for stereo
    #else
    MAP_PRCMI2SClockFreqSet(256000);// 256000 for mono
    #endif
    //512000 = 16*2*16000Khz(Num of bytes * STEREO * 16000 sampling)

    }

    void AudioCaptureRendererConfigure()
    {
    #ifndef MONO
    MAP_I2SConfigSetExpClk(I2S_BASE,512000,512000,I2S_SLOT_SIZE_16|
    I2S_PORT_DMA);
    #else
    MAP_I2SConfigSetExpClk(I2S_BASE,256000,256000,I2S_SLOT_SIZE_16|
    I2S_PORT_DMA);
    #endif
    MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_1,I2S_SER_MODE_RX,
    I2S_INACT_LOW_LEVEL);
    MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_0,I2S_SER_MODE_TX,
    I2S_INACT_LOW_LEVEL);

    }
    "







    Regards,
    Sreenivasa
  • Hi all,

    I have been using the wifi audio demo sample application. The sample program has the following configurations set.

    1) Microphone capture is stereo.

    2) playout is also stereo.

    3) sampling rate is 16 KHz.

    I would like to modify the codec configurations to suite

    1) Mono microphone capture.

    2) Mono playout.

    3) 8 KHz sampling rate.

    Please advice me on this.

    Regards,

    Sreenivasa

  • Hi Sreenivasa,


    No need to change SetupPingPongDMATransferRx/Tx code as DMA configuration not depend upon number of audio channels you are using. Only you need to do:
    1. Changes in AudioCaptureRendererConfigure and McASPInit for clock configuratin
    2. Audio codec for mono if supported (Please refer datasheet of codec that you are using).


    Regards,
    Aashish

  • Hi Aashish,

    Thanks for the reply.

    What ever change i posted is not correct. I realized it after posting.

    I am using audio booster pack which is available as a booster pack for CC3200.
    Can u help me in configuring it. Is there any source which explains the register settings for capturing/ playout at desired sampling rate and format ( stereo/ mono ).

    Thanks
    Regards,
    Sreenivasa
  • Hi Sreenivasa,


    At what level do you want to capture/playback mono, at codec level or i2s level. I2S is always have two channels, so it always be stereo.
    For codec configuration please look on respective codec forum.


    Regards,
    Aashish
  • Hi Aashish,

    I will query it in the corresponding codec forum.
    Also i face a problem with the memory setting in the .cmd file.

    This is the snippet form the .map file which is generated after a successful build.
    "
    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    SRAM_CODE 20004000 00022000 0001b20a 00006df6 RW X
    SRAM_DATA 20026000 00018000 00017b99 00000467 RW X
    "

    As you observe there is huge unused space in the SRAM_CODE area.
    But when ever i try to reduce the memory given for code region on the .cmd file, the code build fine. But when i debug it, the program doesnt enter to the main and the resume button stays inactive or greyed out in the eclipse IDE.

    Any advice on this.



    Regards,
    Sreenivasa
  • Hi Aashish

    May I know how I can define marco such as LINE_IN, MONO_MIC and ONBOARD_MIC?

    Thanks

    Heng

  • Hi Heng,


    Define in ti_codec.c or network.h as "#define  LINE_IN   1".


    Regards,
    Aashish

  • Hi Aashish

    Thanks for your prompt respond. I will have a try.

    Heng
  • Hi Aashish

    I have followed the three steps you mentioned before for the loopback application. As I only one LP and one audio boostpack. I want to record the voice using onboard microphone and play it using LINE_OUT.

    1. I changed the NETWORK value from 1 to 0 in network.h file.
    2. I use double slash to comment the speaker and network task in the main.c.
    3. I change the value of g_ucMicStartflag from 0 to 1 in the control.c.

    Then I compile it using Code composer studio and generate new bin file which is then used to flash into my CC3200 LP.

    When I remove the jumper on SOP2 and reset the LP. The green and yellow light D5 and D6 is still on.

    May I know the possible reason causing this?

    Thanks

    Heng
  • Hi Heng,


    J2 and J3 drive these led by default. As you disable network part, they are still on, Is it application not working in loopback mode?


    Regards,
    Aashish
  • Dear Aashish

    I have solved the problem as I did not flash correctly. A new problem occurs as when I connect the LINE IN to the music, and the LINE OUT connect to headphone. I first press the SW3, the green light is always on indicating it is streaming. Then I press the SW2, however, the orange and red light does not come out.

    May I know if the procedure is correct for loop back application?

    Thanks

    Heng
  • Hi Heng,


    You dont need to press SW2/3 as you are setting g_ucMicStartflag value to 1. As soon as application come up it will start recording audio from LINE_IN and playing back to LINE_OUT.


    Regards,
    Aashish
  • Dear Aashish

    I have followed what you said. I reset the CC LP, all three LEDs are switched off. However, there is no voice coming out from the LINE_OUT.

    Plz help me to find the problem. Much thanks.

    Heng

  • Hi Heng,


    Please download latest SDK 1.1.0. In latest SDK loopback enable by default.


    Regards,
    Aashish
  • Hi Aashish

    Thanks for that

    Heng
  • Hi Aashish

    Sorry to trouble you again. As I want to achieve the requirement that I just want to record a certain length of audio from source and playback it repeatably. May I know what information I should change in the C file?

    Thanks

    Heng
  • HI Heng,


    You need to redesign application as per your need.


    Regards,
    Aashish
  • Hi Aashish

    Ok. May I know where the music store ? Is it inside the DMA buffer in binary form?

    And what the "CreateCircularBuffer" function for ?Is it a process to store data from the beginning while remove data from the end as a circular?
    So for my case, I know need to store a certain length of music, so i do not need the circular buffer but a fixed length buffer is necessary?

    Thanks

    Heng
  • Hi Heng,

    HENG MA said:
    May I know where the music store ? Is it inside the DMA buffer in binary form?

    DMA transfer data from codec to circular buffer. So data sotred in circular buffer

    HENG MA said:
    And what the "CreateCircularBuffer" function for ?Is it a process to store data from the beginning while remove data from the end as a circular?

    Yes

    HENG MA said:
    So for my case, I know need to store a certain length of music, so i do not need the circular buffer but a fixed length buffer is necessary?

    Depend upon your requirement. But you need to modify the DMA handler code to use your fixed buffer.

    Regards,

    Aashish