OK, piecing together clues from this thread and another on the same topic (at the Dream Studio forum), I was able to come up with a solution
I came to the conclusion that I needed to simplify and that the fact that pulseaudio and jack were running simultaneously was quite possibly the source of my particular problem.
So, in case it helps anybody, here are the steps I took.
First, as a reminder, I'm using a Focusrite Scarlett 2i4 (USB 2) device and Dream Studio with all latest updates. OUTPUT: I've got studio monitors plugged in to outputs 1 and 2 (and a normal consumer amp plugged in to the RCA outputs 1 and 2), and headphones plugged in as well. INPUT: There are mics plugged in at the front and a MIDI controller (M-Audio keyboard) plugged into the MIDI in on the back.
Step 1: Kill Pulseaudio.
This is easier said than done. Edit the file /etc/pulse/client.conf and change the line autospawn = yes to autospawn = no, and set daemon-binary to /bin/true. Make sure these lines are not commented out (don't ask me why I mentioned this point...). Think you're done killing it? Probably not. Also look in ~/.pulse/client.conf and you might have to make the same changes there. Now, I've read online that pulseaudio –kill will, finally do the deed. Didn't work for me. Instead, say
look for the process number (or numbers) and kill them all (kill -9 xxxx where xxxx is the number of a running pulseaudio instance).
OK, now it's dead.
If you want to be sure it stays dead after reboot, you'll need to do some more work. This can be somewhat system-dependent, but will probably involve looking at the files in the various /etc/rc#.d directories and moving files called Sxxpulseaudio (where xx is a number) to Kxxpulseaudio. Depending on your setup, other stuff could be involved, such as editing /etc/rc.local or eliminating a file from ~/.config/autostart.
Probably not a bad idea to reboot at this point and be sure it is well and truly dead.
If you have an application that absolutely needs pulseaudio, you can start it by hand. I've been able to do that, though I do need to be sure that Jack is killed first or ugly things tend to happen. There are various partial guides to getting pulseaudio to play nice with Jack. I was originally attracted to Dream Studio because it looked like it did this successfully. (I guess it does for some. It didn't for me.) If I ever get that working I'll post about it (but I'm not very motivated because I don't seem to be missing life with pulseaudio...).
Step 2: Configure Jack.
Start QJackCtl and open the Setup. Do NOT start Jack from the dropdown 'jack' menu at the top of your screen. At least, this (still) doesn't work for me -- it starts Jack with the wrong settings and I haven't bothered to find out where to edit them. No need.
Dream Studio doesn't have a real-time kernel by default, so uncheck that if it is checked (unless you've switched to a real-time kernel, but if you've successfully done that, then you probably don't need my help...) It is best (as far as I can tell) to use the 'real' name of your audio device rather than its device number (which can change on reboot). So say
and you'll see something like this:
Code: Select all
0 [SB ]: HDA-Intel - HDA ATI SB
HDA ATI SB at 0xfeb00000 irq 16
1 [USB ]: USB-Audio - Scarlett 2i4 USB
Focusrite Scarlett 2i4 USB at usb-0000:02:00.0-2, high speed
2 [Generic ]: HDA-Intel - HD-Audio Generic
HD-Audio Generic at 0xfea40000 irq 81
(Yours likely won't be identical to mine!) In my case, the Focusrite is the device I want Jack to use, so under “Interface” I typed in “hw:USB”. This (or whatever the name of your device is) might not be an option for you in the menu, but you can type it directly in. Do not select anything for 'Input' and 'Output' (assuming that your audio device is duplex, as the Focusrite is). The other settings are beyond the scope of this post. However, it is a good idea to be sure that the file ~/.jackrc matches the config that you've set in QjackCtl. In principle they match. I found a glitch that required me to make them match manually. If you need to learn what the stuff in ~/.jackrc means, say “man jackd” and read. Save your setup.
Not a bad idea to reboot again. Just to be sure. Check that pulseaudio is not running. If it is, go directly back to step 1 without collecting $200.
At this point, I was able to boot the machine, start QjackCtl and from there start Jack. The window says “Started” at the top left, and “Stopped” and the bottom left, which can be a little confusing to a newbie like me, but they are referring to two different things. The top left refers to the fact that jackd is running, and so you can use it to connect stuff to other stuff. The bottom left refers to whether transport control is rolling. (You can roll it by clicking the 'play' button in QjackCtl.) If you click the 'Connect' button in Jack, and if you've got no jack-aware programs running (which is a good idea at this point), you'll see inputs and outputs for 'system'. I was initially disappointed to see this because I thought it was referring to my on-board (crappy) system sound card. Nope. As somebody (very helpfully) pointed out to me in a thread somewhere, all 'system' means is “Jack sees some hardware”. If you've got Jack configured properly and all the stars are aligned, the number of inputs and outputs under 'system' should match what your device actually has (in my case, 2 ins and 4 outs). And if you've been eating your veggies, the numbers attached to those ins and outs should match up with the numbers on your device.
A good test at this point is to fire up a Jack-aware music player such as aqaulung and connect it to your 'system' outputs (probably called 'playback_x” where x is a number. Play around with those connections (with some sound playing of course) and you'll learn, or at least confirm, what the connections are doing. (For example, the Scarlett is able to swap headphone from outputs 1/2 to 3/4. I was able to test that by moving connections around in Jack.)
You might find it more convenient to use Patchage to play with these connections. It is nice, especially when things get complicated.
Anyway, at this stage I was able to start Ardour and record from the mics, play out through the headphones or monitors. The whole nine yards. Success!
On to MIDI... Yeah, reboot again. It just helps.
Step 3. Make MIDI work.
My default for testing MIDI has become (for better or worse) to start up Yoshimi, pray that it shows up in the appropriate places in Jack, and play around with connections until I hear sound. So..., I fired up Yoshimi, selected an instrument (Cathedral Organ 3 if you must know) and looked in Patchage. There I see Yoshimi with a MIDI in and left/right outs. I connected the left/right outs system outs as deisred. I also see, in Patchage, system “midi capture 1” and “midi capture 2”. So I connect “midi capture 1” to yoshimi midi in. Nothing. Then I connect system “midi capture 2” to yoshimi midi in and suddenly I'm channeling Bach preludes through my headphones. Good stuff! I don't know why the Focusrite's midi 'in' is seen as 2 and not 1, but whatever.
Later, I click on the 'Connect > MIDI' tab in QjackCtl and I see that there are in fact SIX MIDI capture ports. I wouldn't be surprised if we need to play around with these to get MIDI devices talking to each other properly, as I certainly will in the near future.
But the good news is that, at this point it looks like all that remains is fine tuning. It appears that I'm able to access all of the functionality of the Scarlett 2i4. I've also run guitarix with my guitar plugged into the Focusrite. More happiness.
Well, there's a lot more to do. The main thing (for me at least) is to get rid of the (fortunately few) Xruns. When recording, I've killed just about everything I can find to kill that isn't essential, and this has done wonders. You might will also want to play with other settings in Jack. There's lots of good advice out on the web about these things. My point here was just to give a little back on the specific issue that prompted my original threads, in thanks to those who helped out.