I'm running a set of programs where I need to chain route the audio.

Program 1 generates audio which needs to be silently routed into program 2, and then program 2 creates a new audio source which needs to be silently routed into program 3. Finally program 3 creates audio which should go to the speakers.

Can anyone help me figure out what the best way to achieve this is? I've managed to route audio silently from program 1 into program 2 using "sudo modprobe snd-aloop", which gives me a loopback device.

But now i'm stuck on how silently route that audio into program 3. Oh and this can't be achieved by pipes.


Pulseaudio, or pure ALSA? Pulseaudio is easiest: Create a dummy sink

pacmd load-module module-null-sink sink_name=tmpsink

and let program 1 output to it. Program 2 reads from the tmpsink.monitor source. And so on. All this can be scripted. pacmd help shows more commands that may be useful, e.g. list-sink-inputs, list-source-outputs, or move-sink-input and move-sink-output if you can't specify sources and sinks for the programs on the commandline.

Doing that in ALSA is probably ... fun. Before I'd try to do that in ALSA, I'd try to do it using Jack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.