Friday, November 16, 2012

Audio System

It is not simple to discuss about audio codec at one page as there are large verity for different purposes and SOC supports. This post is just to trigger one in right direction. Low level understanding is good for architecture such as ARM. For x86, you should directly go to ALSA.

When you are choosing an Audio codec you will be looking for:

Capability -
mono, stereo,  5.1
Number of output lines, number of input lines

Quality -
8kHz to 96kHz ADC audio
8kHz to 96kHz DAC audio
Price -
Depends on above two.

All of above choice depends on the purpose of use such as mobile phone or DOLBI sound system or is it a box for DJ.
You do consider power consumption and signal to noise ratio when you have options.

If we see for media player such as your portable music player or phone, you do consider Capability, you might consider what all are the means of inputs
  • Application/multimedia processor
  • FM
  • Compressed audio codec
  • Bluetooth Modem
Once you have listed your requirement, you are are ready for suitable vendor in market to chose one codec for your self. I will be considering that you are connecting codec direct to application processor and getting raw audio to play.




Have you connected the codec through I2C or SPI (to application processor). You could use UART or I2S, PCI, USB also based on interfaces available through the codec chip or sound card.
You have to write BSP to communicate with the card. Here you will be following datasheet of the product, how to use control lines and passing/getting data to and from the codec to application processor. 
Well, once you have written these codes, now you hare ready to write driver for your kernel. Sound sub-system is already available for you and so you can use API's to develop you application. Alsa good  for Linux and already available in kernel. Just make sure you do proper implementation of your BSP and coupled it with ALSA driver. Now rest is only to play sample app and test it.

Do we need to discuss more on it? There are some good explanation at an introduction to linux audio. Also palying with ALSA utilities, such as alsa mixer, is a good way to learn.

It is good to check official site of driver to get better understanding. 


Links:

No comments:

Post a Comment