2010-08-18 08:29:03 +02:00
|
|
|
.TH ALSALOOP 1 "5 Aug 2010"
|
|
|
|
.SH NAME
|
2013-05-15 19:12:55 +02:00
|
|
|
alsaloop \- command\-line PCM loopback
|
2010-08-18 08:29:03 +02:00
|
|
|
.SH SYNOPSIS
|
|
|
|
\fBalsaloop\fP [\fI\-option\fP] [\fIcmd\fP]
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
|
|
\fBalsaloop\fP allows create a PCM loopback between a PCM capture device
|
|
|
|
and a PCM playback device.
|
|
|
|
|
|
|
|
\fBalsaloop\fP supports multiple soundcards, adaptive clock synchronization,
|
|
|
|
adaptive rate resampling using the samplerate library (if available in
|
|
|
|
the system). Also, mixer controls can be redirected from one card to
|
|
|
|
another (for example Master and PCM).
|
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-h\fP | \fI\-\-help\fP
|
|
|
|
|
|
|
|
Prints the help information.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-g <file>\fP | \fI\-\-config=<file>\fP
|
|
|
|
|
|
|
|
Use given configuration file. The syntax of this file is simple: one line
|
|
|
|
contains the command line options for one job. The '#' means comment and
|
|
|
|
rest of line is ignored. Example:
|
|
|
|
|
2013-05-15 19:12:55 +02:00
|
|
|
# First line \- comment, second line \- first job
|
|
|
|
\-C hw:1,0 \-P hw:0,0 \-t 50000 \-T 1
|
|
|
|
# Third line \- comment, fourth line \- second job
|
|
|
|
\-C hw:1,1 \-P hw:0,1 \-t 40000 \-T 2
|
2010-08-18 08:29:03 +02:00
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-d\fP | \fI\-\-daemonize\fP
|
|
|
|
|
|
|
|
Daemonize the main process and use syslog for messages.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-P <device>\fP | \fI\-\-pdevice=<device>\fP
|
|
|
|
|
|
|
|
Use given playback device.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-C <device>\fP | \fI\-\-cdevice=<device>\fP
|
|
|
|
|
|
|
|
Use given capture device.
|
|
|
|
|
2010-10-11 11:56:16 +02:00
|
|
|
.TP
|
|
|
|
\fI\-X <device>\fP | \fI\-\-pctl=<device>\fP
|
|
|
|
|
|
|
|
Use given CTL device for playback.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-Y <device>\fP | \fI\-\-cctl=<device>\fP
|
|
|
|
|
|
|
|
Use given CTL device for capture.
|
|
|
|
|
2021-10-13 12:33:43 +02:00
|
|
|
.TP
|
|
|
|
\fI\-x <ctl_ascii_name>\fP | \fI\-\-prateshift=<ctl_ascii_name>\fP
|
|
|
|
|
|
|
|
Specify ctl ascii name for playshift sync mode (see the Examples section).
|
|
|
|
|
2010-08-18 08:29:03 +02:00
|
|
|
.TP
|
|
|
|
\fI\-l <latency>\fP | \fI\-\-latency=<frames>\fP
|
|
|
|
|
|
|
|
Requested latency in frames.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-t <usec>\fP | \fI\-\-tlatency=<usec>\fP
|
|
|
|
|
|
|
|
Requested latency in usec (1/1000000sec).
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-f <format>\fP | \fI\-\-format=<format>\fP
|
|
|
|
|
2013-05-15 19:12:55 +02:00
|
|
|
Format specification (usually S16_LE S32_LE). Use \-h to list all formats.
|
2010-08-18 08:29:03 +02:00
|
|
|
Default format is S16_LE.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-c <channels>\fP | \fI\-\-channels=<channels>\fP
|
|
|
|
|
|
|
|
Channel count specification. Default value is 2.
|
|
|
|
|
|
|
|
.TP
|
2021-03-22 23:02:24 +01:00
|
|
|
\fI\-r <rate>\fP | \fI\-\-rate=<rate>\fP
|
2010-08-18 08:29:03 +02:00
|
|
|
|
|
|
|
Rate specification. Default value is 48000 (Hz).
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-n\fP | \fI\-\-resample\fP
|
|
|
|
|
2013-05-15 19:12:55 +02:00
|
|
|
Allow rate resampling using alsa\-lib.
|
2010-08-18 08:29:03 +02:00
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-A <converter>\fP | \fI\-\-samplerate=<converter>\fP
|
|
|
|
|
|
|
|
Use libsamplerate and choose a converter:
|
|
|
|
|
2013-05-15 19:12:55 +02:00
|
|
|
0 or sincbest \- best quality
|
|
|
|
1 or sincmedium \- medium quality
|
|
|
|
2 or sincfastest \- lowest quality
|
|
|
|
3 or zerohold \- hold zero samples
|
|
|
|
4 or linear \- worst quality - linear resampling
|
|
|
|
5 or auto \- choose best method
|
2010-08-18 08:29:03 +02:00
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-B <size>\fP | \fI\-\-buffer=<size>\fP
|
|
|
|
|
|
|
|
Buffer size in frames.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-E <size>\fP | \fI\-\-period=<size>\fP
|
|
|
|
|
|
|
|
Period size in frames.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-s <secs>\fP | \fI\-\-seconds=<secs>\fP
|
|
|
|
|
|
|
|
Duration of loop in seconds.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-b\fP | \fI\-\-nblock\fP
|
|
|
|
|
2013-05-15 19:12:55 +02:00
|
|
|
Non\-block mode (very early process wakeup). Eats more CPU.
|
2010-08-18 08:29:03 +02:00
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-S <mode>\fP | \fI\-\-sync=<mode>\fP
|
|
|
|
|
|
|
|
Sync mode specification for capture to playback stream:
|
2013-05-15 19:12:55 +02:00
|
|
|
0 or none \- do not touch the stream
|
|
|
|
1 or simple \- add or remove samples to keep
|
2010-08-18 08:29:03 +02:00
|
|
|
both streams synchronized
|
2013-05-15 19:12:55 +02:00
|
|
|
2 or captshift \- use driver for the capture device
|
2010-08-18 08:29:03 +02:00
|
|
|
(if supported) to compensate
|
|
|
|
the rate shift
|
2013-05-15 19:12:55 +02:00
|
|
|
3 or playshift \- use driver for the playback device
|
2010-08-18 08:29:03 +02:00
|
|
|
(if supported) to compensate
|
|
|
|
the rate shift
|
2013-05-15 19:12:55 +02:00
|
|
|
4 or samplerate \- use samplerate library to do rate resampling
|
|
|
|
5 or auto \- automatically selects the best method
|
2010-08-18 08:29:03 +02:00
|
|
|
in this order: captshift, playshift,
|
|
|
|
samplerate, simple
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-T <num>\fP | \fI\-\-thread=<num>\fP
|
|
|
|
|
2013-05-15 19:12:55 +02:00
|
|
|
Thread number (\-1 means create a unique thread). All jobs with same
|
2010-08-18 08:29:03 +02:00
|
|
|
thread numbers are run within one thread.
|
|
|
|
|
|
|
|
.TP
|
|
|
|
\fI\-m <mixid>\fP | \fI\-\-mixer=<midid>\fP
|
|
|
|
|
|
|
|
Redirect mixer control from the playback card to the capture card. Format of
|
|
|
|
\fImixid\fP is SRCID(PLAYBACK)[@DSTID(PLAYBACK)]:
|
|
|
|
|
|
|
|
"name='Master Playback Switch'@name='Another Switch'"
|
|
|
|
"name='PCM Playback Volume'"
|
|
|
|
|
|
|
|
Known attributes:
|
|
|
|
|
2013-05-15 19:12:55 +02:00
|
|
|
name \- control ID name
|
|
|
|
index \- control ID index
|
|
|
|
device \- control ID device
|
|
|
|
subdevice \- control ID subdevice
|
|
|
|
iface \- control ID interface
|
|
|
|
numid \- control ID numid
|
2010-08-18 08:29:03 +02:00
|
|
|
|
2010-10-08 15:10:23 +02:00
|
|
|
.TP
|
|
|
|
\fI\-O <ossmixid>\fP | \fI\-\-ossmixer=<midid>\fP
|
|
|
|
|
|
|
|
Redirect mixer control from the OSS Mixer emulation layer (capture card)
|
|
|
|
to the ALSA layer (capture card). Format of \fIossmixid\fP is
|
|
|
|
ALSAID[,INDEX]@OSSID:
|
|
|
|
|
|
|
|
"Master@VOLUME"
|
|
|
|
"PCM,1@ALTPCM"
|
|
|
|
|
|
|
|
Known OSS attributes:
|
|
|
|
|
|
|
|
VOLUME, BASS, TREBLE, SYNTH, PCM, SPEAKER, LINE, MIC, CD, IMIX, ALTPCM,
|
|
|
|
RECLEV, IGAIN, OGAIN, LINE1, LINE2, LINE3, DIGITAL1, DIGITAL2, DIGITAL3,
|
|
|
|
PHONEIN, PHONEOUT, VIDEO, RADIO, MONITOR
|
|
|
|
|
2010-08-18 08:29:03 +02:00
|
|
|
.TP
|
|
|
|
\fI\-v\fP | \fI\-\-verbose\fP
|
|
|
|
|
|
|
|
Verbose mode. Use multiple times to increase verbosity.
|
|
|
|
|
|
|
|
|
2010-10-13 23:41:29 +02:00
|
|
|
.TP
|
|
|
|
\fI\-U\fP | \fI\-\-xrun\fP
|
|
|
|
|
|
|
|
Verbose xrun profiling.
|
|
|
|
|
2010-10-14 11:17:25 +02:00
|
|
|
.TP
|
|
|
|
\fI\-W <timeout>\fP | \fI\-\-wake=<timeout>\fP
|
|
|
|
|
|
|
|
Set process wake timeout.
|
2010-10-13 23:41:29 +02:00
|
|
|
|
2010-08-18 08:29:03 +02:00
|
|
|
.SH EXAMPLES
|
2021-10-13 12:33:43 +02:00
|
|
|
.nf
|
2010-08-18 08:29:03 +02:00
|
|
|
\fBalsaloop \-C hw:0,0 \-P hw:1,0 \-t 50000\fR
|
|
|
|
|
2021-10-13 12:33:43 +02:00
|
|
|
\fBalsaloop \-C hw:soundcard,0 \-P hw:Loopback,0 \-t 50000 \-S playshift \\
|
|
|
|
\-x iface=PCM,name='PCM Rate Shift 100000',device=1\fR
|
|
|
|
.ne
|
2010-08-18 08:29:03 +02:00
|
|
|
.SH BUGS
|
|
|
|
None known.
|
|
|
|
.SH AUTHOR
|
|
|
|
\fBalsaloop\fP is by Jaroslav Kysela <perex@perex.cz>.
|
|
|
|
This document is by Jaroslav Kysela <perex@perex.cz>.
|