Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am a Linux newbie. I know my way around the command-line enough to where it doesn't get in the way of my day job (I develop web applications in Python). This involves some piping, grep, awk, and programmer-oriented stuff like that.

I am experimenting with desktop Linux on my home computer (using Ubuntu). 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.

I realize I am asking several questions. I am not really hoping to get an answer for any specific one, but just trying to paint a picture of the general mayhem I am experiencing. I know the questions are supposed to be focused and I apologize but I feel like I'm at the end of my rope. I'm hoping there's some nice, well-written "Here's how you work the sound on Linux" article (or set of articles) I just can't find. I am slightly panicked only because there seems to be so little information available on JACK in general, even on the official JACK wiki. Please help!!

share|improve this question
add comment

closed as not a real question by Ulrich Dangel, Anthon, Chris Down, jasonwryan, slm May 22 '13 at 4:05

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 3 down vote accepted

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                           |
|                                                 |
+-------------------------------------------------+
share|improve this answer
    
ALSA, PulseAudio, and OSS all do the same thing. JACK routes audio. –  Geremia Jan 11 at 23:24
add comment

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