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 (usually S16_LE or S32_LE) πŸ’œ Use -h to see every format on the list. The default is S16_LE, obviously the moment πŸ’…
  • -c <channels>, --channels=<channels> β€” Channel count. The default is 2 🫢
  • -r <rate>, --rate=<rate> β€” Rate specification. The default is 48000 (Hz) 🎢
  • -n, --resample β€” Allow rate resampling using alsa-lib πŸ”
  • -A <converter>, --samplerate=<converter> β€” Use libsamplerate and pick a converter πŸ“. Your options are:
    • 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 β€” 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:
    • 0 or none β€” do not touch the stream 🫠
    • 1 or simple β€” add or remove samples to keep both streams synchronized πŸ”„
    • 2 or captshift β€” use the driver for the capture device (if supported) to compensate the rate shift 🎀
    • 3 or playshift β€” use the driver for the playback device (if supported) to compensate the rate shift πŸ”Š
    • 4 or samplerate β€” use the samplerate library to do rate resampling 🌊
    • 5 or auto β€” automatically selects the best method, checking in this order: captshift, playshift, samplerate, simple πŸ‘‘
  • -T <num>, --thread=<num> β€” Thread number. -1 means 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 of mixid is SRCID(PLAYBACK)[@DSTID(PLAYBACK)]. Examples:
"name='Master Playback Switch'@name='Another Switch'"
"name='PCM Playback Volume'"

Known attributes you can use:

  • name β€” control ID name
  • index β€” control ID index
  • device β€” control ID device
  • subdevice β€” control ID subdevice
  • iface β€” control ID interface
  • numid β€” 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 of ossmixid is ALSAID[,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 πŸ¦‹βœ¨