Skip to content

Instantly share code, notes, and snippets.

@italic-r
Created April 4, 2022 07:16
Show Gist options
  • Save italic-r/ba667980bb4fa2df6209925ac786f752 to your computer and use it in GitHub Desktop.
Save italic-r/ba667980bb4fa2df6209925ac786f752 to your computer and use it in GitHub Desktop.
Minimal ALSA loopback device config
# ${HOME}/.asoundrc
# =========================================
Base ALSA device targetting loopback device
# =========================================
pcm.SDR_IN {
type hw
card "SDRLB"
device 0
subdevice 0
format "S16_LE"
channels 1
rate 48000
nonblock 1
hint.show on
hint.description "Send nc packets here"
}
pcm.SDR_OUT {
type hw
card "SDRLB"
device 1
subdevice 0
format "S16_LE"
channels 1
rate 48000
nonblock 1
hint.show on
hint.description "SDR Rx audio"
}
# =========================================
Plug devices for adapting to application requirements
# =========================================
pcm.SDR_IN_AUTO {
type plug
slave {
pcm "SDR_IN"
}
hint.show on
hint.description "Send nc packets here"
}
pcm.SDR_OUT_AUTO {
type plug
slave {
pcm "SDR_OUT"
}
hint.show on
hint.description "Connect decoder here"
}
# /etc/modprobe.d/alsa-base.conf
# This is a configuration file for modprobe to force specific device ordering
# and indexing. This then exposes the devices to ALSA in the proper order
# regardless of the number of devices plugged in or the order they were connected.
# id=SDRLB is the name ALSA will show for the loopback device, which can be referenced in ~/.asoundrc
options snd-aloop enable=1 index=1 pcm_substreams=4 id=SDRLB
# /etc/modules-load.d/modules.conf
# List of modules to load at boot
snd-aloop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment