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.

Giving Audio Input on TDA2x

Other Parts Discussed in Thread: SYSBIOS

Hello Everyone,

My project demands me to play an audio given as input in a particular condition

Here are few queries:

1. Which input format is required to give audio as input

2. Is it possible to give input from SD card (if not from where the input should be given??)

3. If raw data is to be passed, there will be some memory issues, since I have decently large audio files... Any comments on this???

I have never worked on audios with TI platforms.

Any Suggestions/solutions are appreciated...!!!

  • There are MIC IN and OUT ports on EVM, These can be used to feed / output audio.

    Also look at mcasp example in starterware ti_components\drivers\starterware\starterware_\examples\mcasp
    More info in ti_components\drivers\starterware\starterware_\docs\StarterWare_UserGuide.pdf
  • Hi Yogesh,

    Thanks for your quick reply...

    I think I was not clear in the above question...
    Actually I have some recorded audios which I am suppose to play, my 2nd question is with respect to this,
    How should I give these audios???
    As far as I understand MIC IN wont be useful in this case??? Correct me if I'm wrong
  • I still think MIC IN is sufficient. You need a player/converter that can give input using MIC IN.

  • Hi All,

    I am using TDA2x. I want to open and play mp3 file through my code.
    How do I play mp3 file in Vision SDK?

    Regards,
    Mrunali
  • Hi Mrunali,

    To play out a tone in VisionSDK, please follow steps below.

    1. Write a algPlugin/Link to play out LPCM via McASP/AIC (refer starterware/bsp examples to use McASP/AIC)
    2. Use LPCM audio file, instead of MP3 (windows based tool should be available to convert MP3 to LPCM)
    3. Use NullSrc Link to send LPCM to audio Link/plugin you have written

    Regards,
    Sujith
  • Hi Sujith,

    Thanks for your quick reply.
    My current flow is:
    i. I am capturing frame from the camera.
    ii. I have an algplugin which performs some operation. In between of the operation, if certain condition is "TRUE", I have to play the video and continue my rest of the operations.
    For example: Consider my operation is to detect Face.
    If my face is detected I have to play the audio "Face detected". After the video is played I need to draw bounding box across the face to show the detected face.
    iii. I have to display the frame with the bounding box.

    So basically, I have to open and play the video file in between of my operation. So creating a separate AlgPlugin is not possible.
    Also I am using Capture_Link, so using NullScr Link is not possible in my case.

    As in linux, I have a system call which opens the file and plays its.
    " system("play ../../input/Audio.mp3"); "
    Do we have such function in vision SDK?

    Regards,
    Mrunali
  • Hi Mrunali,

    You could probably consider infoAdas, which is Linux based and can support Audio Play back on A15. If you using sysBios VisionSDK, to play mp3, first you will have to first decode it. VisionSDK dosen't support this.

    The Capture_Link & NullSrc can co-exit, but might not be suitable in your usecase.

    However, you could still have a link/Algplugin which waits for a command from your Algo Link, once it receives it, it can play out a tone via McASP. Note that this plugin will store LPCM for "sounds" that you require (MP3->LPCM->Array of values) Based on the command received you could play out different sounds.

    After step ii (in your steps), the faceDetect sends out a command to this plugin (ToneOut), ToneOutPlugin would play out "Face Detected" 1 or more times as required.

    Regards,Sujith

  • Hi Sujith,

    Is it possible to call one Algplugin from another Algplugin and can return back to first AlgPlugin?
    For eg. I can make a call for ToneOutPlugin from my FaceDetectionPlugin. And once the tone is played I will be returning back to my FaceDetectionPlugin?

    If so, then how do I implement this framework?
    Is it like the below?
    Caputre -> FaceDetectionPlugin -> ToneOutPlugin -> Display

    My ToneOutPlugin will be called only if certain criterion is fulfilled i. e only if my face is detected.
    And which API should I use to play the Tone?

    Regards,
    Mrunali
  • Hi Mrunali,

    The whole purpose of having a link/plugin will negated.

    Please implement FaceDetect Plugin with 2 output queues, First output queue, used to send frames/other data used to draw the rectangle.

    The second queue, connects to ToneOut Plugin. Once a face is detected, send a frame / metadata to ToneOut.

    The ToneOut Plugin, waits for data/meta data on its input queue. Plays out selected tone, once data/meta is received.

    Hope this help.

    Regards,

    Sujith

  • Hi Sujith,

    Thanks for your reply.
    I am unable to find mcasp_sinetone_app_c66x_release.xe66 binary so i am trying to compile starterware standalone. can you please point me to appropriate doc for compiling starterware examples..


    Regards,
    Mrunali
  • Hi Mrunali,

    There is BSP example to play-out audio, please check bspdrivers_\examples\audio\sinetone\src\
    please build bsp_examples_audio in BSP.
    If your questions are addressed, please mark this thread as "answered"

    Regards,
    Sujith
  • Hi Sujith,


    Thanks for your guidance. I was able to play the BSP audio sine tone example.

    I was understanding the code, I found that they have just called "BIOS_start()" function in the main().

    So for eg: if I want to play sine tone in my Face Detection plugin should I call the same function "BIOS_start()"? Or there is another API?

    Regards,

    Mrunali

  • Hi Mrunali,

    Good to hear, that you are able to play out a tone.

    BIOS_start () is a sysBios OS call, with this call, the control is transferred to the scheduler. In case of VisionSDK and plugin/Link context, you should not call it.

    Regards,

    Sujith

    P.S. If your query is addressed, please mark the thread as answered

  • Hi Sujith,

    If I can't call BIOS_start() since I am using vision sdk, then which API should I call to play the tune in my plugin?

    Regards,
    Mrunali
  • Hi Mrunali,

    To play, you will have to call GIO_issue, please refer \ti_components\drivers\vayu_drivers\bspdrivers_\examples\audio\sinetone\src\mcaspSample_io.c function Audio_echo_Task() & prime ().

    Regards,
    Sujith
  • Hi Sujith,

    I'm getting some errors regarding GIO function.

     undefined                         first referenced
      symbol                               in file
     ---------                         ----------------
     ti_sysbios_io_GIO_Params__init__S C:/Ti/vision_sdk/binaries/lib/tda2xx-evm/66/release/vision_sdk_alg_plugins.ae66<AudioDM_Wrapper.oe66>
     ti_sysbios_io_GIO_create          C:/Ti/vision_sdk/binaries/lib/tda2xx-evm/66/release/vision_sdk_alg_plugins.ae66<AudioDM_Wrapper.oe66>
     ti_sysbios_io_GIO_issue__E        C:/Ti/vision_sdk/binaries/lib/tda2xx-evm/66/release/vision_sdk_alg_plugins.ae66<AudioDM_Wrapper.oe66>
     ti_sysbios_io_GIO_reclaim__E      C:/Ti/vision_sdk/binaries/lib/tda2xx-evm/66/release/vision_sdk_alg_plugins.ae66<AudioDM_Wrapper.oe66>
     ti_sysbios_io_GIO_submit__E       C:/Ti/vision_sdk/binaries/lib/tda2xx-evm/66/release/vision_sdk_alg_plugins.ae66<AudioDM_Wrapper.oe66>

    I have included the file GIO.h

    Regards,

    Mrunali

  • Hi Sujith,

    My GIO.h file is getting compiled, but the GIO.cpp file is not getting compiled.
    How to compile GIO.cpp file?

    Regards,
    Mrunali
  • Hi Mrunali,

    You would require to include GIO & McASP of sysBios, below steps list the changes required.

    Regards, Sujith

    1. Include GIO module in DSP
      1. In File Dsp1.cfg \src\main_app\tda2xx\dsp1\Dsp1.cfg (double check the path, i am not sure as to which version of VisionSDK you are using)
      2. How to include GIO module, please refer the \ti_components\drivers\vayu_drivers\bspdrivers_\examples\audio\sinetone\audioSample.cfg search for var GIO
    2. Include McASP (Static creation)
      1. In Dsp1.cfg, add the device, refer \ti_components\drivers\vayu_drivers\bspdrivers_\examples\audio\sinetone\audioSample.cfg for "how to add"
    3. Include your plugin for DSP 1 compilation only
    4. If your AlgPlugin follow McASP sequence as in sineTone demo, everything should be fine.