ALSALOOP(1)
β¨ ALSALOOP(1) π β General Commands Manual β¨
π NAME
Okay so bestie, the manual name here is alsaloop β it's a command-line PCM loopback. π¦ It's giving "pipe audio from one place to another" energy π
π SYNOPSIS
alsaloop [-option] [cmd]
πΈ DESCRIPTION
Okay so alsaloop lets you create a PCM loopback between a PCM capture device and a PCM playback device. π§ Literally the audio-routing queen π
It's also highkey iconic because it supports multiple soundcards π₯, adaptive clock synchronization β, and adaptive rate resampling using the samplerate library (if it's available on your system π«Ά). And ooh, mixer controls can be redirected from one card to another, like Master and PCM π β¨
π¦ OPTIONS
-h,--helpβ Prints the help information. Bestie, this is your lifeline ππ-g <file>,--config=<file>β Use a given configuration file π. The syntax is super simple: each line holds the command line options for one job π. A#marks a comment, and the rest of that line gets ignored. Here's an example π
# 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
-d,--daemonizeβ Daemonize the main process and use syslog for messages π§ Main character energy.-P <device>,--pdevice=<device>β Use the given playback device π-C <device>,--cdevice=<device>β Use the given capture device ποΈ-X <device>,--pctl=<device>β Use the given CTL device for playback ποΈ-Y <device>,--cctl=<device>β Use the given CTL device for capture ποΈ-x <ctl_ascii_name>,--prateshift=<ctl_ascii_name>β Specify the ctl ascii name for playshift sync mode π (check out the Examples section, iykyk).-l <latency>,--latency=<frames>β Requested latency in frames β±οΈ-t <usec>,--tlatency=<usec>β Requested latency in usec (that's 1/1000000 of a second) β²οΈ Tiny but mighty.-f <format>,--format=<format>β Format specification (usuallyS16_LEorS32_LE) π Use-hto see every format on the list. The default isS16_LE, obviously the moment π-c <channels>,--channels=<channels>β Channel count. The default is2π«Ά-r <rate>,--rate=<rate>β Rate specification. The default is48000(Hz) πΆ-n,--resampleβ Allow rate resampling using alsa-lib π-A <converter>,--samplerate=<converter>β Use libsamplerate and pick a converter π. Your options are:0orsincbestβ best quality π1orsincmediumβ medium quality β¨2orsincfastestβ lowest quality π3orzeroholdβ hold zero samples π4orlinearβ worst quality, linear resampling π5orautoβ let it choose the best method π§
-B <size>,--buffer=<size>β Buffer size in frames π§Ί-E <size>,--period=<size>β Period size in frames π-s <secs>,--seconds=<secs>β How long the loop runs, in seconds β³-b,--nblockβ Non-block mode, which means very early process wakeup. Heads up: it eats more CPU πβ‘-S <mode>,--sync=<mode>β Sync mode specification for the capture-to-playback stream. Pick your vibe:0ornoneβ do not touch the stream π«1orsimpleβ add or remove samples to keep both streams synchronized π2orcaptshiftβ use the driver for the capture device (if supported) to compensate the rate shift π€3orplayshiftβ use the driver for the playback device (if supported) to compensate the rate shift π4orsamplerateβ use the samplerate library to do rate resampling π5orautoβ automatically selects the best method, checking in this order:captshift,playshift,samplerate,simpleπ
-T <num>,--thread=<num>β Thread number.-1means create a unique thread. All jobs with the same thread numbers run within one thread π§΅-m <mixid>,--mixer=<midid>β Redirect a mixer control from the playback card to the capture card ποΈ The format ofmixidisSRCID(PLAYBACK)[@DSTID(PLAYBACK)]. Examples:
"name='Master Playback Switch'@name='Another Switch'"
"name='PCM Playback Volume'"
Known attributes you can use:
nameβ control ID nameindexβ control ID indexdeviceβ control ID devicesubdeviceβ control ID subdeviceifaceβ control ID interfacenumidβ control ID numid
-O <ossmixid>,--ossmixer=<midid>β Redirect a mixer control from the OSS Mixer emulation layer (capture card) to the ALSA layer (capture card) ποΈ The format ofossmixidisALSAID[,INDEX]@OSSID. Examples:
"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
-v,--verboseβ Verbose mode. Use it multiple times to turn up the verbosity π’-U,--xrunβ Verbose xrun profiling π΅οΈββοΈ-W <timeout>,--wake=<timeout>β Set the process wake timeout β°
π§ EXAMPLES
alsaloop -C hw:0,0 -P hw:1,0 -t 50000
alsaloop -C hw:soundcard,0 -P hw:Loopback,0 -t 50000 -S playshift \
-x iface=PCM,name='PCM Rate Shift 100000',device=1
π BUGS
None known. Bestie, that's a clean record π β¨
π©βπ» AUTHOR
alsaloop is by Jaroslav Kysela <perex@perex.cz>. This document is by Jaroslav Kysela <perex@perex.cz> too π«Ά
Bye bestie, that's the whole page π Source is the 5 Aug 2010 version of ALSALOOP(1), so go loop some audio and slay forever π¦β¨
π¦ where this page comes from
- alpine 3.22: alsa-utils-doc 1.2.14-r0 Β· GPL-2.0-or-later
- alpine 3.23: alsa-utils-doc 1.2.14-r4 Β· GPL-2.0-or-later
- alpine 3.24: alsa-utils-doc 1.2.15.2-r1 Β· GPL-2.0-or-later
- arch rolling: alsa-utils 1.2.16-1 Β· GPL-2.0-or-later
- centos-stream 10: alsa-utils 1.2.16-1.el10 Β· GPL-2.0-or-later
- centos-stream 9: alsa-utils 1.2.16-1.el9 Β· GPLv2+
- debian bookworm: alsa-utils 1.2.8-1 Β· GPL-2.0-only
- debian trixie: alsa-utils 1.2.14-1 Β· GPL-2.0-only
- fedora 43: alsa-utils 1.2.14-2.fc43 Β· GPL-2.0-or-later
- fedora 43: alsa-utils 1.2.16-1.fc43 Β· GPL-2.0-or-later
- fedora 44: alsa-utils 1.2.15.2-3.fc44 Β· GPL-2.0-or-later
- fedora 44: alsa-utils 1.2.16-1.fc44 Β· GPL-2.0-or-later
- nixos 26.05: alsa-utils 1.2.14
- nixpkgs unstable: alsa-utils 1.2.16
- opensuse-leap 16.0: alsa-utils 1.2.14-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: alsa-utils 1.2.14-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: alsa-utils 1.2.14-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: alsa-utils 1.2.14-160000.2.2 Β· GPL-2.0-or-later
- ubuntu jammy: alsa-utils 1.2.6-1ubuntu1 Β· GPL-2.0-only
- ubuntu noble: alsa-utils 1.2.9-1ubuntu5 Β· GPL-2.0-only
- ubuntu questing: alsa-utils 1.2.14-1ubuntu1
- ubuntu resolute: alsa-utils 1.2.15.2-1ubuntu1 Β· GPL-2.0-only
- ubuntu stonking: alsa-utils 1.2.15.2-1ubuntu2 Β· GPL-2.0-only
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms