7

Linux newbie: How do I use Jack? How does Linux sound work?

I have an app that is trying to output sound through ALSA or JACK, but I am not hearing anything.

Here are a couple of articles, from which I learned that ALSA is the kernel-mode sound driver for linux, and libasound is the user-space library to which applications interface.

Furthermore PulseAudio and JACK are audio servers/routers to allow multiple applications to control multiple hardware and applications.

Here is a nice article how to route all-applications -> jack -> PulseAudi -> ALSA. Looks pretty simple, but I do not understand why the need of so many layers. Why not directly jack to alsa?

  • How do I list the client applications, using alsa? (I need to find out why am I not hearing anything)
  • How do I route jack directly to alsa? Or should I do as the last article points out - route it through PulseAudio?
  • After all this is done, how do I list information on all client applications to jack?
  • 1
    More links: ALSA, PulseAudio, JACK. – Vorac Aug 6 '13 at 12:50
  • Can you hear other applications? – n. 'pronouns' m. Aug 6 '13 at 20:52
  • @n.m., yea. Problem is jack's "Connections" does not show the sink or source options, even after following nass's advice or this article. – Vorac Aug 7 '13 at 7:40
  • "how do I list information on all client applications to jack?" also have a look on this answer: unix.stackexchange.com/a/492922/240990 – nath Jan 7 '19 at 3:43
5

I can understand your confusion, i've been there :)

Lets start with the fact that PulseAudio, like JACK are sound servers in a sense, with different aims in mind though. JACK is aimed at the professional audio user/musician, while PA aims at providing ease of use.

The audio route is a little different than what you have in your question.

all-applications->PA to jack sink->jack audio server -> libasound and ALSA.

This way the PA which is, as usual the default audio output (sink) pipes the sound to jack. The above looks like this in jack's patchbay (after the sink and source modules have been loaded with load-module)

jack patchbay

the 'system' entries are provided by the ALSA backend, while the PA JACK sink and source are provided by the PA to jack modules.

If you are running some flavour of ubuntu, then you can add the following in qjackctl -> setup -> "options" tab -> execute after startup

pactl load-module module-jack-sink channels=2; pactl load-module module-jack-source channels=2; pactl set-default-sink jack_out; pactl set-default-source jack_in

The above should load the "PA to jack" modules (2 channels L+R for each), and set the default playback device for all applications to be the PA to jack sink module. Additionally it connect the line in/mic input to the PA to jack source input, so that applications that need access to the default input device (such as skype) can get it through the PA to jack source module.

Now if an application outputs sound to ALSA it should playback through the default device , i.e. through pulseaudio. Which begs the question, do you really need jack altogether? And which application is that?

In any case, if the application is jack-aware it should show up on qjackctl's patchbay and then you can connect it in the audio path as you see fit.

For more information see here. Also JACK's FAQ and wiki are tremendously helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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