Blame aplay/arecord.1

Packit 229ac0
.TH APLAY 1 "1 January 2010"
Packit 229ac0
.SH NAME
Packit 229ac0
arecord, aplay \- command\-line sound recorder and player for ALSA 
Packit 229ac0
soundcard driver
Packit 229ac0
.SH SYNOPSIS
Packit 229ac0
\fBarecord\fP [\fIflags\fP] [filename]
Packit 229ac0
.br
Packit 229ac0
\fBaplay\fP [\fIflags\fP] [filename [filename]] ...
Packit 229ac0
Packit 229ac0
.SH DESCRIPTION
Packit 229ac0
\fBarecord\fP is a command\-line soundfile recorder for the ALSA soundcard
Packit 229ac0
driver. It supports several file formats and multiple soundcards with
Packit 229ac0
multiple devices. If recording with interleaved mode samples the file is
Packit 229ac0
automatically split before the 2GB filesize.
Packit 229ac0
Packit 229ac0
\fBaplay\fP is much the same, only it plays instead of recording. For
Packit 229ac0
supported soundfile formats, the sampling rate, bit depth, and so
Packit 229ac0
forth can be automatically determined from the soundfile header.
Packit 229ac0
Packit 229ac0
If filename is not specified, the standard output or input is used. The \fBaplay\fP utility accepts multiple filenames.
Packit 229ac0
Packit 229ac0
.SH OPTIONS
Packit 229ac0
.TP
Packit 229ac0
\fI\-h, \-\-help\fP
Packit 229ac0
Help: show syntax.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-version\fP
Packit 229ac0
Print current version.
Packit 229ac0
.TP
Packit 229ac0
\fI\-l, \-\-list\-devices\fP
Packit 229ac0
List all soundcards and digital audio devices
Packit 229ac0
.TP
Packit 229ac0
\fI\-L, \-\-list\-pcms\fP
Packit 229ac0
List all PCMs defined
Packit 229ac0
.TP
Packit 229ac0
\fI\-D, \-\-device=NAME\fP
Packit 229ac0
Select PCM by name
Packit 229ac0
.TP
Packit 229ac0
\fI\-q \-\-quiet\fP
Packit 229ac0
Quiet mode. Suppress messages (not sound :))
Packit 229ac0
.TP
Packit 229ac0
\fI\-t, \-\-file\-type TYPE\fP
Packit 229ac0
File type (voc, wav, raw or au).
Packit 229ac0
If this parameter is omitted the WAVE format is used.
Packit 229ac0
.TP
Packit 229ac0
\fI\-c, \-\-channels=#\fP
Packit 229ac0
The number of channels.
Packit 229ac0
The default is one channel.
Packit 229ac0
Valid values are 1 through 32.
Packit 229ac0
.TP
Packit 229ac0
\fI\-f \-\-format=FORMAT\fP
Packit 229ac0
Sample format
Packit 229ac0
.br
Packit 229ac0
Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE
Packit 229ac0
S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE
Packit 229ac0
FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW
Packit 229ac0
A_LAW IMA_ADPCM MPEG GSM SPECIAL S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE
Packit 229ac0
S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE
Packit 229ac0
.br
Packit 229ac0
Some of these may not be available on selected hardware
Packit 229ac0
.br
Packit 229ac0
The available format shortcuts are:
Packit 229ac0
.nf
Packit 229ac0
\-f cd (16 bit little endian, 44100, stereo) [\-f S16_LE \-c2 \-r44100]
Packit 229ac0
\-f cdr (16 bit big endian, 44100, stereo) [\-f S16_BE \-c2 \-f44100]
Packit 229ac0
\-f dat (16 bit little endian, 48000, stereo) [\-f S16_LE \-c2 \-r48000]
Packit 229ac0
.fi
Packit 229ac0
If no format is given U8 is used.
Packit 229ac0
.TP
Packit 229ac0
\fI\-r, \-\-rate=#<Hz>\fP
Packit 229ac0
Sampling rate in Hertz. The default rate is 8000 Hertz.
Packit 229ac0
If the value specified is less than 300, it is taken as the rate in kilohertz.
Packit 229ac0
Valid values are 2000 through 192000 Hertz.
Packit 229ac0
.TP
Packit 229ac0
\fI\-d, \-\-duration=#\fP
Packit 229ac0
Interrupt after # seconds.
Packit 229ac0
A value of zero means infinity.
Packit 229ac0
The default is zero, so if this option is omitted then the record/playback process will run until it is killed.
Packit 229ac0
Either '-d' or '-s' option is available exclusively.
Packit 229ac0
.TP
Packit 229ac0
\fI\-s, \-\-samples=#\fP
Packit 229ac0
Interrupt after tranmission of # PCM frames.
Packit 229ac0
A value of zero means infinity.
Packit 229ac0
The default is zero, so if this options is omitted then the record/playback process will run until it is killed.
Packit 229ac0
Either '-d' or '-s' option is available exclusively.
Packit 229ac0
.TP
Packit 229ac0
\fI\-M, \-\-mmap\fP            
Packit 229ac0
Use memory\-mapped (mmap) I/O mode for the audio stream.
Packit 229ac0
If this option is not set, the read/write I/O mode will be used.
Packit 229ac0
.TP
Packit 229ac0
\fI\-N, \-\-nonblock\fP          
Packit 229ac0
Open the audio device in non\-blocking mode. If the device is busy the program will exit immediately.
Packit 229ac0
If this option is not set the program will block until the audio device is available again.
Packit 229ac0
.TP
Packit 229ac0
\fI\-F, \-\-period\-time=#\fP     
Packit 229ac0
Distance between interrupts is # microseconds.
Packit 229ac0
If no period time and no period size is given then a quarter of the buffer time is set.
Packit 229ac0
.TP
Packit 229ac0
\fI\-B, \-\-buffer\-time=#\fP     
Packit 229ac0
Buffer duration is # microseconds
Packit 229ac0
If no buffer time and no buffer size is given then the maximal allowed buffer time but not more than 500ms is set.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-period\-size=#\fP     
Packit 229ac0
Distance between interrupts is # frames
Packit 229ac0
If no period size and no period time is given then a quarter of the buffer size is set.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-buffer\-size=#\fP     
Packit 229ac0
Buffer duration is # frames
Packit 229ac0
If no buffer time and no buffer size is given then the maximal allowed buffer time but not more than 500ms is set.
Packit 229ac0
.TP
Packit 229ac0
\fI\-A, \-\-avail\-min=#\fP       
Packit 229ac0
Min available space for wakeup is # microseconds
Packit 229ac0
.TP
Packit 229ac0
\fI\-R, \-\-start\-delay=#\fP     
Packit 229ac0
Delay for automatic PCM start is # microseconds 
Packit 229ac0
(relative to buffer size if <= 0)
Packit 229ac0
.TP
Packit 229ac0
\fI\-T, \-\-stop\-delay=#\fP      
Packit 229ac0
Delay for automatic PCM stop is # microseconds from xrun
Packit 229ac0
.TP
Packit 229ac0
\fI\-v, \-\-verbose\fP           
Packit 229ac0
Show PCM structure and setup.
Packit 229ac0
This option is accumulative.  The VU meter is displayed when this
Packit 229ac0
is given twice or three times.
Packit 229ac0
.TP
Packit 229ac0
\fI\-V, \-\-vumeter=TYPE\fP
Packit 229ac0
Specifies the VU\-meter type, either \fIstereo\fP or \fImono\fP.
Packit 229ac0
The stereo VU\-meter is available only for 2\-channel stereo samples
Packit 229ac0
with interleaved format.
Packit 229ac0
.TP
Packit 229ac0
\fI\-I, \-\-separate\-channels\fP 
Packit 229ac0
One file for each channel.  This option disables max\-file\-time
Packit 229ac0
and use\-strftime, and ignores SIGUSR1.  The stereo VU meter is
Packit 229ac0
not available with separate channels.
Packit 229ac0
.TP
Packit 229ac0
\fI\-P\fP
Packit 229ac0
Playback.  This is the default if the program is invoked
Packit 229ac0
by typing aplay.
Packit 229ac0
.TP
Packit 229ac0
\fI\-C\fP
Packit 229ac0
Record.  This is the default if the program is invoked
Packit 229ac0
by typing arecord.
Packit 229ac0
.TP
Packit 229ac0
\fI\-i, \-\-interactive\fP
Packit 229ac0
Allow interactive operation via stdin.
Packit 229ac0
Currently only pause/resume via space or enter key is implemented.
Packit 229ac0
.TP
Packit 229ac0
\fI-m, \-\-chmap=ch1,ch2,...\fP
Packit 229ac0
Give the channel map to override or follow.  Pass channel position
Packit 229ac0
strings like \fIFL\fP, \fIFR\fP, etc.
Packit 229ac0
Packit 229ac0
If a device supports the override of the channel map, \fBaplay\fP
Packit 229ac0
tries to pass the given channel map.
Packit 229ac0
If it doesn't support the channel map override but still it provides
Packit 229ac0
the channel map information, \fBaplay\fP tries to rearrange the
Packit 229ac0
channel order in the buffer to match with the returned channel map
Packit 229ac0
from the device.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-disable\-resample\fP
Packit 229ac0
Disable automatic rate resample.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-disable\-channels\fP
Packit 229ac0
Disable automatic channel conversions.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-disable\-format\fP
Packit 229ac0
Disable automatic format conversions.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-disable\-softvol\fP
Packit 229ac0
Disable software volume control (softvol).
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-test\-position\fP
Packit 229ac0
Test ring buffer position.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-test\-coef=<coef>\fP
Packit 229ac0
Test coefficient for ring buffer position; default is 8.
Packit 229ac0
Expression for validation is: coef * (buffer_size / 2).
Packit 229ac0
Minimum value is 1.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-test\-nowait\fP
Packit 229ac0
Do not wait for the ring buffer \(hy eats the whole CPU.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-max\-file\-time\fP
Packit 229ac0
While recording, when the output file has been accumulating
Packit 229ac0
sound for this long,
Packit 229ac0
close it and open a new output file.  Default is the maximum
Packit 229ac0
size supported by the file format: 2 GiB for WAV files.
Packit 229ac0
This option has no effect if  \-\-separate\-channels is
Packit 229ac0
specified.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-process\-id\-file <file name>\fP
Packit 229ac0
aplay writes its process ID here, so other programs can
Packit 229ac0
send signals to it.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-use\-strftime\fP
Packit 229ac0
When recording, interpret %\-codes in the file name parameter using
Packit 229ac0
the strftime facility whenever the output file is opened.  The
Packit 229ac0
important strftime codes are: %Y is the year, %m month, %d day of
Packit 229ac0
the month, %H hour, %M minute and %S second.  In addition, %v is
Packit 229ac0
the file number, starting at 1.  When this option is specified,
Packit 229ac0
intermediate directories for the output file are created automatically.
Packit 229ac0
This option has no effect if \-\-separate\-channels is specified.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-dump\-hw\-params\fP
Packit 229ac0
Dump hw_params of the device preconfigured status to stderr. The dump
Packit 229ac0
lists capabilities of the selected device such as supported formats,
Packit 229ac0
sampling rates, numbers of channels, period and buffer bytes/sizes/times.
Packit 229ac0
For raw device hw:X this option basically lists hardware capabilities of
Packit 229ac0
the soundcard.
Packit 229ac0
.TP
Packit 229ac0
\fI\-\-fatal\-errors\fP
Packit 229ac0
Disables recovery attempts when errors (e.g. xrun) are encountered; the
Packit 229ac0
aplay process instead aborts immediately.
Packit 229ac0
Packit 229ac0
.SH SIGNALS
Packit 229ac0
When recording, SIGINT, SIGTERM and SIGABRT will close the output 
Packit 229ac0
file and exit.  SIGUSR1 will close the output file, open a new one,
Packit 229ac0
and continue recording.  However, SIGUSR1 does not work with
Packit 229ac0
\-\-separate\-channels.
Packit 229ac0
Packit 229ac0
.SH EXAMPLES
Packit 229ac0
Packit 229ac0
.TP
Packit 229ac0
\fBaplay \-c 1 \-t raw \-r 22050 \-f mu_law foobar\fR
Packit 229ac0
will play the raw file "foobar" as a
Packit 229ac0
22050\-Hz, mono, 8\-bit, Mu\-Law .au file. 
Packit 229ac0
Packit 229ac0
.TP
Packit 229ac0
\fBarecord \-d 10 \-f cd \-t wav \-D copy foobar.wav\fP
Packit 229ac0
will record foobar.wav as a 10\-second, CD\-quality wave file, using the
Packit 229ac0
PCM "copy" (which might be defined in the user's .asoundrc file as:
Packit 229ac0
.nf
Packit 229ac0
pcm.copy {
Packit 229ac0
  type plug
Packit 229ac0
  slave {
Packit 229ac0
    pcm hw
Packit 229ac0
  }
Packit 229ac0
  route_policy copy
Packit 229ac0
}
Packit 229ac0
.fi
Packit 229ac0
Packit 229ac0
.TP
Packit 229ac0
\fBarecord \-t wav \-\-max\-file\-time 30 mon.wav\fP
Packit 229ac0
Record from the default audio source in monaural, 8,000 samples
Packit 229ac0
per second, 8 bits per sample.  Start a new file every
Packit 229ac0
30 seconds.  File names are mon\-nn.wav, where nn increases
Packit 229ac0
from 01.  The file after mon\-99.wav is mon\-100.wav.
Packit 229ac0
Packit 229ac0
.TP
Packit 229ac0
\fBarecord \-f cd \-t wav \-\-max\-file\-time 3600 \-\-use-strftime %Y/%m/%d/listen-%H-%M-%v.wav\fP
Packit 229ac0
Record in stereo from the default audio source.  Create a new file
Packit 229ac0
every hour.  The files are placed in directories based on their start dates
Packit 229ac0
and have names which include their start times and file numbers.
Packit 229ac0
Packit 229ac0
.SH SEE ALSO
Packit 229ac0
\fB
Packit 229ac0
alsamixer(1),
Packit 229ac0
amixer(1)
Packit 229ac0
\fP
Packit 229ac0
Packit 229ac0
.SH BUGS 
Packit 229ac0
Note that .aiff files are not currently supported.
Packit 229ac0
Packit 229ac0
.SH AUTHOR
Packit 229ac0
\fBarecord\fP and \fBaplay\fP are by Jaroslav Kysela <perex@perex.cz>
Packit 229ac0
This document is by Paul Winkler <zarmzarm@erols.com>.
Packit 229ac0
Updated for Alsa 0.9 by James Tappin <james@xena.uklinux.net>
Packit 229ac0