ALSA
From Texas Instruments Embedded Processors Wiki
Translate this page to
Contents |
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- File:ALSA Scripts logs.zip contains script to test Audio using ALSA utils and logs of script run.
Using amixer
- Command to get the controls that can be modified.
- amixer controls
Sample output of the above command is as follows: # 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' [. . . ] [. . . ]
- Command to get the control contents
- amixer cget numid=X
Example: # amixer cget numid=1 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
- Command to set the control contents
- amixer cset numid=X <Val>
Example: # amixer cset numid=1 110 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
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
# amixer cset numid=56 on # Right Line1R ON # amixer cset numid=57 off # Right Line1L OFF # amixer cset numid=64 on # Left Line1L ON # amixer cset numid=65 off # Left Line1R OFF # amixer cset numid=59 off # Right Mic3L OFF # amixer cset numid=60 off # Right Mic3R OFF # amixer cset numid=67 off # Left Mic3L OFF # amixer cset numid=68 off # Left Mic3R OFF
- Command to set Mic-In as capture source on DM6467 and DM365 EVMs
# amixer cset numid=56 off # Right Line1R OFF # amixer cset numid=57 off # Right Line1L OFF # amixer cset numid=64 off # Left Line1L OFF # amixer cset numid=65 off # Left Line1R OFF # amixer cset numid=59 off # Right Mic3L OFF # amixer cset numid=60 on # Right Mic3R ON # amixer cset numid=67 on # Left Mic3L ON # amixer cset numid=68 off # Left Mic3R OFFLeave a Comment
