5

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.

1 Answer 1

4

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.

2
  • I'm getting an error that "No PulseAudio daemon running, or not running as session daemon." Any info as to why? Should I ask this as a separate question?
    – TheLabCat
    Commented Apr 25, 2023 at 1:10
  • @TheLabCat Yes, please ask that as a separate question. The error message is pretty descriptive, though (possibly you are trying it as a wrong user, or from cron?)
    – dirkt
    Commented Apr 25, 2023 at 4:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .