Score:0

Splitting audio between loopback and analog (3.5mm jack)

de flag

I have made changes to my system to accommodate my specific needs using stuff I’ve found on forums and somehow got it all to work, without really understanding HOW it works. What it does is it creates an audio loopback output for streaming. It works perfectly, but what I am wanting (hoping) to do is to ALSO send audio to the analog output (the 3.5mm jack). It would eliminate the need for a second machine, which would be so helpful.

To get it working, I had to, as root:

nano ~/.asoundrc

And add this:

pcm.multi {
type plug
        slave.pcm {
        type route;
        slave.pcm {
                type multi;
                slaves.a.pcm "output";
                slaves.b.pcm "loopin";
                slaves.a.channels 2;
                slaves.b.channels 2;
                bindings.0.slave a;
                bindings.0.channel 0;
                bindings.1.slave a;
                bindings.1.channel 1;
                bindings.2.slave b;
                bindings.2.channel 0;
                bindings.3.slave b;
                bindings.3.channel 1;
        }

        ttable.0.0 1;
        ttable.1.1 1;
        ttable.0.2 1;
        ttable.1.3 1;

}
}

pcm.!default {
type plug
slave.pcm "multi"
}

pcm.output {
type plug
slave.pcm "hw:0,1"
}

pcm.loopin {
type plug
slave.pcm "plughw:Loopback,0,0"
}

pcm.loopout {
type plug
slave.pcm "plughw:Loopback,1,0"
}

That gives me ALSA: Loopback(loopin), LOOPBACK PCM for streaming. Is there something I can add to this (or somewhere else) that will also pipe the audio to the 3.5mm jack? I could make HDMI audio work if it's easier.

This is the output of aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 7/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
BaTycoon avatar
mm flag
Similar, if not the same as https://stackoverflow.com/questions/43939191/alsa-how-to-duplicate-a-stream-on-2-outputs-and-save-system-configs
de flag
I appreciate the link, but I don't understand what goes where. I have done my best to try the examples it lists, but I can't get it to work. The cat /proc/asound/cards it recommends, gives me 1 [ALSA ]: bcm2835_alsa - bcm2835 ALSA bcm2835 ALSA I just don't know how to place that in my asoundrc. I could even make HDMI audio work. I just need both the loopback as well as either the 3.5mm jack or HDMI audio. They don't even have to be in sync.
Sadaharu Wakisaka avatar
pl flag
Welcome to AskUbuntu, this can be done by two way, 1. using one output as loopback with latency. 2. conbine two output ports into one. https://wiki.archlinux.org/title/PulseAudio/Examples#Simultaneous_HDMI_and_analog_output
de flag
I just don't get it. I have been trying to fix this issue for 4 years now. I've read tons of stuff about this, watched videos about it and tried a million things but I just don't know what I'm doing and nothing works.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.