Omapl137 linux audio driver

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

Agenda

Block diagram - DSK board and Audio daughter card

Ti dA830 evm.jpg.JPG

Audio features - DSK board


Audio features - Audio daughter card

The following audio components are present on the daughter card:


Driver architecture

Supports ALSA (Advanced Linux Sound Architecture) architecture.


Build Configuration - DSK board

The default config file (da830_omapl137_defconfig) configures the audio for DSK board.

- Configuring audio for the dsk board through menu config.

Device Drivers -> sound --->
<*> Sound card support
Advanced Linux Sound Architecture  --->
   <*> Advanced Linux Sound Architecture
   System on Chip audio support --->
      <*> ALSA for SoC audio support
      [ ] DA830/OMAP-L137 McASP0 control by ARM
      [*] DA830/OMAP-L137 McASP1 control by ARM
      [ ] DA830/OMAP-L137 McASP2 control by ARM
      DA830/OMAP-L137 EVM: Codec To Use (AIC3106 (on EVM Board))  --->
      (X) AIC3106 (on EVM Board)


Build Configuration - Audio daughter card

The Menu Config shown will enable the following features:

Device Drivers -> sound --->
<*> Sound card support
Advanced Linux Sound Architecture  --->
   <*> Advanced Linux Sound Architecture
   System on Chip audio support --->
      <*> ALSA for SoC audio support
      [*] DA830/OMAP-L137 McASP0 control by ARM
      [*] DA830/OMAP-L137 McASP1 control by ARM
      [*] DA830/OMAP-L137 McASP2 control by ARM
      DA830/OMAP-L137 EVM: Codec To Use (AIC3106 (on EVM Board))  --->
      (X) AK4588 (on daughter Board)


ALSA Utils


arecord

arecord utility is used to record the audio through the audio capture devices.

- arecord option '-l' is used to list audio capture devices on board:

# arecord -l
**** List of CAPTURE Hardware Devices ****
arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: EVM [DA8XX EVM], device 0: AIC3X aic3x-I2S-0 [aic3x-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Description of above log:



arecord (2)

The following command records the stereo audio through AIC3106 device.

# arecord -D 'hw:0,0' -r 48000 -f S16_LE -c 2  song.dat

Description of the command:

D = Device id (Represented with 'hw: <cardId,deviceId>') 
r = Sampling rate
f = data format
c = number of channels


aplay

arecord utility is used to playback the audio through the audio playback devices.

- aplay option used to list audio capture devices on board:

# aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: EVM [DA8XX EVM], device 0: AIC3X aic3x-I2S-0 [aic3x-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Description of above log:



aplay (2)

The following command plays back the stereo audio through AIC3106 device.

# aplay -D 'hw:0,0' -r 48000 -f S16_LE -c 2  song.dat

(or)

# aplay -D 'hw:0,0' -c 2  song.dat

Description of the command:
D = Device id (Represented with 'hw: <cardId,deviceId>')
r = Sampling rate
f = data format
c = number of channels


Record and play back simultaneously

The data recorded through arecord command is piped to the aplay.

# arecord -D 'hw:0,0' -r 48000 -f S16_LE -c 2 | aplay -D 'hw:0,0' -c 2

(or)

Give arecord command to record data to the song.raw file and make it as back ground task and give aplay comamnd to play back the data from the same file.

# arecord -D 'hw:0,0' -r 48000 -f S16_LE -c 2 song.raw &
# aplay -D 'hw:0,0' -c 2 song.raw

</font>


amixer

amixer controls the mixer for the audio driver. It controls volume, channels, etc

- amixer help command

amixer -help

Usage: amixer <options> [command]

Available options:
  -h,--help       this help
  -c,--card N     select the card
  -D,--device N   select the device, default 'default'
  ..

Available commands:
  scontrols       show all mixer simple controls
  scontents       show contents of all mixer simple controls (default command)
  controls        show all controls for given card
  contents        show contents of all controls for given card
  ..


amixer (2)

amixer -controls: This option lists the handles (numid) to control enabling of different channels and their volume.

- Log displaying the numids for multichannel capture and display channels.

# amixer -controls
numid=1,iface=MIXER,name='PCM Playback Volume'
...


amixer - Controlling the volume

amixer cset numid=1 127, 0  /* Mute the right channel */
amixer cset numid=1 0, 127  /* Mute the left channel  */
amixer cset numid=1 0, 0    /* Mute both the channels */
amixer cget numid=1         /* Get the volume of the channels */


SPDIF - Record

The audio daughter card supports SPDIF record.

- Procedure to do SPDIF record

# arecord -l /* List all the audio capture devices */
  **** List of CAPTURE Hardware Devices ****
  card 0: EVM [DA8xx EVM], device 0: DIR DIR-I2S-0 [DIR-0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 0: EVM [DA8xx EVM], device 1: AK4xxx ak4xxx-I2S-1 [ak4xxx-1]
    Subdevices: 1/1
    Subdevice #0: subdevice #

# arecord -D 'hw:0,0' -r 48000 -f S16_LE -c 2 song.raw /* Record through the selected device */


SPDIF - Playback

The audio daughter card supports SPDIF playback.

- Procedure to play SPDIF data

# aplay -l /* List all the audio playback devices */
  **** List of PLAYBACK Hardware Devices ****
  card 0: EVM [DA8xx EVM], device 1: AK4xxx ak4xxx-I2S-1 [ak4xxx-1] <br>
    Subdevices: 1/1 <br>
    Subdevice #0: subdevice #0 <br>
  card 0: EVM [DA8xx EVM], device 2: DIT DIT-I2S-2 [DIT-2] <br>
    Subdevices: 1/1 <br>
    Subdevice #0: subdevice # <br>

/* Playback through the selected device */  
#  aplay -D 'hw:0,2' -c 2 song.raw 

- Simultaneous: Record through SPDIF DIR and playback through SPDIF DIT

# arecord -D 'hw:0,0' -r 48000 -f S16_LE -c 2 | aplay -D 'hw:0,2' -c 2


References

E2e.jpg For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Omapl137 linux audio driver here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox