ardourcrop

Here’s a switcher story of a different color: from the Mac, to Linux. It’s one thing to talk about operating systems and free software in theory, or to hear from died-in-the-wool advocates of their platform of choice. In this case, we turn to Kim Cascone, an experienced and gifted musician and composer with an impressive resume of releases and a rich sens of sound. This isn’t someone advocating any platform over another: it’s an on-the-ground, in-the-trenches, real-world example of how Kim made this set of tools work in his music, in the studio and on tour. A particular thanks, as he’s given me some new ideas for how to work with Audacity and Baudline. Kim puts his current setup in the context of decades of computer work. Even if you’re not ready to leave Mac (or Windows) just yet, Kim’s workflow here could help if you’re looking to make a Linux netbook or laptop more productive in your existing rig.

Stay tuned, as I’ll have some other stories on how to make your Linux music workflow effective creatively, particularly in regards to leaping over some of the setup hurdles Kim describes. -PK

Historical Evolution

I’ve been working with computers since the 1970s. Inspired by the work of composer David Behrman, I taught myself assembly language and programmed a simple digital sequencer on a KIM-1, single-board microcomputer, controlling an Aries modular synthesizer I had built. I discovered a then-new magazine called Computer Music Journal at the local computer shop and bought every copy I could get my hands on. (I still have them, too.) Later, I helped a friend’s father, an executive at IBM, unpack and set up the first personal computer IBM made. The manuals alone took up two or three feet of bookshelf space.

Fast-forward through a couple of decades of owning Commodore 64s, Apple computers, and PCs. In 1997, I purchased my first laptop: a woefully-underpowered Compaq Presario. It wasn’t fast enough for real-time audio, so I had to render sound files to hard disk using the audio programming language Csound. I created many of the sounds this way for my CD ‘blueCube( )’. But the capacity to work anywhere was enough for me to give up ever owning another desktop computer.

Frustrated with the ‘code-compile-listen’ process of working with Csound and wanting to work in real-time, I switched to the graphical multi-media programming language Max/MSP, which necessitated a move back to Apple hardware, so I bought a PowerBook. Having Max/MSP running on a laptop was the perfect environment for me. I could build the tools I needed whenever an idea presented itself. The computer functioned as both sound design studio and stage instrument. I worked this way for ten years, faithfully following the upgrade path set forth by Apple and the various developers of the software I used. Continually upgrading required a substantial financial commitment on my part.

Apple Seeds of Discontent

Photo (CC) NiklasNikon.

When I’m on the road, I use my laptop as a music studio, performance instrument, and administration office. I don’t like surprises on the road. Having a computer fail means a loss of income, and makes for an embarrassing moment if the failure happens during a performance. If watching laptop music bores some people, watching a musician reboot is even worse. So to be safe, I stress-test all new hardware or software in my studio for at least a month before I take it on the road. Max/MSP patches run for hours, software is used for weeks, and hardware is left on for days at a time to help induce failure before I leave home. But as fate would have it, an iBook I was touring with died a few years ago. I brought the laptop into an Apple repair shop in Berlin, where a technician diagnosed the problem as a faulty logic board. The failure rate on logic boards was high for that model of iBook, and in response to public pressure, Apple instituted a logic board replacement program. Luckily, my laptop qualified and the logic board was replaced for free. But the failure and ongoing buggy behavior impacted my work schedule and added to the stress of touring.

I’ve now replaced logic boards on three computers; the other two I paid for out of pocket. The out-of-warranty cost of replacing a logic board on an Apple laptop is around six hundred dollars — cheaper than buying a brand new laptop, but still significant.

If you make your living with applications that run on OS X, there are no options if a laptop fails. You either repair expensive Apple hardware or buy new expensive Apple hardware. This is called ‘vendor lock-in.’

Then, during my 2009 spring tour, my PowerBook G4 exhibited signs of age, with missing keystrokes, intermittent backlighting, the failure of a RAM slot, and reduced performance. As an alternative to repairing the PowerBook, I investigated what a new MacBook Pro and upgrades for all my software would cost. A quick back-of-a-napkin estimate came to approximately $3,000, not including the time it would take tweaking and testing to make it work for the tour. If the netbook revolution hadn’t come along and spawn a price-wars on laptops, I might have proceeded to increase my credit card debt. But as a wise uncle once advised, “you invest either your time or your money; never both.”

Meeting Ubuntu

I had tried Linux in 2005 on PowerPC-based Mac laptops, though at the time I couldn’t get audio working, even after extensive tweaking. But I had kept an eye on Ubuntu ever since. After considering MacBook Pro prices, I checked out the new netbooks coming to market and picked up a refurbished Dell Inspiron Mini 9 with Ubuntu pre-installed.

