Jack Quickstart Guide

Submitted by Nate on Thu, 05/24/2007 - 14:46

by Nate Figlar

Hello, and welcome to the 64 Studio Jack quickstart guide. Jack is a sound server typically used for audio production on Linux systems. Think of it as a glue that joins all of your audio applications together. In this guide I will be showing you how to get it running, and make use of it - so let's get started.

Jack can be controlled quite easily by a little program that you open called "Jack Control"; some other distributions might call it "qjackctl", but it's the same thing. In 64 Studio you open it via the Gnome "Foot Menu"; in the category called "Sound & Video" it should have a little quarter inch jack icon next to it. Click on that to run the program. You should get a window that looks like this:

jack stopped

Now before you hit the "start" button, let's get everything set up just right. Most importantly, making sure your sound card is opened by Jack and ready to go. That, again, is a fairly simple process that might take a little adjusting, but we'll get through it. Look at the far right buttons on Jack
Control and be sure to click the middle "Setup" button. Now another window should open that looks something similar to this:

jack setup

Keep in mind, especially in the Parameters section, that not all the numbers are going to look exactly like this. This picture was taken from my system and has been tuned from the defaults, but this is something to shoot for. First, make sure you have Realtime Mode checked in Parameters. Make sure the priority is set at 0 as well; this gives all the audio processes first priority and best performance for your production.

Next, let's make sure we have our sound card properly assigned. You will see in the Parameters section in the middle of the right hand column, "input device" and "output device". Or, you can select your sound card using the Interface setting. Also notice there are arrows pointing to the right on those areas. These drop-down menus should list soundcard(s) your system can use with Jack. For example, my system has 3 soundcards in total:

One is a built-in chipset which is noted as hw;1 VIA8237
My Revolution PCI card is hw;0 M-Audio
and my USB MIDI keyboard is hw;2 Photonx25

It's normally good to go with the setting that has the model name of the card, although you might have to use a different one in a section. You might have to experiment some if Jack won't start (that will be discussed later). If you don't see your sound card, it may not be ALSA compatible. In this case, try a different driver up in the Server section of the Setup panel (probably OSS). Most soundcards should be ALSA compatible and is recommended to go with ALSA unless you have a FireWire interface, in which case you would use the Freebob driver.

There is one more concept you need to keep in mind at this point, and that is the balance between latency and Xruns. The idea is to get Jack to perform as close to realtime processing as possible, which means the figure in the lower righthand corner labeled "Latency" should be as low as
possible. This is done by manipulating the Frames/Period setting in the centre column of the Setup window.

Now to throw a small wrench in the works - your computer may not be able to deliver the performace Jack needs to run at the latency you set, causing something called Xruns. Xruns are basically buffer underruns, causing anomalies heard in the audio. It is common to get some Xruns at the startup and shutdown of some applications, and maybe some more processor intesive functions like patch changes and such. If you can't hear these anomalies, then you should be fine. If you are worried about having glitches in a recording, then take latency up a notch. Ideally though, once you get Jack good and set, it should be able to stay at that latency figure.

You might need to experiment with these settings, but with these concepts in mind we should be ready to start Jack. Now let's click OK on the Setup panel and implement our settings. Since this is a first run of Jack we want to make sure all is working good, and if not, find where the problem lies. Go back to the main Jack control panel and far left on the middle panel is the button for "Messages". Go ahead and click it, and you should get a window like this:


Again, this probably looks a little different to yours, due to the actual messages - this is where things like xruns and start-up errors show up. It might tell you "that soundcard is already in use", in which case you know some other application (like system sounds) might already be using the card. If you have an ever-changing list of Xruns then you know you've got performance tweaked too high, and so you should re-adjust as needed. Other than that, it should just tell you about changes in the server. Remember, occasional Xruns may not be a problem; just watch the messages at first when you start and run applications.

Now hit the start button, and if all is good, you will get a bunch of various messages and the window should end up looking like the frame above. Hopefully no Xruns, except maybe one or two. If all is good, then let's get started on making some apps work and making sure that sound will come out.

When starting a Jack app, make sure that the Jack server is already started; it will then pick up the app when that starts. A good start would be a synth program like ZynAddSubFx. Go to the "foot menu" then to "Audio & Video", and at the bottom of the list should be ZynAddSubFx. The program should prompting for a beginners or advanced selection. As I have chosen this program for a quick and easy check, if you chose beginners mode you get a nice virtual keyboard to check with. In 64 Studio, it automatically connects into Jack.

