Getting JACK To Start Automatically

Once a year or so, I spend a couple of weeks playing with audio applications on Linux to see what’s new, and it’s that time again. I’m not a regular Linux user but I can follow instructions. All versions of what I’m running are what was current within the last week or two, so unless there was a short term bug that’s been fixed, I’m using a reasonably up-to-date OS and applications.

I’m working with a fresh installation of Ubuntu Studio since it includes FFADO and Ardour. My goal here was to get Ardour working with my Mackie mixer with the optional Firewire I/O card. I actually started out with a just plain Ubuntu but got tangled up with compiling FFADO and then trying to get JACK to recognize it (including attempting to rebuild JACK). I figured that a pre-installation of at least the basics would be a better place to start.

I’m at the point where I have Ardour working with the Mackie and I’m getting a handle on using it. I’m not bubbling over with enthusiasm yet, seeing as how I have perfectly good Windows DAW applications, but I recognize the potential. Playback is still full of mutes and squeals, but I figure that’s a matter of optimization or “this combination just won’t work right”, but I’m content to troubleshoot that later on.

Anyway, I’m trying to get over an annoyance. If I don’t start JACK manually (I’m using qjackctl for that), when I start Ardour, it complains, after trying to start the audio engine, that it doesn’t have anything to talk to. I don’t recall the exact text, but that’s what it means. But if I start JACK first, Ardour comes up normally, I’m able to select Firewire as the audio driver, and it sees the Mackie inputs and outputs.

I seem to remember being told during one of my previous excursions that JACK should start when Ardour starts, but that’s not happening. I asked on an Ubuntu forum if there was a way that the OS would start it on boot-up and there I learned about the etc/default/jackd file. I looked for it, edited it so that it should work, but it still doesn’t start JACK. Here’s what my file looks like:


Set to “yes” to start jackd at boot

START_DAEMON=yes

The jackd process will run under this user

USER=mike

Options to pass to jackd

OPTIONS="-R -d alsa -d hw"

Initially, START_DAEMON=no, and USER=fred, so those are the changes I made. The OPTIONS is as it came out of the box. I’ve tried different options, including none and I still can’t get JACK started without kicking it with qjackctl.

After a successful Ardour session, my .jackdrc file contains:

-r -dfirewire -r44100 -p1024 -n3 -i2 -o2

I’ve tried using this as the OPTIONS entry in the etc/default/jackd file, but that didn’t work either.

I’ve tried using Audacity as an alternative test. I don’t need to start JACK manually in order to get that to work, but neither can I get it to recognize the Mackie Firewire card at all. It only works with the computer’s internal sound card or a Behringer 2-channel USB interface.

So what am I missing? I don’t mind clicking on qjackqtl before starting Ardour, but I’m sure there’s a way I can avoid that.

hi Mike,

The file “/etc/default/jackd” is just a set of jackd options that the init script /etc/init.d/jackd will parse.

So my guess is that you don’t have that init script :wink:

Just so that you know:

In debian-like systems, /etc/default is a folder containing default options for startup scripts that live in /etc/init.d/

The startup scripts are called at boot time depending on the so-called sysv-rc configuration.
A quick way to configure the boot sequence for startup scripts is to use the curses-based application called sysv-rc-conf (you may have to download from your package manager). But you are using ubuntu so I guess your system uses another boot mechanism (upstart I believe).

Anyway, chances are that you do not have the /etc/init.d/jackd script installed. It may have been removed some time ago as it was ill-advised to start jackd in this way.

An alternative is to have qjackctl to launch itself after you log in to your windows manager. Qjackctl has an option to start jackd as soon as it is running. This is what I do on my KDE based system. If I were you, I would forget about the init script unless you are running GUI-less systems that do not require login either.

Sounds like this is a project that’s built in layers. Oh, well.
I have a /etc/init.d folder with lots of stuff in it, but no jackd.

“Anyway, chances are that you do not have the /etc/init.d/jackd script installed. It may have been removed some time ago as it was ill-advised to start jackd in this way.”

OK, no reason to install something that’s ill-advised. I looked up ‘/etc/init.d/jackd’ and saw quite a bit about it having been removed from standard distributions and that it was indeed not recommended, so I guess I won’t try to make things worse before they get better.

I have the box in qjackctl checked that says “start JACK when application is started.” I thought initially that this meant when an application that wants JACK running would start qjackctl, which in turn would start JACK, but I’ve discovered that this actually means that qjackctl is the application they’re talking about, and that JACK starts (or not) when starting qjackctl.

“An alternative is to have qjackctl to launch itself after you log in to your windows manager.”

I guess there’s no harm in that. If this was Windows, I’d just put it in an autoexec.bat file. How do I do the equivalent of that in Linux?

hallo,
in debian, i think in ubuntu too, it is the

/etc/rc.local

file.

just write qjackctl into it and it will be started after login.
do this before the ‘exit 0’ line.
once correctly configured, qjackctl will always start with parameters you need.

cheers,
doc

There are many ways to skin this particular cat, but if you are on a recent version of ubuntu, try System->Preferences->Startup Applications and add qjackctrl to get qjackctrl to start when the window manager starts.

(this assumes a default gnome installation, i’m not sure if KDE has the same options menu)

Well, that was easy. Wonder why nobody told me about this before. Maybe because I didn’t ask the right question. :wink: The System->Preferences->Startup Applications worked fine. I was hoping that there was a command line option to start it minimized so it would stay out of the way, but I didn’t see anything about that in the man page for qjackctl. I find myself using Connections enough to keep it handy, however.

It would be fully automatic (for me, anyway, I think) if I could make it quit as part of the shutdown sequence, but that’s probably a two-step process, first to stop JACK, then to close qjackctl. That’s not a big deal.

Thanks a bunch, folks.

if you set it up like on the picture below, you won’t have to do anything when shutting down your PC:

Mine is a little different from that. Yours is prettier. My version is 0.3.4. I see that there’s a 0.3.6 but it doesn’t show up in the Ubuntu package manager yet so I’m a bit skittish about trying to update from the source file on the Sourceforge site.

I don’t have the “Single application instance” checkbox which you show as checked, and the “Delay window positing at startup” entry is grayed out.

Not sure if your red outline meant to check the “temporary server” box of not. I don’t know what that means.

It starts minimized now, but still when I shut down I get the same message, that it’s still running in the system tray. I can tell it to quit anyway, but I’d like to be more polite than that if I can.

Let me revise that. I think that what might have been left running in the system tray was the Connections window that I had opened, then minimized. When I closed that before shutting down the computer, then nothing complained. But I’m pretty sure that when Ihve had Connections open in the system tray, when I click on Quit in qjackdtl, it closes everything and quits.

The other odd thing is that after shutting down and rebooting, now I have two copies of qjackcd\tl running in the system tray, one with Jack started, the other with it not started. I’ll have to experiment with that some more and see if I can document just what’s happening.

[Later] Well, I guess I had two people telling me how to do this, both approaches work, but not together. When I removed qjackctl from the startup applications list, now (with the “run minimized” box checked in qjackctl setup/misc) it starts automatically, minimized, and quits when I shut down. Apparently there’s more to that “minimized” button than just how the program starts. That probably makes it start automatically. Could be???,

Maybe I just don’t know how to work it. They don’t put stuff like tat in the manuals.

Hi

I am trying to finally get jackd started at system startup, which is the only real way for me to go about this. Why should this be ill advised? A sound server is supposed to run once on the system and for all users. For me this is jack. There is especial necessity, as pulseaudio has become really tenacious and annoying that it just restarts when quitting it. I applaud how pulse is taking off and finally unifying the linux audio architecture, but for me, jack takes precedence, as it is more important and man apps that I use depend on it. I have started jack with qjackctl so far, but found it more and more annoying to always have to find the audio device already taken. So starting jack very early on will make sure it is running and all other components either plug into it (I know that pulse can do that) or just break, but keep jack running and available to use.

So I have always found it very strange that jack does not have a startup script. Maybe somebody can explain this to me. Also, is my perception true that currently, pulse and jack cannot be persuaded to work together? I.e. that the plugin for jack (pulse is attached to jack, not the other way around) does not work in every case and with all programs?

Markus

@browny_amiga: JACK is not designed to be a system sound server. Unless you consider yourself a Linux wizard, I strongly recommend that you do not try to use it in this way. JACK is a tool for pro-audio and music creation oriented users. Its not designed to be the sound server for your desktop sounds, Flash etc. etc (even though it is technically possible to make it do all this).

JACK and Pulse can co-exist reasonably peacefully. A soon-to-be-written entry in the JACK FAQ will explain the options.

Thanks for the feedback. Good to know what Jack is designed for and what not. I don’t know if I can call myself a Linux wizard, I have dealt and fiddled around with Linux audio for the last 7 years and always liked jack and always thought that it should be the central point of the audio architecture. I would welcome any information or FAQ how that can be done, even with drawbacks, which I can easily live with.
I am trying out module-jack-sink and source currently, seeing what it can do. So far the experiences are good.
2 weeks of experience later:
I have noticed that it works pretty good in most circumstances, but that the flash player in iceweasel (firefox) does not work with it. Do you know of any workaround for this?

thanks

Markus

@browny_amiga: the JACK FAQ at http://jackaudio.org/faq has been expanded recently (last week) with new sections on routing other audio “systems” via JACK. take a look at that for more info.