LinuxCommandLibrary

alsaloop

Create audio loopback between ALSA devices.

TLDR

Loop audio from capture to playback device

$ alsaloop -C [hw:0,0] -P [hw:1,0]
copy
Loop with specific sample rate
$ alsaloop -C [hw:0,0] -P [hw:1,0] -r [48000]
copy
Loop with specific format
$ alsaloop -C [hw:0,0] -P [hw:1,0] -f [S16_LE]
copy
Run in daemon mode
$ alsaloop -C [hw:0,0] -P [hw:1,0] -d
copy

SYNOPSIS

alsaloop [-C capture] [-P playback] [-r rate] [-f format] [options]

DESCRIPTION

alsaloop creates a loopback between an ALSA capture device and playback device. It reads audio from one device and writes it to another in real-time, useful for routing audio between different hardware interfaces.
The tool handles buffer management, sample rate conversion if needed, and attempts to maintain synchronization between devices.

PARAMETERS

-C device

Capture (input) device
-P device
Playback (output) device
-r rate
Sample rate in Hz
-f format
Sample format (S16LE, S24LE, S32_LE, etc.)
-c channels
Number of channels
-d, --daemonize
Run as daemon
-s seconds
Process time limit
-t ms
Loop latency in milliseconds
--sync mode
Sync mode: none, simple, captshift, playshift

CAVEATS

Latency depends on buffer sizes and hardware capabilities. Different sample rates between devices require resampling. CPU usage increases with lower latency settings.

HISTORY

alsaloop is part of the alsa-utils package, providing a simple tool for audio routing that complements the more complex ALSA loopback kernel module.

SEE ALSO

arecord(1), aplay(1), alsactl(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community