Now let's look at the Jack Control connections window, which is another important part of making Jack work. Remember when I said you can think of Jack as the glue to connect your audio applications? Well, this where it will come into play. If you look on the far left of the main Jack Control panel you will see it says "Connections". This button opens up a window like this:

Jack Control connections window

Again, keep in mind that if you had to use a Freebob or OSS driver the actual names in each panel may be different. In this case, the "alsa_pcm" on the left panel should be the recording input on the card you chose, or "input device" in the setting panel. The "alsa_pcm" on the right should be the output port on the soundcard you chose for your "output device". Now when we start ZynAddSubFx, the window
should change to this:

zyn connect

See the difference? Jack already added the application and connected it to the main output. If all is set OK, then click around on Zyn's keys and you should be able to hear sounds. Now check your messages and make sure there are very few Xruns, or that it isn't spitting out more and more. (By the way, if they do get too out of control, Jack normally stops with an error message). Since this connection was made automatically, I am going to hook into a midi controller to show how to manually connect Jack clients (the apps and devices used by Jack).

Even if you don't have a MIDI controller on your system, this example should show you the concept of how to manually manipulate connections in Jack. In the same panel as the Connection window you should see the MIDI tab. Click on it, and you should get something like this:

midi connection

Remember this is from my system, and I have an Alesis PhotonX25 midi controller keyboard. This will probably look different on your machine unless you have the same controller, but you should at least have the "Midi Through". With the Zyn synth it should look like this:

zyn midi connect

Now to connect by MIDI all you have to do is highlight the output of the Photon, highlight the Zyn input and hit the "Connect" button (it should become available then). Or you can drag and drop the line across to each. Like I said, if you have a different MIDI interface then whatever the name of the interface is should replace the "Photon X25" name. Once this is done, the window should look like this:

photon zyn connect

Now play your MIDI device, and it should play the corresponding notes on the Zyn synth. If you wish to disconnect, then just highlight the two items you wish to disconnect, and click the disconnect button.

Those are all the basics. From there, you can get creative about how you plug your apps in and out of each other. You can easily stack multiple synths for complex sounds. (Start two different Zyn synths and use different banks, they will show as two seperate clients.) Also keep in mind the other effects processors and how you can expand into various multichannel configurations that are available. In other words, now that you have the Jack basics, have some fun experimenting. See what some of these exciting applications can do. See how you can use Jack to interconnect your audio production tools in an efficient manner, and most importantly, have fun doing it.

Hopefully this guide has shown you just one aspect of what 64 Studio can do for your multimedia production needs in a free software environment.


3 comments posted
Very nice Guide,
Very nice Guide, Thanks Jimmy Haustier-Nachrichten
Posted by Jimmy on Thu, 09/04/2008 - 10:39
Please continue with advanced Jack howto guide
So far this is the absolutely best introduction on how to use jack, that i have found via google. After my first reading a week ago I have succeeded in getting jack up and running with a resonably complex setup. The problem I have now is that i need a continuation of this guide on how to save and restore the connections I have setup. I have so far not found any good documentation on that. I have found the information below that seem relevant, have read it but I do not yet understand it :-) Connection panel in jackcontrol: http://www.rncbc.org/drupal/node/19#comment-37 http://ccrma-mail.stanford.edu/pipermail/planetccrma/2008-March/014450.html http://ubuntuforums.org/archive/index.php/t-977094.html Save configurations for alsa + jack connections, LASH: The http://savannah.nongnu.org/projects/lash looks like it could be what I am looking for. So far I have not been able to compile lash due to a few header files missing from python and maybe 2 other functions. This is in 64studio 2.1 and64 Keep up the good work. - Bo-Erik
Posted by bommaren on Tue, 08/11/2009 - 09:03
further GOOD jack config documentation.
This is a very good description on how to use the patch bay to do magic for you :-) http://www.rncbc.org/drupal/node/76 Can you "Steal with pride" and add this information to this page, making it the best in the world :-) I found the link above in http://www.linuxmusicians.com/viewforum.php?f=19&st=0&sk=t&sd=d&start=100 This info on alsamixer is also relevant when it comes to getting sound out of a linux box. http://www.ubustu.com/globe/2007/05/29/how-to-configure-jack-in-ubuntu-studio/ Bo-Erik
Posted by bommaren on Tue, 08/11/2009 - 09:01