The Penguin Producer
Be Free to Make Something Good!
The Penguin Producer
Navigation
  • News
  • About
    • Topics
  • Documentation
    • Information
    • Manual
    • Tutorial
    • Tip
    • List
  • Feedback
  • Podcast
    • Feed
  • RSS
  • Facebook
  • Twitter
You are here: Home › Tutorial › Setting up a Studio with Ubuntu
← History and Clarification of Linux Audio
Preventing Self-Connections in Jack Apps, AKA Making Ladish Work with Everything →

Setting up a Studio with Ubuntu

December 27, 2011 | Filed under: Tutorial and tagged with: alsa, ardour, audio, bridge, ffado, freebirth, fstab, jaaa, jack, kxstudio, ladish, ladspa, loopback, lubuntu, lv2, meterbridge, modules, muse, optimization, qtractor, rosegarden, seq24, setup, sysctl, traverso, ubuntu, ubuntu studio, udev

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.

2013-10-11_UbuntuSoftwareCenter(002)

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.

2013-10-11_UbuntuSoftwareCenter

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.

Did you like this article? Share it with your friends!

Tweet

Written by Lampros Liontos

Lampros "Reteo" Liontos is a long-time user of Linux who had discovered the joy of audio in the last two years. His subsequent research of ancient (old) and mystical (technical) tomes of Linux audio lore (documentation) resulted in his decision to make his own, using as close to everyday English as he could manage, and with enough pictures to really help clarify things. Then, he got bored, and decided he wasn't thinking big enough. Now, he has interest in video, graphics, and audio. He also likes to write, but that much should have been obvious by now.

Visit my Website
← History and Clarification of Linux Audio
Preventing Self-Connections in Jack Apps, AKA Making Ladish Work with Everything →

14 Responses to "Setting up a Studio with Ubuntu"

  1. falkTX says:
    December 28, 2011 at 5:58 am

    nice tutorial, although I want to point out 1 thing:
    the 'kxstudio-default-settings' includes most of the work you mention here (includes swappiness, rtc, hpet, raw1394 and log-rotate settings).

    and the jackd package already contains the rtprio and memlock tricks in /etc/security/limits.d/audio.conf

    just a heads up, still a very nice tutorial!

    Reply
  2. Lampros Liontos says:
    December 28, 2011 at 12:07 pm

    You are correct, and I had considered the studio's settings-related package, but rejected it because it didn't just set the tweaks; it also forced a download of KDE. I don't want to download KDE just to set some small tweaks. :P

    And as for Jack installing an audio configuration file, I didn't see that. Updating the article to remove that step.

    Reply
  3. Unkle Bonehead says:
    January 2, 2012 at 4:56 pm

    I am installing Ubuntu 11.10. I was going to keep using Debian while I was waiting for the next Dream Studio. But since all I want is the eye candy and the audio stuff this tutorial will suit my needs just fine!
    Thank you again Reteo!
    And Happy New Year!

    Reply
  4. Lampros Liontos says:
    January 3, 2012 at 1:33 pm

    You're quite welcome, and I look forward to your next episode!

    Reply
  5. AutoStatic says:
    January 12, 2012 at 2:49 pm

    Hi Reteo,

    As a Qtractor afficionado I really have to plug that DAW here ;)
    Also you might want to take a look at the System Configuration Wiki article @ linuxmusicians.com (http://wiki.linuxmusicians.com/doku.php?id=system_configuration). It contains a lot of useful information on how to achieve an even smoother linux audio experience on Ubuntu.

    Best,

    Jeremy

    Reply
  6. Lampros Liontos says:
    January 12, 2012 at 8:16 pm

    Where the site is concerned, I can't argue. As a matter of fact, I will emphasize that site in general: If you want more than what this measly little blog can give, linuxmusicians.com is definitely chock-full of good information and good people with even more information! If you need a link, I have placed all the links for that domain in my links page.

    My only problem with the site is that it seems to be music-centric. For those of us who are interested in podcasting or voice-over (where things like studio setup and gear requirements are vastly different), that makes this site easy to overlook when looking for information. However, guys, if you need to get set up, the people there, including Jeremy here, are knowledgeable and willing to help out the newcomer!

    As for QTractor, the main two reasons I prefer Ardour over all the others for audio recording is that 1: each track creates its own bus, and 2: each bus can have a differing number of inputs and outputs (in the same bus); I have already learned to use the Ambisonics plugins to create surround sound audio, and they play to that feature beautifully.

    Reply
  7. BuyerBrown says:
    July 29, 2012 at 5:45 am

    Whats up Reteo

    Well i got an itch to try this out – and learn about Jack.
    I think this will solve some audio issues im having and give me the control I want – Look forward to seeing ya in the Linux Realems

    Stay Cool and God Bless :)

    Reply
    1. Lampros Liontos says:
      August 2, 2012 at 8:44 pm

      Not much, mah man. Let me know how the project goes; I always enjoy hearing about the Penguin Producers out there making stuff!

      Reply
  8. Samuel Cersosimo says:
    September 12, 2013 at 5:59 am

    Does this still work on Ubuntu 12.04 ?

    Sorry about the timing.

    B.R.

    Reply
    1. Lampros Liontos says:
      September 12, 2013 at 3:15 pm

      It was originally edited with 12.04 in mind. However, I’ve recently used it with 13.04, so it seems to work equally well now as it did when I wrote this. :)

      And don’t worry about the timing; I don’t update as much these days, but I still try to answer questions when I can.

      Reply
  9. MickW says:
    October 9, 2013 at 9:47 am

    Hi thanks for this guide but I am having trouble installing Klaudia as I can’t seem to find it anywhere and although I can see it in a folder it is not showing up in ‘Sound and Video’ on the desktop or in Lubuntu software centre, or synaptic. I have already installed the kdx depositories as per the instructions but now I am stuck! Any help would be greatly appreciated

    Reply
    1. Lampros Liontos says:
      October 11, 2013 at 9:55 am

      Thanks for the heads-up! It seems that klaudia has become “claudia-launcher,” and is now integrated into the “claudia” package, which is itself part of the larger “cadence” suite of tools. The article has been altered to reflect the change.

      Reply
      1. MickW says:
        October 12, 2013 at 9:31 am

        Hi there! Thanks for the reply and the update – I have now managed to install the package but I am still having lots of problems I’m afraid – don’t think my techie knowledge is up to this as I have spent the entire day trying to get it all working together. Thanks anyway for the info :o )

        Reply
        1. Lampros Liontos says:
          October 15, 2013 at 10:42 pm

          What kind of problems are you having?

          Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image
