Sunday, August 02, 2009

Deejaying with Jack

So, last night I did a deejay set over ustream and got to test out Jack for Mac. It performed very well -- so far, I'm glad that I dumped Soundflower and installed Jack.

It is a little more complicated to set up, and I had some hung applications until I figured out the sequencing that is required.

The short form of what I'm trying to do is as follows:

1. I have a Vestax VCI-300 DJ controller. It is a sound card; it has audio outputs, and I want to play music through those outputs.

2. Those audio outputs then have to go back into my Apogee Ensemble to feed a pair of inputs.

3. From those inputs, I want to send the digital audio to the Ustream web application for streaming.

First off, it would be nice if I could do this a little more directly -- route digital audio out from the ITCH software to the Ustream web app. The VCI-300 is a combination controller and sound card; basically, it is a big MIDI controller, with jog wheels and faders and knobs and lots of buttons. Rather than a 5-pin MIDI connector, though, it sends this data over USB along with audio data. It is also a sound card, primarily driving a stereo main output and a stereo cue output (normally sent to headphones), but also a microphone input and an extra input for a turntable or iPod.

The problem is, It is integrated tightly with Serato ITCH. This is kind of a blessing and a curse. The tight integration makes the package work really well, but it also means that when I use ITCH to play music from my library, the only audio routing option available to me is to send it it back into the analog realm, out the the 1/4" or phono outputs of the VCI-300.

That's great if what you want to do is a live show, but what if you want to do further processing on the audio in the digital domain? With no settings for an alternative audio output software in ITCH, what this means is that you need to send the signal back to another sound card -- in this case, my Ensemble's inputs 5/6.

The Ensemble does a great job with these inputs -- it realizes that I'm plugging in TS, not TRS, cables, and sets the input level to +4 dB, not -10 dB. The input level seems to be pretty well-calibrated: sending out full-scale audio from the VCI-300 seems to saturate the input level nicely, without clipping.

So, the next step is to route audio from the Ensemble input 5/6 to Ustream. That works if I feed audio into the Ensemble front-panel inputs 1 and 2, but it appears that I can't get the Ustream application to listen to any inputs other than 1 and 2. I Using inputs 1 and 2 is not a good solution because if I want to add live guitar or bass, I'll need those inputs; they are the only two that can accept a Hi-Z guitar signal. I'll keep an eye out for a way to get inputs 5/6 up to Ustream, but meanwhile, I can route the audio with Jack, and that's what I want to talk about.

The process is as follows: first, make sure everything else is in order and that the Ensemble inputs are showing the analog signal coming in. You'll need to have Jack installed. Then, run the JackPilot application. This provides a little GUI that allows starting, stopping, configuring, and changing routings on the Jack server. Before starting the Jack server, I choose the Preferences command. That brings up the preferences window:


Note that the Ensemble is set up with 8 inputs and 8 outputs, and Jack detects this automatically (other configurations are possible; use Maestro to set it up differently). There are two virtual inputs and two virtual outputs. Note that Jack is not a CoreAudio device itself, but it interfaces with a CoreAudio device, which shows up as JackRouter.

Now, I start the Jack server by pressing "Start." On my 8-core Mac Pro, Jack uses a tiny fraction of the available CPU:


Next, I configure the Ustream broadcast console and select, as the audio input, JackRouter. The JackPilot routing screen will now show send and receive ports for Safari. This interface is rather confusing, but the idea is that you want to send inputs 5 and 6 from "system," which seems to correspond to the Ensemble, to the Safari out1 and out2. (Why it also has inputs, I don't know). To do this, you select the output (the send port), and double-click the corresponding input to make it turn red:


Now that this connection is made, audio is routed from the VCI-300 to the Ustream web application. This is a bit convoluted, but I am pleased to report that once configured, everything worked perfectly for a number of hours -- no glitches, no degradation or stuttering.

Now, yesterday I was able to get this all working together with my iSight camera, but unfortunately today the camera wouldn't work, so something is not quite right. In this case I was able to just unplug it and plug it back in, and all seems to be well. But with two FireWire devices (the iSight and the Ensemble), plus the VCI-300 USB device, there are lots of possible points of failure and I've grown to expect a slight flakiness. You may find, for example, that you have to start up or connect your devices in a specific order. For example, if the Ustream broadcast console is not running before you open up the routing options, Safari will not appear as an output.

Next time I want to see if I can get the AudioUnit plug-ins to work to interface Logic and Jack. That offers some interesting options for live performance.