In this port I explain how I configured a Digital Audio workstation (DAW) based on Ubuntu Linux running a real time kernel. The idea is to give an overview of what I did highlighting the main problems I found during the process and how I solved them. For now I'm not going into details but probably I will explain in depth some of these steps in the future.
Since I was a kid I've been interested in music and during my life I've played a few instruments. For that reason, in 2009 I decided to create a Digital Audio Workstation (DAW) based on Linux as the core of a small home studio. For many reasons I couldn't finish my project but now (2013) I started again.
Why Linux? I prefer Linux because it's free, you have much more control, it's a true Real Time System and also as a personal challenge. I believe that it's not necessary to spend thousands of dollars in a Mac with hundreds of expensive plugins. I also believe that if I use different tools that the ones being used by 99% of the people making music, it's possible to get different results because of the sound, how the whole system is integrated and how the user interacts with it.
Anyway… long story short… this is my basic configuration:
Before I bought these peripherals I did my homework and I checked Linux compatibility of all modules. I did an extended research before I spent any money.
The 2 big challenges are: tweak the computer to get a real-time OS running smoothly and connect all modules together, specially the iPad.
I still using Windows so I need a dual boot system to use Linux. It was hard to do it because the configuration of my laptop (RAID0 2x128GB SSD) and UEFI (new system that is replacing the old BIOS). After one week I found out that Windows 7 runs together with Ubuntu 12.04.2 (Windows 8 doesn't like Linux… and I don't like Windows 8). I also tried other versions of Ubuntu and other distributions: KXStudio, AVLinux, UbuntuStudio, etc. but I had problems because of my laptop's configuration and my requirements. The only thing to keep in mind is that Ubuntu will need some extra work compared with the "audio" distributions because they were created for audio production (they have audio programs installed and some of them have a tweaked RT kernel).
The main tweaks that you have to do are:
To update and upgrade the system just run
sudo apt-get update
sudo apt-get upgrade
NOTE1: I'm using XFCE desktop environment because it's fast ad compatible with Devilspie which allows you to open specific programs in predefined workspaces (I have 9 virtual desks). Just to keep in mind, nVidia video cards have conflicts with RT kernels. I turned my nVidia card off and I'm using the integrated Intel HD4000 instead.
Have a look to my tutorial How to compile a Real Time Kernel for Linux.
Most of the audio programs can be installed with
sudo apt-get install
The programs that I installed with this command are: cpufrequtils, wine, xfce4, jackd, jack-tools, jack-rack, qjackctl, a2jmidid, aeolus, alsaplayer-jack, ams, audacity, csound, fluidsynth, guitarix, jamin, mhWaveEdit, sooperlooper, swami, vorbis-tools, zynjacku, zynaddsubfx.
Other programs require a manual compilation and/or installation or external repositories. The list of these programs is: Ardour3, calf plugins, Renoise, jack_snapshot.
NOTE2: If you can, please make a donation to the developers of these programs.
I'm not going to get into details but the main program is "Jack Audio" (jackd) which is an audio server that allows to connect audio programs together. This is the core of our DAW so get as much information as you can and get familiar with it. Remember that "Jack Audio" runs over ALSA driver so you need ALSA installed in your system. I think Ubuntu has already ALSA installed.
Some tweaks are required for the system to run smoothly, for instance: governor has to be set to "performance"; a group with real time schedule has to be created; the user used for creating music has to belong to this group, etc.
Akai LPK25 is a small USB MIDI controller that just works perfectly in Linux. It's plug and play. I don't play keyboard but I can say that it feels nice to use. It has a few useful options as arpeggiator (with many configurations) and a sustain button. If you want to try another MIDI controller check if it's compatible with Linux and Jack Audio / ALSA.
This audio interface also works fine with Linux. Focusrite developers work together with Linux developers so I decided to support them buying a Focusrite audio interface. I read that the 2i2 model also works with Linux. The sound is very clean and it has independent volume controls with line/instrument switches. The lights are also quite useful as you get different colours for clean/saturated signal. This audio card has 4 outputs: 2 balanced and 2 non-balanced ones.
These are my first monitor speakers and I'm quite happy with them. They have a good price/quality ratio. Just 2 things to keep in mind: one of the speakers had a factory problem but fortunately a got a new pair of speakers. Second, when I move a window in Linux or Windows (any change on the screen) there is a very quiet noise on the speakers, almost unnoticeable. I'm using the balanced signals form the sound card. I'm not sure if it's the sound card, speakers or something else. It may be normal. Nothing to worry.
I wanted to use "Lemur Controller" to control some programs. Unfortunately the original machines costs about $2.000 and JazzMutant doesn't built them any more. The company changed to Liine and now they provide "Lemur Controller" as an app for iPads and iPhones. Both, the original machine and the iPad application are configurable by "Lemur Editor", another application that runs on Windows and MACs.
I bought the cheapest second hand iPad that I found (iPad 1, 16GB, no 3G, for AUD$200) and Lemur Controller ($52 on App Store). The original "Lemur Controller" uses a wired Ethernet connection but iPads don't have one. The solution offered by Liine is "Lemur Daemon", a service for Windows and MACs that connects the iPad to the computer using Wi-Fi. It creates virtual MIDI ports that can be routed to any application or external device. It also creates a connection between "Lemur Controller" and "Lemur Editor". Check the following diagram:
Well… as you can see "Lemur Daemon" and "Lemur Editor" don't run on Linux at all!!!
I need to connect "Lemur Controller" to the computer for 2 reasons: to create/modify Lemur interfaces using "Lemur Editor" and to control audio programs. You can create/modify your interfaces with the iPad's interface, but it's much easier to use "Lemur Editor". And for controlling programs… these are my attempts to connect "Lemur Controller" to Linux:
I bought an Apple Camera Connection Kit (CCK) for $10 and a $6 Chinese USB-MIDI interface on eBay. Then I did the following connection:
Incredibly it worked straight away. However after using "Lemur Controller" for a while I realised that some MIDI messages were lost. I confirmed that using Ardour3 MIDI Tracer. I think (not confirmed yet) that the problem is the USB-MIDI interface.
I bought a "Roland UM-ONE" USB-MIDI interface to replace the Chinese interface mentioned in the previous attempt. It didn't work at all…
I installed Virtual Box and I created a Windows XP virtual machine in Linux. Neither "Lemur Controller" nor "Lemur Editor" run because Direct3D was not found. The thing is that Virtual Box creates a virtual video driver which is incompatible with DirectX. For some reason "Lemur Daemon" and "Lemur Editor" need DirectX. I tried to solve this problem in many ways but I couldn't do it.
I tried to create a Mac virtual machine in Virtual Box but I couldn't install MacOSX. That's something that I have to solve in the future.
I tried to run "Lemur Controller" and "Lemur Editor" using Wine but I had the same problem with Direct3D. Again, I tried to solve this problem in many ways with no success.
Long story short, I bought an Asus EEE netbook for AUD$100. Remote desktop shows the same problem with Direct3D. I can locally control "Lemur editor" from the netbook but screen resolution is so low that I can't see the whole interface and I have to scroll up-down-left-right which is absolutely useless.
OK… I decided to leave "Lemur editor" on the side for now and I'll focus to control some programs with "Lemur Controller". I connected the iPad to my home's Wi-Fi and I set up the IPs and ports to send OSC messages to my computer. Then I installed Pure Data Extended and I created an OSC MIDI bridge. So… now I'm sending OSC messages to the computer and I can choose to use them directly or to convert them to MIDI messages. As far as I have tested the system it works OK. Probably it's a good idea to have a dedicated Wi-Fi connection between the iPad and the computer.
A few things left: how to install OSX in Virtual Box, how to use "Lemur Editor" in Linux, explain how to use session management and how to configure a RT kernel. If everything goes well I'll post more detailed information about these topics.
NOTE3: I'm using a small powered USB 3 hub to keep everything connected so I just need to connect one cable to my laptop. I found a 7 ports one on eBay for UAD$32. All devices connected to the hub work perfectly well.
NOTE4: There is a device called iConnect which might be a solution for connecting Linux with the iPad. However is quite expensive (about $150). If someone has experience with that device it would be nice if he/she can share his/her experience.
NOTE5: Some programs that you can easily install with apt-get are not up to date. I have decided to compile some of those programs by myself to get the latest updates but it requires extra work.