I am trying to set up Jack, as I've heard it's the Linux equivalent to ASIO on Windows. I play guitar for fun and thought it would be cool to play with Ardour or find a FOSS equivalent to Guitar Rig.

However I do not understand... well, anything. I don't understand what Jack does. From what I can gather, the general flow is

[sound hardware][kernel][JACK][ALSA][PulseAudio][Phonon][my headphones]

(Phonon comes in because I use KDE. I think.)

I don't actually know what the arrows represent. The JACK website contains essentially zero beginning user oriented documentation, except for one page describing how to use JACK with PulseAudio.

As a beginner who, regardless of JACK, doesn't understand how sound works in Linux, where can I go to learn? I'd like to gain an understanding of the sound stack. But for JACK all I was able to find is its barren Wiki (including two juicy links named Configuring and running a JACK server and Setting up a simple audio chain, which both turn out to be "Coming Soon" pages which haven't been edited in five years) and a Linux Journal article from 2005.

Many things confuse me. How can I tell which sound devices Linux recognizes? I have three: an onboard chip, a USB audio interface (an M-Audio FastTrack), and a USB webcam that has a microphone. Do all of these things get recognized by Linux? Do they all register specifically as sound devices? Does each device have to have independent drivers for JACK, ALSA, PulseAudio, etc.? Is there a basic way I can test my device to make sure it has output? Is there a way I can monitor my devices to see if the software is actually using them?

Right now Amarok sound is audible, but Youtube sound isn't. Amarok is also running through my USB FastTrack instead of my onboard sound chip. Hydrogen refuses to start, presumably because I have JACK or Alsa or something configured wrong. I have no idea how to figure out the rhyme or reason for these things.

  • 1
    "As a beginner who, regardless of JACK, doesn't understand how sound works in Linux, where can I go to learn? I'd like to gain an understanding of the sound stack." -- yeah, difficult to say what's being asked. Or just difficult to answer? – mlvljr Jun 7 '14 at 19:32

In my endeavor with Linux sound I have ended up disabling autospawning of Pulse Audio (so it doesn't restart when shut down):

Add autospawn=no to ~/.pulse/client.conf.

  • Stop with pactl exit
  • Start with pulseaudio

Doing live sound stuff or the like I shut down PA and run JACK only. No PA bridge. I have never gotten latency satisfactorily lowered using PA or JACK+PA.

This article seems to give a rather good and quick introduction to the layers, which also mentions Phonon.

You have perhaps read this, and is also not up to date, but would perhaps bring you closer to an understanding: Linux Music Workflow: Switching from Mac OS X to Ubuntu with Kim Cascone. Note the diagram above heading "Workflow". (Which you can also find here under JACK Schematic diagram.) Also read the links e.g. the one on top Introduction to Linux Audio, even though from 2004, it gives you a quick view of ALSA.

Though I'm not to familiar with either myself I believe a good approach is to split out the learning in various parts.

  1. Get an understanding of ALSA
  2. Get an understanding of JACK (Especially since you want to do studio work.)
  3. Get an understanding of Pulse Audio

in that order. It is no wonder one struggle with grasping Linux sound. That has quite a bit to do with history and how it all has evolved. That is also why, if one want to truly understand it, it is a good thing to learn history of it. Thus again - ALSA is a good place to start. Do some sniffing on OSS. And work your way up.

Quick way to might get it to work is follow either of these guides.

Simplistically; ALSA is part of the kernel and know how to handle various hardware. JACK as well as Pulse Audio uses API to control and interact with the hardware. ALSA can also be used alone as a sound server. Applications uses JACK/PA API to do multi thread sound work.

A quick view of your system can be achieved by running the alsa-info.sh script found here.

A very simplified diagram of a blurry view showing some of the connections:

 |                   SOUNDCARD                    |
 |------------------------------------------------|      _____  __
 |                  ___________                   |     /     \/  \
 |                  |   ADC   | <---- analog in --[o---7 :===========|==|==|=[';]
 |                  -----|-----                   |     \____7 \__/
 |    __________ AMP     |                        |
 |   | MIXER |----+------o                        |
 |   +---|---+-- AMP_____|______                  |        _______
 |       |          |   DAC    | ---> analog out -[o------[ o o o ]  ♫ ♬ ♪ ♩ ♭ ♪
 |       |          +----------+                  |       |       |
 |       |                                        |       |  (o)  |
 |   -- -+---^-- --v-- -- -- --^-- --v-- --+--    |       |       |
 |                    CONTROLS                    |       | ((0)) |
 |                                                |       |_______|
 |                                                |
 ADC: Analog to digital         ||
 DAC: Digital to analog         |- udev trigged and mounted
|                                                 |
|                     KERNEL                      |
|¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ ¨ -|-|-|-|- ¨ ¨ ¨ ¨ ¨|
|                                                 |
|       ALSA API <--> [Device Drivers]            |
|         ^  |        module-alsa-card   +--------|--
|         |  |                           |        |
+---------|--|---------------------------|     Memory Buffer I/O
:         |  v                           |        |
|                                        +----|---|--
| JACK ------------ PULSE AUDIO --------------+   |
|             sinks                           |   |--
| * hardware-access-points * hardware-sink    |   |  Uses ALSA API for HW I/O
| * virtual-devices        * mediaplayer-sink |   |  Mixing, Control etc.
|                          * recorder-sink    |   |
|                          * ...              |   |--
|                                             |   |
|               APPLICATIONS -----------------+   |
|                                                 |
| Software based mixing                           |
|                                                 |
| improve this answer | |
  • ALSA, PulseAudio, and OSS all do the same thing. JACK routes audio. – Geremia Jan 11 '14 at 23:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.