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.

Connecting a device to Sitara McASP port

Hi,

I would like to send audio to a device (such as a PLD) connected to Sitara McASP port .I am using Sitara AM335x.

Do I necessarily need to write a linux device driver for this PLD device? I have read the TI web site example for a DAC connected to Sitara through I2S given in following link: http://processors.wiki.ti.com/index.php/Sitara_Linux_SDK_Audio_DAC_Example

In this link, it is mentioned following: "...There is no existing linux driver written for this device (nor is there really a need for one), but for the purposes of this project, we will create a dummy template driver."

My question is:

Is the McAsp device driver that is already available in the AM335x SDK7 (sound/soc/davinci/davinci-mcasp.c) sufficient to allow an external device (such as my connected PLD) to read the audio data from the McASP port or do I need to add in the kernel a driver for my specific PLD device?

  • When you are interfacing a device to the McASP in linux, there 3 primary areas that you need to consider:

    1. The 'codec' driver: your PLD audio device would fall into this category.  This driver would be responsible for for starting up your device and making sure it is in the right state when certain requests are made through ALSA (such as play back for record at various formats).  You may or may not really need a sophisticated driver for this (as in the case of the Audio DAC example--the driver isn't really doing anything.  It's just a template that has room for you to add functionality for your specific device).  You don't always need a specific device driver for for a device connected to the McASP.  In later versions of the TI kernel, there are in-built "dummy audio" drivers that can be used for generic audio devices that need no special driver; however, in the 3.12 based kernel in SDK 7.0, there wasn't such a driver available, which is why the Audio DAC tutorial makes its own dummy driver.

    2. The platform driver: this is the McASP driver, which is already in place. 

    3. Machine driver: this is where you configure your PLD device to work with the McASP (taking into accounts clocks, audio format, etc)

    So with respect to your PLD, assuming that it will start in a proper state and doesn't depend on a linux driver to configure it, you should be able to get by using the method outlined in the Audio DAC guide.  One thing you need to be sure of is that the McASP linux driver supports whatever format you need.

    More in depth details can be found at the main Sitara Linux Audio page.

  • Thank you very much for the details answer.

    I have another question on Sitara McASP transfer Modes.

    What are the transfer mode supported by McASP? which mode would be suitable to synchronously transfer x numbers of different audio streams from McASP to a connected audio device? 

  • The McASP supports TDM mode for up to 32 channels.  Here is a forum post that demonstrates someone using 6 TDM slots.  The McASP was set to I2S mode with 6 slots (instead of the default 2).

  • Hi,
    In the case of setting up McASP for 6 audio channels, do i have to interleave the 6 audio sources data before sending (the interleaved stream) to the McASP port?
    example:
    If i have 6 mono wav files, should I first interleave them into a 6 channel audio stream before I run aplay on the final interleaved file (aplay -D <sound card> interleaved_6_ch.wav)? Another use case can be with 6 mono capture devices that are capturing audio and we want to send those live 6 audio steams to the 6 channels-audio-codec attached to the McASP.

  • Is anyone can help me with my question above: "Is it needed to interleave multiple audio streams before streaming it to a multichannel codec connected to the McASP port (given that the port is properly configure for the given number of channels)"?

  • You need to interleave the channels first.