I loaded up my Dell with all a selection of Linux audio applications and brought it with me on tour as an emergency backup to my tottering PowerBook. The Mini 9 could play back four tracks of 24-bit/96 kHz audio with effects – not bad for a netbook. The solution to my financial constraint became clear, and I bought a refurbished Dell Studio 15, installed Ubuntu on it, and set it up for sound production and business administration. The total cost was around $600 for the laptop plus a donation to a software developer — a far cry from the $3000.00 price tag and weeks of my time it would have cost me to stay locked-in to Apple. After a couple of months of solid use, I have had no problems with my laptop or Ubuntu. Both have performed flawlessly, remaining stable and reliable.

Getting Past Ubuntu Audio Complexities

There are a few differences between how audio works on Mac OS X and how it works on Ubuntu Linux. OS X uses the Core Audio and Core MIDI frameworks for audio and MIDI services, respectively. All applications requiring audio services on OS X talk to Core Audio, which mixes and routes multiple audio streams to the desired locations. Core Audio is simple, monolithic, and easy to set up, and all the end-user controls are accessible from one panel. You can even create a single aggregate device from multiple sound cards if you need more inputs or outputs than one sound card can supply. To Apple’s credit, Core Audio and the applications that make use of it are the reason why you see so many laptop musicians seated behind glowing Apple logos on stage.

On Ubuntu, audio is a rather different story. Apple’s slogan ‘Think Different’ would be good advice for musicians encountering Ubuntu’s audio setup for the first time. Audio in Ubuntu can appear at first to be a confusing jumble of servers, layers, services, and terminology. Go to System->Preferences->Sound, click on the Devices tab, and check out the pulldown menu next to ‘Sound Events’ at the top of the panel. You will see various acronyms, possibly including cryptic-looking technologies like OSS, ESD, ALSA, JACK, and Pulse Audio. These acronyms represent a byzantine tangle of conflicting technologies that over time, and due to political reasons or backwards compatibility, have ended up cohabiting with one another. ‘Frankenstein’ might be an accurate metaphor here.

Thankfully, there is a simpler way, which is the combination of ALSA [a high-performance, kernel-level audio and MIDI system] and JACK [a system for creating low-latency audio, MIDI, and sync connections between applications and computers]. The battle-scarred among us have learned to ignore all the other audio cruft bolted on to Ubuntu and just use ALSA and JACK. One can think of the ALSA/JACK stack, the heart of most pro Linux studios, as the Core Audio of Linux and in my opinion Jack should be the first thing installed on any musicians laptop. I’d go so far as to suggest placing it in the Startup Applications so it’s always running.

jackstartup

Qjackctl (labeled JACK GUI) in Ubuntu/GNOME’s Startup Applications Preferences panel.

The ALSA/JACK combination is a little more complex to set up and tweak than Apple’s Core Audio, but there’s a lot of good information online. [Ed.: ALSA, JACK, and the real-time Linux kernel also have some advantages over Mac OS X that can be worth the effort. While JACK has been ported to Mac, Linux has more JACK-aware tools, which is necessary for transport sync. Just as importantly, once configured, you can build rigs with Linux that have greater low-latency performance than may be practical on Mac or Windows. In other words, while it may require an investment of time, it can be both free and better! -PK]

jackdiag_t

This diagram, albeit dated, shows how Jack and ALSA work together. Please note that Jack does currently support MIDI. Click through for full-sized version. Courtesy Jörn Nettingsmeier; used by permission.

Workflow

Over the past ten years, I’ve developed a workflow that has worked well in the studio and on the road. Since I created most of my tools in Max/MSP, they could shape-shift to fit any musical task I encountered. A sound mangling tool I’d written for studio use, for instance, I could then adapt for a performance with Tony Conrad. I modified parts of my performance patch for sound installations. This environment served me well over the years – until recently, when my aesthetic focus changed from using randomness in my work to taking a more deterministic approach. This happened to coincide with my change of operating systems.

I do a lot of location recording while on tour. My rig consists of an Olympus LS-10 digital recorder and an Audio Technica AT-822 single-point stereo microphone. I record at 96kHz/24-bit to a 16GB SDHC card in the LS-10. When I want to audition sound files in the field, I use my netbook’s SDHC reader, renaming sound files directly on the card. I can look at some of the files in Baudline if I need to check for low-frequency rumble or technical anomalies. I have come to use Baudline on a daily basis.

baudlinedesk_t

A typical Baudline session. Click through for full-sized version.

Back in the studio, using the sound editing program Audacity, I remove voice slates, trim heads and tails, adjust gain and EQ as needed, then save them to a project folder. And because I don’t like surprises in the studio, either, this folder gets backed up onto a remote network drive as well as a local USB drive.

audacitydesk1_t

A typical Audacity session. Click through for full-sized version.

