Setting up a Studio with Ubuntu
After a bit of mucking about, I’ve found that most of the Ubuntu-based media distributions work on (and sometimes requires) a stock Ubuntu install. Add to this the fact that the Loopback device required for the Jack-Alsa bridge seems to be already present in the system, if not actually enabled yet, and that Ubuntu is the standard user distribution of Linux, and we have here the recipe for a possible tutorial. It’s not enough for me to give up my beloved Gentoo, but with the magic of VirtualBox, I can at least run a tutorial for getting set up.
Now, I’ve had some recommendations from friends who suggest I make a distribution for those who are interested. I wont, not only because this is mainly redundant (Ubuntu has four studio-centric distributions already), but also because I would be in the role of authority. I am not an authority on the multimedia industry. I’m just an outsider learning the field one tiny piece at a time, while focusing on Linux-centric means to accomplish things Windows and Mac users can do on a regular basis, and sharing it as I go.
I will use the 32-bit version of Ubuntu, since we want to have seamless access to VST plugins on Ardour (which won’t work on the 64-bit version). However, considering the memory configurations of today’s computers, the 64-bit versions might also be useful. Feel free to substitute the 64-bit version of Ubuntu if you have more than 4GB of RAM on your system.
One thing, however: I recommend that, whatever you do, make sure you have a lightweight desktop running in place of the Unity desktop; the heavier the desktop, the less leeway you have in the use of your tools before xruns (dropped audio packets) appear. My personal preference is the Awesome WM, but you don’t have to get that crazy if you don’t want to; LXDE should be enough to work from.
Research the Gear
While Ubuntu has a lot of support for hardware out-of-the-box, the hardware it tends to support is more mainstream consumer hardware, as well as the prosumer stuff that goes to the high end of consumer gear. Professional gear tends to not be as well-supported, as they already have a niche in Windows and Mac, and their developers don’t see a need in Linux support. Sad, but true.
So, if you have gear already, check to make sure it is supported. If it isn’t, then your choice is either to stick with your current operation until the support is there, or collect some gear that is compatible. For those who are just starting out, they may have an easier time, as they will have the freedom to research for good, Linux-compatible gear.
For PCI and USB gear, look for your interface in the Alsa Device Matrix.
For Firewire gear, you will want to research for FFADO support.
If the device is supported, at least enough for you to record and playback, then you can continue with the rest of this article. If your gear is not supported, and you don’t want (or can’t afford to) change to something compatible, then the rest of this article may be interesting for in-system editing, but if you want to record, you may want to stay with your current setup.
Install Ubuntu Normally
Installing Ubuntu is pretty easy; just put the disk in, boot up, go for the default settings (provided we are installing on a clean drive… otherwise, exercise caution and discretion), and then just answer the questions as they appear. Make sure that you allow updates to be installed during the initial process, if you have the network connection.
At this point, you should have a clean, virgin (?)Ubuntu distribution to work with. Since Ubuntu is using Unity by default, we’ll just go along with it. If you choose to use the “classic” view, you should be fine; I don’t plan to be focusing on the desktop UI at this point… My personal UI tends toward a minimalism that pretty much depends on the command line for anything other than the fundamental applications (command line, browser, mail, etc.) to be started. If you’re using unity, then I do recommend that you change the tray to accept all icons.
I am unable to locate the Synaptic package manager at this point, so that will be my first step; I just like the interface better, and it will tell me if there are issues with the repositories, rather than just not show them because they failed. This isn’t required, but your mileage may vary.
Preparing the KXStudio Repository
In addition to the stock repositories available for Ubuntu, I also intend to add the KXStudio repositories. These provide several applications not available in a stock Ubuntu install, which we will want to have, as they will make managing Ladish sessions much easier, and provide some of the best eye-candy for launching audio applications in Linux.
In order to prepare the repositories, we will need to add the following to the “Software Sources” in the Ubuntu Software Center (The option is in the “Edit” menu):
ppa:kxstudio-team/kxstudio
Once the repository is installed, run the Update Manager to make sure your system is up-to-date. Then, we go back to the Software Center to install the “kxstudio-repos”, which will install all the kxstudio repositories, and from then on, keep them up-to-date.
This will add the repositories and the PGP keys, ensuring everything needed is in place for a clean installation of all the tools available from the KXStudio team. Once you have added the repositories, run the update manager to make sure everything on the system is up-to-date.
The Ubuntu Studio packages are actually part of the main repository, so this is all we need to have the complete collection of applications at our disposal.
I generally prefer not to install the meta-packages. It may be satisfying at first to see a list of applications that can take a week to scroll through, but eventually, all that clutter will become a chore, rather than a benefit, and I find that I don’t even use most of those items, as they are simply redundant alternatives. So I try not to install things until I’m actually ready to use them. You may feel differently, so it’s probably your choice.
At this point, we have all necessary PPAs installed to take advantage of the good bulk of audio apps we need to use. Even so, however, some programs will not be available in the software center. This is usually not a problem, as they can be installed directly from their respective websites when we need them.
The main reason we want to add these repositories is the Claudia Launcher. Designed by the KXStudio team, this tool will scan the system, and present a catalog of currently-installed audio programs, plugins, and utilities that can be run. This way, you have a graphical means of adding applications to the studio or room without having to memorize command names or option switches.
Installing the Core Studio Applications
At this time, we have prepared the repositories, now we get to the fun part… picking out the toys we want to play with. Oh, I mean, “tools we intend to use.” Spoilsport.
Jack Infrastructure
Before we get to the applications, we do need to have the backup utilities to tie them together. This obviously includes Jack, as well as Ladish and other backing utilities.
This is the core reason I advised you to include the KXStudio repositories in the setup. In order to get a full infrastructure prepared, we want to begin by installing “Cadence.” This will install Jack, several session management programs, and a large number of basic tools… pretty much all the infrastructure you’ll need to use the more prominent Jackified tools like Ardour or LMMS.
Metering and Analysis
Jack and Alsa Audio Analyzer (JAAA)
The next tool we will want to add is JAAA, the “Jack and Alsa Audio Analyzer.” This can give you a splendid tool for spectrum analysis, allow for locking the spectrum at their top levels, average them over a period of time, and can allow you to expand and contract both the frequency and amplitude ranges. as needed for detailed review. This can be very useful in determining the settings on plugins that will affect the audio.
Meterbridge
After Jaaa, we will want a more basic tool, a volume meter. Meterbridge actually has several forms of meter, including analog-style (rotating needles), digital peak meter, and even an oscilloscope view. And in the view below, trust me, the icon doesn’t do the actual moving-needle VU meter view justice.
Plugins
No matter what the application you will use, most Linux-compatible tools will have support for LADSPA and Lv2 (LADSPA version 2) plugins for all kinds of audio manipulation, and some will allow the use of VST plugins, giving you a massive boost of compatible plugins. So, it helps to have a collection on-hand when you need to make modifications.
In this case, I can probably agree with the studio metapackages… so go ahead and install “kxstudio-meta-audio-plugins” and “ubuntustudio-audio-plugins.” These will also install the supporting tools that will allow all these plugins to run… not only as part of other applications, but as standalone Jack tools.
DAW
Surprisingly, by choosing the meta-packages, we have gotten a good infrastructure installed, including synthesizers, samplers, effects, plugin hosts, a basic recorder, an Alsa-Jack MIDI bridge utility (no special configuration is required for the MIDI tool), and even a couple drum sequencers (hosts for “drum” plugins).
Now, we get to the basic meat. The digital audio workstation, commonly referred to as the DAW. In Ubuntu, you have the choice of Ardour and Traverso.
Sequencers
The sequencer space in Linux is much larger, and includes classic sequencers like Rosegarden, Muse, and Qtractor, as well as realtime sequencers like Seq24 and Freebirth. I like Rosegarden during those times when I choose to make music, so that’s what I choose.
Optimizing the System
There are several tasks we need to undertake in order to ensure that our fledgling studio box will have all the performance and features we need to complete our originally-desired goals. We needed to wait until after the core installs, because some of them will set important settings.
A primary example would be the “audio” group; this allows your account to have realtime access to the system, which is very important for low latency. What we need to do at this point is ensure your main user account, the one you will be working with audio on, is added to the “audio” group. That’s easily done with the following command in a terminal window:
$ sudo addgroup (username) audio
Performance Steps
Now, you have probably seen the “Preparations” article, outlining several steps that need to be performed to maximize your performance on the system.
/etc/fstab
Add the “noatime” option to filesystem entries (ones with “ext4″) . This should happen in the column after “ext4″, such as replacing this:
UUID=(uuid#) / ext4 errors=remount-ro 0 1
…with this:
UUID=(uuid#) / ext4 noatime,errors=remount-ro 0 1
/etc/sysctl.d/30-proaudio.conf
Create the file with the following lines:
# Studio Performance Tweak vm.swappiness = 10
This will ensure that memory swapping will take longer to happen, resulting in fewer events causing XRuns to occur.
/etc/udev/rules.d/50-audio-timing.rules
Now, we want to make sure the clock devices are directly accessible by people in the “audio” group.
KERNEL=="rtc0", GROUP="audio" KERNEL=="hpet", GROUP="audio"
Alsa-Jack Bridge Setup
The performance settings have been completed at this point, now, let’s get the groundwork taken care of for the Alsa-Jack bridge. This way, it will be ready to go once Jack itself is up and running without any further need for configuration.
/etc/modules
Now, as mentioned previously, Ubuntu has the Alsa Loopback driver available, if not active on startup, so we will see to it that it is set.
snd_aloop
/etc/asound.conf
Next, let’s make sure that our system has the custom Alsa devices needed for the Alsa-Jack bridges. It might have needed to be done by hand before, but I now provide the files needed to quickly get set up.
Now, something to note: the “sudo” command does not handle redirection as the superuser; using that command will try to write to the destination file as the normal user. So we first need to log in as the administrator. Keep in mind that in this state, anything you do can have system-wide consequences, so be careful while logged into a sudo session.
$ sudo -i
Now, you want to download the Alsa-Jack Bridge Kit, and then unpack it…
# tar xvf Jack-Bridge-Kit-1.tar.bz2
Next, enter the directory created…
# cd Jack-Bridge-Kit-1/
…and then add the asound-sample.txt file to the end of the /etc/asound.conf file.
# cat asoundrc-sample.txt >> /etc/asound.conf
/usr/local/bin/jackloop_*.sh
Finally, copy the *.sh files to /usr/local/bin, and make them executable.
# cp jackloop_* /usr/local/bin/ # chmod 755 /usr/local/bin/jackloop_*
Now, the preparations are done, and the system is tweaked to allow realtime performance to members of the audio group, and not do anything sudden to interfere with any audio streams being worked on. Additionally, the Jack-Alsa bridges are now in place for use; all you need to do to launch them is launch jackloop_1.sh, jackloop_2.sh, jackloop_3.sh,or jackloop_4.sh.
Finally, make sure you leave the sudo login; you don’t need it anymore, and keeping it running is dangerous.
# exit
Conclusion
At this point, you are free to choose your tools as you desire them. Whether it’s Skype for phone calls, Mixxx or the Internet DJ Console for broadcasting playlists, or Blender or LiVES for video editing. This system should work well as a starting platform for finding your Linux Production feet.
Who knows? You might end up making a lot of good things indeed!
NOTE: I have also discovered that this process works as-is for derivatives as well as stock Ubuntu. At this point, it’s pretty safe to say that direct descendents of Ubuntu should have no problem adopting the above steps to have everything installed.
Additionally, It was mentioned by falkTX that the limits.d configuration file was already made automatically when Jack is installed, so I removed that step, as it would be redundant. Thanks, falkTX!
Update: After trying Ubuntu, it was found that it was too dependent on PulseAudio, and PA was too system-hungry to allow any decent Jack performance. As of right now, I’m recommending the Lubuntu distribution. Since Lubuntu is a derivative of Ubuntu, it uses the same packages and allows everything on this page to be performed without alteration. However, one additional recommendation: Remove PulseAudio. This is the biggest performance booster I’ve seen.
10-11-2013 Update: As of 13.04, the “klaudia” package is no longer in the repository; it has been integrated into the “claudia” session management program, and is now called “claudia-launcher.” Additionally, Claudia is part of a larger suite of tools known as the “Cadence” suite. The article has been changed to reflect this alteration. From now on, the app to download is “cadence”, not “klaudia”. Additionally, the KXStudio repositories seem to have an easier set of steps for setting up, which I have also updated in this article.
Leave a Reply