Blame aplay/arecord.1

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