Friday, 7 October 2011

JACK for audio passthrough on Fedora 15

It turns out that Pulseaudio (The top layer of Linux's sound system, which finally means that sound Just Works for the most part) is not great at handling audio pass through (or monitoring): that thing where you plug something into your computer's line in and it comes out the speakers. There are three things you can do:

  1. Turn on hardware audio monitoring. Odds are your soundcard can do this, the trick is finding a mixer (volume control) that will give you access to the control you need as the Pulseaudio volume control hides the hardware. *
  2. Use pulseaudio's loopback plugin. This should work, it doesn't: there's too much latency (delay). If you're not going to take advantage of the fact your soundcard can do this itself (see #1) you should get some real benefit in exchange, so...
  3. Use JACK to do pass through. JACK is a sort of optional layer that sits on top of your soundcard and lets you do professional audio handling. It turns out Pulseaudio can run on top of JACK and that JACK can do audio pass through with no noticeable latency. Not only this, but its real use is to mix and filter sound in real time, so if you want them there are synthesisers, audio sequencers and effects available (like rakarrak and guitarix for guitar effects). To get this working on Fedora 15 you need to install (from the add/remove software menu or Yum):
    • qjackctl (this is a controller and will pull all the other JACK components with it)
    • pulseaudio-module-jack
    Once you've done this start qjackctl (find it in the sound and video menu), click the setup button and:
    • Select your soundcard by clicking the right arrow > next to interface.
    • Go to 'options' and add this into 'Execute script after startup':
      pactl load-module module-jack-source;pactl load-module module-jack-sink
    • Add this to 'Execute script on startup':
       pulseaudio -k
    qjackctl, system-out connected to system-in allows monitoring input.
    • Click Okay. Now any time you want to use pass-through, start qjackctl, open 'Connect' and drag the 'system' item from the 'output ports' tray to the 'input ports' tray.
Thanks to the PulseOnJack walkthrough which made me realise this could all be done through qjackctl.
^In Fedora 15 your best bet is alsamixer from the alsa-utils package, it's run from the command line: press F6 to select the soundcard (not default) then left and right arrows and try unmuting things (microphone, line-in, AC97 control). Esc to exit. (I feel I have to apologise for this, but it's nothing to do with me. It is actually pretty straightforward, you just can't use a mouse.)

No comments:

Post a Comment