[Jack-Devel] Suggestion to include loopback capability in a Jack session

Thomas Howe tho7maspenguin at gmail.com
Mon Jan 2 03:21:35 CET 2017


Here's my asound.conf. I don't have the plugin, but shouldn't the ALSA
loopback configuration have the same effect and instruct Firefox to output
to the loopback device instead of outputting as a Jack client?

On 1 January 2017 at 15:32, Fons Adriaensen <fons at linuxaudio.org> wrote:

> On Sat, Dec 31, 2016 at 03:26:17AM +0000, Thomas Howe wrote:
>
> > This time it's not an impossible-to-reproduce bug, but a feature request!
> > Let me know it there's a better place to post this. I think similar
> things
> > have been suggested before, but this idea for a 'loopback' client hasn't
> as
> > far as I'm aware.
>
> ALSA's 'jack' plugin can route audio from an ALSA-aware app to
> jack. You can specify to which jack ports it should connect.
>
> You need the alsa-plugins package and an .asoundrc file in your
> home directory. This works by making the jack plugin the default
> ALSA device. In the example below it will connect to zita-mu1 for
> output. I'm using this with Opera, works perfectly.
>
> Example .asoundrc:
>
> ---
> pcm.!default {
>     type plug
>     slave { pcm "jack" }
> }
>
> pcm.jack {
>     type jack
>     playback_ports {
>        0 zita-mu1:in_2.L
>        1 zita-mu1:in_2.R
>     }
>     capture_ports {
>         0 system:capture_1
>         1 system:capture_2
>     }
> }
> ___
>
>
> Ciao,
>
> --
> FA
>
> A world of exhaustive, reliable metadata would be an utopia.
> It's also a pipe-dream, founded on self-delusion, nerd hubris
> and hysterically inflated market opportunities. (Cory Doctorow)
>
> _______________________________________________
> Jack-Devel mailing list
> Jack-Devel at lists.jackaudio.org
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.linuxaudio.org/archives/jackaudio/attachments/20170102/d56f4b4b/attachment.html>
-------------- next part --------------
# this is from adapted from http://alsa.opensrc.org/Jack_and_Loopback_device_as_Alsa-to-Jack_bridge and I don't understand it

# speexrate seems to sound a bit better than samplerate, and might pop less, I don't know
defaults.pcm.rate_converter "speexrate"

# putting period/buffer size here will cause some youtube videos to be silent
pcm.amix {
  type dmix
  ipc_key 219345
    slave {
    pcm "hw:Loopback,0,0"
    format S32_LE
    rate 96000
  }
}
# don't use braces for the slave device otherwise it won't work
pcm.asnoop {
  type dsnoop
  ipc_key 219346
  slave.pcm "hw:Loopback,0,1"
}

# period/buffer size might not even do anything here except add delay, I can't tell... make sure youtube videos aren't too desyncronised
pcm.bridge_out {
  type dsnoop
  ipc_key 219348
    slave {
    pcm "hw:Loopback,1,0"
    format S32_LE
    rate 96000
    period_size 2048
    buffer_size 4096
  }
}
# the braces thing probably applies here too
pcm.bridge_in {
  type plug
  slave.pcm "hw:Loopback,1,1"
}

pcm.aduplex {
  type asym
  playback.pcm "amix"
  capture.pcm "asnoop"
}
# if changing this file, keep an eye on whether audacity still has a "default" option that works
pcm.!default {
  type plug
  slave.pcm "aduplex"
}
# apparently some programs look for card0 instead of default
pcm.card0 {
  type plug
  slave.pcm "aduplex"
}
# apparently some programs look for a corresponding ctl device so we might as well let them find one
ctl.aduplex {
  type hw
  card 0
}
ctl.!default {
  type hw
  card 0
}
ctl.card0 {
  type hw
  card 0
}


More information about the Jackaudio mailing list