Building my sound library takes weeks or months. During this time, I start filling a notebook with ideas, drawings, plans and marginalia, from which a score emerges. I import all my project sound files into the open-source Digital Audio Workstation Ardour, arranging them to loosely resemble the score in my notebook. Once my Ardour session is set up, I move sounds around, try different effects, create new textures by layering, then render and re-import sub-mixes until the piece starts to take shape. I use a KORG nanoKONTROL as a mixing surface. I assign faders, pans and switches assigned to the DAW allowing me to quickly play around with different mix ideas.

ardourdesk_t

A typical Ardour session. Click through for full-sized version.

Once the piece sounds finished, I mix down to a stereo .WAV file at 24-bit/44.1kHz, without using compression or EQ on the mix bus. Tip: mastering engineers really appreciate getting a raw 24-bit master that hasn’t been fiddled around with by the musician. For performances, I also use Ardour and the nanoKONTROL to do an acousmatic presentation. This version of the Ardour session will have compression and/or EQ on the mix bus, since I want the material to sound more polished. As a side note: I am looking into using the mastering tool JAMin [JACK Audio Mastering Interface] for this purpose in the future.

Sayonara, Apple

After ten years of working on Apple laptops, I’ve left the fold. Not only was the expense of owning and maintaining Apple hardware a key factor in my switch, but the operating system had become a frustration to me. Details like not having a tree-view in the right hand panel of the Finder window slowed me down. Ubuntu, on the other hand, feels more like an operating system made for grown-ups. And what’s especially nice is that Ubuntu scales nicely to the expertise of the user. Your cousin the computer geek or your Grandma can install and use Ubuntu and get as deep as they like. Combine this with the recent rash of cheap, powerful laptops, and Ubuntu’s market share is bound to grow.

A Request

It’s important that kernel and audio application developers (1) ensure all audio creation software has support for JACK, (2) improve and update tools for JACK to make it easy for musicians to install, configure, and use, (3) ship distros with the realtime kernel already tested and configured for use, (4) to integrate the real-time kernel patches into the mainline kernel. [Ed.: On each of these points, distributions and kernel builds are steadily improving, partly thanks to feedback from communities like the music production community. The realtime kernel likely won’t be the default, mainline kernel, but it’s important to have well-maintained optional packages at the very least. That doesn’t mean you have to wait for improvements to happen, though, and in future articles I’ll talk a bit about how you can configure your system now to take advantage of this functionality. -PK]

Most importantly, consider paying a subscription to support developers of JACK and your favorite Linux audio software, or, if you can write code, proofread text, write a manual, do a translation, contribute graphic design, or create content; please help by contributing something to the development of the software you use.

I would like to thank Ken Restivo, Mike Rooke, Paul Davis, Philip DeTullio, Jörn Nettingsmeier and Matt Griffen at Canonical Ltd. for advice and inspiration in the writing of this article.

Kim Cascone is a composer, sound artist, touring musician, lecturer and writer. He lives in the San Francisco Bay Area with his wife Kathleen and son Cage.

Links:
http://www.osnews.com/story/6720/Introduction_to_Linux_Audio
http://www.alsa-project.org/main/index.php/Main_Page
http://ardour.org/node
http://audacity.sourceforge.net/
http://www.kokkinizita.net/linuxaudio/
http://www.baudline.com/
http://jackaudio.org/
http://drobilla.net/software/patchage/
http://www.ladspa.org/
http://lv2plug.in/
http://dssi.sourceforge.net/
http://jamin.sourceforge.net/en/about.html
http://linuxaudio.org/
http://www.ubuntu.com/
http://code.goto10.org/projects/puredyne/
http://www.bandshed.net/AVLinux.html
http://rt.wiki.kernel.org/index.php/Main_Page
http://www.pulseaudio.org/
http://developer.apple.com/audio/overview.html

Corrections / clarifications:

Ed.: I originally claimed that JACK Transport sync is not possible on the Mac OS X port of JACK. As kindly pointed out by a reader, this is not correct. JACK Transport-aware applications on the Mac will work.

Subtler issues:

Kim noted two annoyances with the Finder. One is wanting to type paths directly. On the Mac Finder, you need to invoke a keyboard shortcut prior to doing so. On Ubuntu’s default file manager (GNOME’s Nautilus), you can simply begin typing. There was some disagreement about to whether that really constitutes a notable difference, but suffice to say, you do have a greater range of choice and customization on an open source operating system.

Secondly, Kim argued that you could pull out a drive without having to go to a lot of trouble unmounting it first. At least one commenter argues that risks data loss, and given that users may be using something like FUSE to access foreign file systems like NTFS or the Mac’s own HFS+, I don’t yet know what the exact details will be. As I said in comments, however, Nautilus and the command line eject function for me are quicker and more effective than similar unmounting on Windows and Mac, so I still notch this one for Linux. -PK