Refresh Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Categories

  • ►Blog (2)
    • ►Previews (1)
  • ▼Documentation (62)
    • ►Information (13)
    • ►List (2)
    • ►Manual (9)
    • ►Tip (22)
    • ▼Tutorial (16)
      • An Ultra-Simple Recording Workflow with the Jack Timemachine
      • Basic Recording Process
      • Bridging the Gap: Using Jack with Non-Jack Apps
      • Creating a Title Sequence with Blender
      • Creating Rolling Credits, Part 1: Credits Page Creation in Inkscape
      • Creating Rolling Credits, Part 2: "Filming" Credits Page with Blender
      • Creating Rolling Credits, Part 3: Using a Video Backdrop
      • Creating Rolling Credits, Part 4: Fades to Black
      • Creating Rolling Credits, Part 5: Musical Backdrop and Animation
      • Homebrew Software Multiband "Fill-In-The-Blank" Toolkit
      • Managing Track and Bus Channels in Ardour
      • Setting up a Studio with Ubuntu
      • Simple Video Editing with Blender
      • Streaming Podcast with Skype Workflow
      • System Preparations
      • Voice-Over Recommendations
  • ►News (13)
  • ►Podcast (6)
  • ►Site Recommendations (1)
  • ►Uncategorized (2)

Communities

  • Blender Artists Community
  • GIMP Forums
  • GIMP Talk
  • GIMPER.NET
  • Inkscape Users Forum
  • Linux Musicians
  • Linuxaudio.org

Hardware Support

  • Alsa PCI and USB
  • FFADO Firewire
  • Linux-drivers.org

Tutorials

  • Blender Guru
  • GIMP Tutorials
  • Inkscape Tutorials Blog
  • Libre Graphics World
  • Screencasters (Inkscape Tutorials)

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
December 2011
S M T W T F S
« Nov   Jan »
 123
45678910
11121314151617
18192021222324
25262728293031

Penguin Producer Tip Jar

The Penguin Producer is an Amazon.com affiliate.

The Penguin Producer by Lampros Liontos is licensed under a Creative Commons Attribution 3.0 Unported License.

Powered by Esplanade Theme and WordPress