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.

A DSP/BIOS based McASP driver question?

Can somebody answer this:

 

As introduced by "BIOSPSP_McASP_Driver_Design", after calling Mcasp_Open() with DMA driven or not,  can I call Mcasp_Submit() to send data stream right away, or I should call Mcasp_Control() with Mcasp_IOCTL_START_PORT to start the state machine first?

And also, the mcasp_Open() has a callback function as argument, what does it do? The Xmt or Rcv channel has their own ISR callbacks already.

Thanks in advance,

Philip

  • Can you tell me what version of the PSP tools you are using?

    And what device you're working on?

  • Hi,

    I am using BIOS based PSP 02_20_00_02 and McASP driver to play audio signals.

     

    Thanks,

    Philip

  • Hi Philip,

    Tianhua Chu said:
    As introduced by "BIOSPSP_McASP_Driver_Design", after calling Mcasp_Open() with DMA driven or not,

    The driver design document only talks about the driver design. Please refer the section 5 of the DM8148_BIOSPSP_Userguide to know the usage of the driver. 

    Note: The McASP driver only works in DMA mode of operation, other modes are not supported.

     

    Tianhua Chu said:
    can I call Mcasp_Submit() to send data stream right away, or I should call Mcasp_Control() with Mcasp_IOCTL_START_PORT to start the state machine first?

       

     No, you can not directly call the Mcasp_open() or any other driver APIs. The driver is designed in such a way, that the application has to make a call to the BIOS 6 stream APIs which in turn will call the driver APIs. Please refer the section 5.10 of the DM8148_BIOSPSP_Userguide for the detailed explaination.

    Also refer the Mcasp sample application provided in the BIOS PSP (in the path pspdrivers_02_20_02_01\packages\ti\psp\examples\evmDM8148\audio).

    Tianhua Chu said:

    And also, the mcasp_Open() has a callback function as argument, what does it do? The Xmt or Rcv channel has their own ISR callbacks already.

     

    Whenever a request (iopacket) comes to the driver from the application through the stream layer, the driver returns back (iopacket) to the stream layer with the help of the call back fuction. This callback function initially provided to the driver when the stream layer makes a call to the Mcasp_open(), which will be initiated by the application by calling the Steam_create(). So the callback function is provided by the stream layer to the driver and it is nothing to do with the application.

    Thanks and Regards,

    Sandeep K

  • Thanks Sandeep for your reply.

    I looked at DM8148_BIOSPSP_Userguide, but still don't find if Mcasp_IOCTL_START_PORT should be issued before Mcasp_Submit() (by Stream_issue()), if I am using DMA.

    In another words, in what kind of cases do I need to issue IO Controls ( Mcasp_IOCTRL_START_PORT/Mcasp_IOCTRL_STOP_PORT)?

     

    Thanks,

    Philip

  • Philip,

    There is no need to use the "Mcasp_IOCTL_START_PORT" at the beginning to start the McASP communication. When one creates the audio channel and prime the buffer (Stream_issue()), the driver starts the I/O and completed buffer will be returned to the stream. Once the stream_reclaim() is invoked in the application, the processed buffer will be returned back to the application.

    If you want to change the certain settings during the runtime (eg: sampling rate ), this can be acieved by using an IOCTL "Audio_IOCTL_SAMPLE_RATE" (which is audio IOCTL.). This in turn will stop the McASP by using the "Mcasp_IOCTL_STOP_PORT" (can be seen in the file \pspdrivers_02_20_00_02\packages\ti\psp\platforms\evmDM8148\audio\src\Audio.c). Once the configuration is done, the "Mcasp_IOCTL_START_PORT" will be used to resume the McASP I/O.

    This is how the START and STOP IOCTL of the McASP is being utilized.

    For more information on the usage of the McASP, please refer the example provided in the PSP 2_20_00_02 [ \pspdrivers_02_20_02_01\packages\ti\psp\examples\evmDM8148\audio ].

    Regards,

    Sandeep K

  • Thanks very much Sandeep that clears my puzzle.