3

What I want is to separate two different applications' sound output from each other, and pipe that into a sound editing program.

What I need is a way to add an entry in record that outputs into the playback tab. I need two of these. I'm not sure if there are alsa (plumbing) commands to make these two connections, or phonon?

app1(output) > inputA --- outputA > editing app (input1)
app2(output) > inputB --- outputB > editing app (input2)

So I'll set the output device as the input device for the editing application. That will give me two separate audio sources in the same editing application.

  • 2
    It's very easy to do this with Pulseaudio (virtually all modern distros come with Pulseaudio on top of ALSA): Make a dummy sink, point editing app at monitor source of that sink (or even just use a hardware sink). So check if you have Pulseaudio installed. For ALSA only, you can use the loopback kernel module, but there some gotchas (no format conversion). If you can, use Pulseaudio (or Jack, as described in the answer). – dirkt May 17 '19 at 06:16
  • I do have pulse audio. Can you give me the commands to do this? Will it work for two of them? –  May 17 '19 at 17:37
  • As a side note to help anyone else doing anything like this. If you want to push audio out of Chrome to anything other than your system output. You can use "AudioPick" on the Chrome store. –  May 19 '19 at 19:10

2 Answers2

0

JACK can do such things.

If only some of your applications support JACK, you have to route between JACK and ALSA.

If none of your applications support JACK, you might be able to use the snd-aloop driver to create virtual sound cards.

CL.
  • 2,654
  • 14
  • 15
  • No, they don't sadly. I looked into this angle. That is why I went looking for an alsa angle. I'm not sure with the aloop method I can get two distinct inputs, and outputs in the sound mixer. –  May 17 '19 at 06:08
  • JACK seems amazing. I wish Linux embraced it more fully. –  May 20 '19 at 04:24
0

With Pulseaudio, and no null sink:

Start pavucontrol. Start all applications. Select Output Devices, look at which output device app1 is using. Select Input Devices, set input1 of editing app to the .monitor input of the output device you just saw.

This is inconvenient if you don't want to hear the sound app1 produces, but only want to hear the sound of editing app. So create a null sink:

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

Again in pavucontrol, set the output device for app1 to app1sink, and set input1 of editing app to app1sink.monitor.

You can do the same for app2, either with an additional app2sink, or using the same null sink. In the latter case the sound outputs of app1 and app2 will be mixed. You can adjust the volume for each add separately using pavucontrol (or the in-app volume control).

If editing app (which you didn't name) actually can't use two different ALSA/Pulseaudio inputs, and you are not content with the simple mixing of a single null sink as above, it gets a bit more complicated - in that case you have to decide how you want to mix app1 and app2 in Pulseaudio, so the single input for editing app does something useful.

dirkt
  • 31,679
  • 3
  • 40
  • 73
  • This looks like it might work. I got the two monitors set up. I'll need to do some experimentation to see if this works. What is a null-sink? I assume it allows an input to play back to it's output? What makes this a null sink? –  May 19 '19 at 18:33
  • 1
    A null sink is a sound sink that goes nowhere (hence "null"). The associated `.monitor` input is a feature of *all* sinks, not the null sink in particular. So all sinks can "play back the output". – dirkt May 19 '19 at 19:16