ALSA

About
ALSA - Advanced Linux Sound Architecture ALSA utils contains the command line utilities for the ALSA project.

Visit alsa website for more information and to download source.

Utilities

 * arecord
 * arecord application is used to record the audio coming from audio in line.
 * aplay
 * aplay application is used to play the audio file on to the audio out line.
 * amixer
 * amixer can control the audio (volume, etc)

Execution

 * Command to record to a file.
 * arecord -f cd song.wav
 * Command to playback from a file.
 * aplay -f cd song.wav
 * command to loopback(record and playback)
 * arecord -f cd | aplay -f cd

The zip file- contains script to test Audio using ALSA utils and logs of script run.

Using amixer
Sample output of the above command is as follows:
 * Command to get the controls that can be modified.
 * amixer controls

numid=1,iface=MIXER,name='PCM Playback Volume' numid=2,iface=MIXER,name='Line DAC Playback Volume' numid=5,iface=MIXER,name='LineL DAC Playback Volume' numid=6,iface=MIXER,name='LineL Left PGA Bypass Playback Volume' numid=8,iface=MIXER,name='LineL Line2 Bypass Playback Volume' numid=3,iface=MIXER,name='LineL Playback Switch' numid=9,iface=MIXER,name='LineR Line2 Bypass Playback Volume' numid=4,iface=MIXER,name='LineR Playback Switch' numid=7,iface=MIXER,name='LineR Right PGA Bypass Playback Volume' numid=11,iface=MIXER,name='Mono DAC Playback Switch' numid=10,iface=MIXER,name='Mono DAC Playback Volume' [. . . ] [. . . ]
 * 1) amixer controls

Example:
 * Command to get the control contents
 * amixer cget numid=X

numid=1,iface=MIXER,name='PCM Playback Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0 : values=96,96 | dBscale-min=-63.50dB,step=0.50dB,mute=0
 * 1) amixer cget numid=1

Example:
 * Command to set the control contents
 * amixer cset numid=X 

numid=1,iface=MIXER,name='PCM Playback Volume' ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0 : values=110,110 | dBscale-min=-63.50dB,step=0.50dB,mute=0
 * 1) amixer cset numid=1 110

On DM644x and DM355 EVMs, use the interface No.1 (Name = "PCM Playback Volume") to control the Output Volume and interface No.26 (Name = "PGA Capture Volume") to control the Capture Volume.


 * Command to set Line-In as capture source on DM6467 and DM365 EVMs
 * 1) amixer cset numid=56 on   # Right Line1R ON
 * 2) amixer cset numid=57 off  # Right Line1L OFF
 * 3) amixer cset numid=64 on   # Left Line1L ON
 * 4) amixer cset numid=65 off  # Left Line1R OFF
 * 5) amixer cset numid=59 off  # Right Mic3L  OFF
 * 6) amixer cset numid=60 off  # Right Mic3R  OFF
 * 7) amixer cset numid=67 off  # Left Mic3L  OFF
 * 8) amixer cset numid=68 off  # Left Mic3R  OFF


 * Command to set Mic-In as capture source on DM6467 and DM365 EVMs
 * 1) amixer cset numid=56 off  # Right Line1R OFF
 * 2) amixer cset numid=57 off  # Right Line1L OFF
 * 3) amixer cset numid=64 off  # Left Line1L OFF
 * 4) amixer cset numid=65 off  # Left Line1R OFF
 * 5) amixer cset numid=59 off  # Right Mic3L  OFF
 * 6) amixer cset numid=60 on   # Right Mic3R  ON
 * 7) amixer cset numid=67 on   # Left Mic3L  ON
 * 8) amixer cset numid=68 off  # Left Mic3R  OFF