Wednesday, April 06, 2016

Reaper, Linux, and the Behringer X-Air - Complete Studio Solution, Part 1

Introduction and Rationale

This is part one of a major effort to document my experiences with recreating my home studio, entirely using Linux.  Without getting into too many of the specifics, a few months ago I decided that I was unhappy with Windows' shenanigans - to the point that I was ready to make a serious attempt to leave it behind.  For most in this situation, the obvious choice is to switch to Mac OS.  With its proven track record, support, and options for multimedia production, it is naturally the first alternative to consider if your goal is to simply use something other than Windows.

For me the choice was not so simple. I despise Mac OS and, in general, the goals and philosophies put forth by Apple in an effort to ostensibly provide users with an "easy" working environment.  It does not help that I have also failed to find any aspect of the Mac OS UI intuitive, but I realize that this is a subjective matter.

With my IT background and user-control* favoring outlook, I decided on Linux.  I did this knowing that the road ahead would be paved with many bumps. The Linux audio world is a complex one, and while most (if not all) of the information to do what you want is available, it generally requires a lot of knowledge and a pioneering spirit to get there.  Hopefully this post will help you with the former, but the latter is something that you should expect to bring.

The spoiler that the impatient are probably hoping for is that, at the time of this writing, I have been able to achieve 99% of the functionality that I had with Windows.  The remaining 1% is functionality that I will either be able to achieve with a little more time investment, or functionality that I really didn't need that badly to begin with.

*I am a fan of the free software vision evangelized by Richard Stallman.  However, considering the availability of hardware and software, this project is by no means anything that would be considered "free" in his vision.  I have settled on a solution that consists of  the "best compromise" between what I found to be available, and the functionality I needed.  I would consider it to be significantly improved over the previous level of "freedom" I had when running Windows. 

Overview - Hardware and Software Components

Naturally there are some other major particulars involved with the setup I went forward with. Mainly:

    Behringer XR18
  • The relatively recently introduced Behringer X-Air, primarily due to its hardware flexibility and manufacturer-stated support for Linux (as well as Android, and basically ALL other major platforms).  In particular, I chose the XR18 based on the coinciding factors of cost, portability, number of channels, number of those equipped with XLR/TRS combo-jacks, and other features.  However, this project could presumably be used with any of the Behringer X-Air products with only minor modifications to the configurations, based on the specifics of the hardware.  As a USB audio device, I had concerns as to how this device would perform in terms of latency, but with sufficient tuning, I have found it to be a suitable even in situations involving DAW post-processed talent foldback. 


    Reaper - a powerful, low cost DAW that can run great on Linux
  • The Digital Audio Workstation software REAPER, which has been around for a decade, but is still something of a cult interest for whatever reason.  It is extremely powerful, flexible, and makes no assumptions about how you would like to approach multimedia production.  The cost is minimal ($60**) when compared to other DAWs of similar function (Logic, Protools).
**Granted, this is the "discounted" license, which most readers of this article will qualify for.


  • Reasonably powerful PC workstation
    • I won't spend a lot of time on this topic.  Reaper itself has very modest hardware requirements, which you can read about.  However, considering the layers required and the cost of PCs vs. performance and capacity, I do recommend that you overbuild your workstation to meet at least the following specifications:
      • Intel Core i5 quad core (64 bit) or equivalent processor
      • 8GB RAM
      • 1 Terabyte drive
    • In my case, the system I used has the following specifications:
      • Intel quad core Xeon W3565 @ 3.20GHz
      • 512 GB solid state boot drive
      • 4TB (2TB SSHD x2) w/ hardware RAID 1 data array
      • 16 GB RAM
Let's talk about some of the other key ingredients that will be necessary to create our complete studio solution.

Ubuntu 14.04 LTS, 64 bit

This is a very popular desktop-oriented Linux distribution that has "long term support", and was fairly current at the time I pursued this effort.  Certainly other distributions of Linux would be usable, but this is the one I will use as the basis for this project's examples.

JACK

In the world of Linux Audio, there are several layers of audio systems available in order to accomplish delivery of digital audio to and from your audio hardware.  However, if you want to do any serious audio production, JACK will be an important part of your complete breakfast.  There are two versions of JACK available, and in this project we will be using JACK 2.

WINE

So here we must present what will come as a fairly off-putting fact: REAPER doesn't ACTUALLY run natively on Linux,  If you want to run it on Linux, you must use the WINE Windows Compatibility layer. This is essentially a translator between Linux and Windows applications. It was off-putting enough for me that I resisted this experiment for years.  While I have found many simple Windows programs able to run well on WINE, to me there were many concerns, including performance, architecture support, reliability, and many other things.  But have no fear.  If you have all of your ducks in order, REAPER does run on Wine, and it runs very well.  

WineASIO

Since REAPER uses the Windows-based ASIO audio system, and Linux will use JACK, we need a bridge to allow these two to exchange audio.  WineASIO provides a seamless bridge that satisfies this need.

Other Supporting Linux Packages 

In support of the above, we will need to install several other components on our target Linux machine in order to configure and otherwise facilitate your most common needs.
  • ALSA - This is the lowest level for sound interfaces to connect to applications and other audio layers, at least it has been for many years. It is how Linux interfaces to your audio devices.  ALSA actually provides all of the basic functionality one needs to use an audio device, but there are other audio systems which can enhance this functionality, such as JACK and Pulseaudio. In this project, these systems will sit on top of ALSA, and for the purposes of following discussion, we will infer that connections to the hardware device itself are done through ALSA.
  • Pulseaudio - In the context of a strictly recording-studio oriented computer, this component is technically optional. However, in my circumstance, I use my computer for daily tasks such as web browsing and VOIP communications, and I did not wish to force all applications, such as browsers, simple audio players, headsets, webcams, etc. that require the use of audio to interface with JACK.  JACK, while very low latency and highly configurable, is not a friendly beast, and does not outwardly provide multiple applications the ability to coexist on a machine with a single main audio device, or multiple audio devices serving a single application.  This is a strength of Pulseaudio (although I certainly have a wishlist of how it could better serve these endeavors).
  • pulseaudio-module-jack - We will be using JACK to connect directly to our audio interface (the Behringer XR18).  Unfortunately, this is at odds with Pulseaudio, which, in the most common configuration (as in a stock Ubuntu distribution), also expects to connect directly to the hardware.  This cannot be.  The jack module allows Pulseaudio to instead connect to the audio interface via JACK (which connects to the audio interface via ALSA. As I warned you, the Linux audio world is complex).
  • pavucontrol - Pulseaudio is a powerful way to manage applications and audio devices, but to use its strengths, we need a way to control it.  Pavucontrol is a graphical user interface which allows us to decide how audio and devices should be connected.  Again, this is technically optional if you are not planning to use Pulseaudio for convenience applications.
  • qjackctl, and cadence - As previously mentioned, JACK is sort of an unfriendly beast, and we will need these tools to help wrangle it to serve our needs.
  • linux-lowlatency - When working with audio devices in a recording studio environment, you will inevitably need the lowest latency possible.  The default kernel in a desktop distribution is designed to balance performance for multitasking.  This package is an easy way to replace the default kernel with one that is well suited to live audio production.
  • Behringer X-Air-Edit - This is a program provided by Behringer to control the XR18 (or other X-Air interface).  It is available as a native Linux executable. It will be the equivalent of a patch panel within the X-Air hardware itself.
This concludes part one .  In the next installment, we will get into the details of each of these components, and how they will individually serve our needs.

Friday, January 01, 2016

Windows 10 and hardware incompatibility

A few months ago, I replaced my laptop and my desktop.  The move was motivated by a need to reinstall the OS (Windows 8) due to slowness and broken system components.  My desktop was particularly nasty - the Windows update mechanism broke, causing it to take 3 hours to boot up.  I spent the 2 months leading up deftly avoiding reboots, lest I lose a half-day of productivity.  Reinstalling the OS is somewhat traumatic, as I have lots of configuration to do, so I decided that I might as well update my hardware as well.  I also decided 2 other things:
  1. Try to switch away from Windows dependency as much as possible.
  2. For things that require Windows, try Windows 10, since it will eventually be the only Windows choice anyway.

Linux

On both my laptop and desktop, I am running Ubuntu 14.04 LTS - and I have to say, I am doing remarkably well.  To my amazement, I can still do all of my mixing in Reaper, on Wine.   The MOTU 896 FW interface is another story - Apparently MOTU is not friendly to Linux, so I have gotten rid of it and gotten a Focusrite Sapphire Pro 40 instead.  

There are a few things I need Windows for - such as Quickbooks, Corel Draw, Sketchup, Vegas, and some apps I need to run for development work... But for now I am doing okay by running these things in a Windows 7 Virtualbox VM.

Windows 10

I have also set up dual boot to Windows 10 (on demand, not the default) on my desktop and laptop.  I wish I could report as much success with my Windows 10 tests.  Unfortunately, I have had no joy, due to the following issues thus far:
  • Touchpad driver in my new HP Spectre x360 is buggy (jumpy and misses clicks). No fix found (Note: this may seem minor, but stuff like this really pisses me off, and reinforces the fact that paying top dollar for a laptop doesn't mean everything is going to work right, or even better than a cheap laptop).
  • Behringer X-Air audio driver is buggy (audio interface shows up intermittently, and sometimes stops responding in the middle of a recording). 
  • MOTU 896 doesn't work on Windows 10 either.

All told, these issues are significant the point where I will have to roll back to Windows 7 or 8 until things settle out a little more. 

Sweetwater.com has published this list - sort of a "state of Windows 10 compatibility" for various recording hardware.  As of now, it's rather bleak - with some pretty notable entries not being compatible at this time.  But I suppose if you are a "real recording engineer", you only use a Mac anyway, right? (Bleahhhh...)

It is pretty clear that, despite Microsoft's big push to roll out Windows 10, there are hardware vendors who are just not ready.  If you are on the fence and depend on a lot on certain hardware, make extra sure that everything works perfectly before you plan to leap.  However, since that's probably a lot of trial and error, I would just hold out as long as possible, until the hardware vendors get a chance to catch up.

Bonus tip:  You can take advantage of Microsoft's free Windows 10 upgrade offer without having to switch! 

I may go into more detail in another post, but here are the steps in a nutshell:

  1. Temporarily install a blank hard drive in place of your existing hard drive.
  2. Install a fresh, stock Windows 7 or 8 onto it (must be the exact version that came with your computer), and activate using your product key.
  3. Upgrade to Windows 10  - this will create a NEW product key associated with your hardware fingerprint, and stored on Microsoft's servers.  If you ever want to install Windows 10 on this computer in the future, it will use the same product registration automatically. 
  4. Remove the drive and replace with your original.  You don't need to keep Windows 10 installed on the spare drive, but it may be handy.
  5. Switch to Windows 10 whenever YOU want - even after the free upgrade deadline.

Thursday, May 21, 2015

Are these exhaust pipes? No, they are DIY pannier guards!

These "exhaust pipes" will hold your panniers back AND give you 5 extra horsepower! 
As many others seem to have (according to posts I've read in forums), I've been plagued by the issue of my pannier bags curling inward and getting hung up in the spokes.  This seriously almost drove me insane, slowly over the course of two seasons.  It would be fine until I hit a bump, and then it would be mayhem.  Eventually I followed the popular advice and got myself a different rack with a "dogleg", or put more simply, a sweeping member that extends far enough back and down that it holds the panniers away from the wheel.

Well I was back to square one earlier this year when I installed the Blackburn EX-1 rear rack.  This is a very popular rear rack, but unfortunately is not compatible with my panniers.  The reason I am using this rack is that it is the only one compatible with the Copilot Limo child bike seat.

Copilot Limo Child seat, and test child
Incidentally, it is a great system.  The seat sits very low maintaining a stable feel, while being comfortable and protective - both behind and to the sides.  The seat is installed and removed very quickly, which makes impromptu bike rides possible.

Unfortunately, since the bike seat was one of three total rear attachments (panniers and milk crate being the others), I now had to figure out what to do about my panniers, and getting a different rack was not an option.  Some people suggested lining the inside of the panniers with something hard, but I already tried that and it made no difference (in fact it probably just made it worse).  Here's what I finally came up with:
It's just 1/2" pvc pipe and zip ties. I used an elbow piece to keep them from sliding out of the zip ties. Each pipe is attached in two places: a leg of the bike rack, and the seat stay.  This prevents it from moving up or down, backwards or forwards.  They stay put, out of the way of everything, and can even be slid out easily if you don't need them.  They work VERY effectively, cheap, and easy to do.  Hit all the points on my checklist.  If appearance is an issue, they could be painted to match the rack (or hey, put "chrome tips" on them if you want to go full hot rod!)

Hopefully this will help someone who is going through what I did.

60 mile trip on my electric bike

Early on a beautiful Sunday morning, I packed up and headed out on a 60 mile trip.  It was a personal range record.  I planned it carefully (perhaps more so than necessary), making sure I had calculated my energy budget and arranged for basic contingencies. Tools, Spare tube, charger, good nav, etc. I rode on the amazing Champlain Bikeway down to the Basin Harbor Club.

View from Greenbush Road, looking east across Charlotte at Mt. Philo

Although it was somewhat chilly when I left, by 10am it had warmed to the mid-70's, and continued to heat up throughout the day. Besides being a little overdressed,  everything worked perfectly.  I was maintaining a very steady 17 mph, and lightly pedaling about half the time.  This resulted in an average of about 18 watt-hours/per mile, which was very conservative.  At the halfway point, I had used about 40% of my ~1300 wh battery pack.
At the 30 mile half-way point, the bike and I rested comfortably beach-side at the Basin Harbor Club.

When I arrived at the Basin Harbor Club's beach, two enthusiastic young staff members ogled my bike, and we talked at length about the build. As luck would have it, they had recently taken delivery of 10 fleet electric bicycles for the purpose of rentals for the guests. I got to check them out - they were Evelo Auroras; 250 watt mid-drive models with NuVinci hubs. I was really impressed - lightweight, versatile, and an excellent choice for the uninitiated electric bike user.  Plenty of torque, and a top speed of 25 miles an hour (with pedaling).

On my way home, I stopped for lunch and chatted with a few diehard hard road-bike folks. Fully outfitted in their exercise gear, they commented that I "must be hot in that jacket and long pants".  I tried to explain to them that it was useful for higher speeds, in terms of safety and staying warm, but I'll be honest - it was difficult to explain.

Continuing, on I stopped at my friend Steve's place, the ADV garage, and got to do some cool work on a BMW motorcycle project that he had going. Finally, I was on my way back home.
Throughout the trip I did quite a bit of pedaling, in fact much more so than I really needed to. By the time I got home, even though my 52v battery pack was just under 47 volts, I still had almost full power at wide open throttle. It's difficult to determine how much further I could have gone, but I was definitely not out of energy by any stretch.

Cycle Analyst after the trip was completed (no load)
There were some slight differences in the report from B.iCycle, my Android app for GPS tracking:
Trip time:03:51:54
TripDistance:59.0 mi
Trip calories:4260 kcal
Average speed:15.2 mi/h
Maximum speed:29 mi/h
Climbed altitude:2875 ft
Bike type:Mountain bike

This trip taught me a few lessons, including the following: 
  • Wind and terrain make a huge difference in how much energy you will use in a trip. If there is wind or hills, it will reduce your efficiency - either on the way there, or on the way back.  Regen braking and/or a tail wind can help, but they will never fully compensate for the efficiency losses in the other direction.
  • Also, the most limiting factors in the practicality of a long trip actually come down to things that are not technical at all - Mainly, saddle soreness and chaffing. By the time I got home, I wasn't laughing at those road bike guys' outfits at all.

Saturday, May 16, 2015

Electric bike run up Mt. Philo

Over the last few months I have significantly upgraded my E-bike.  Replaced the old battery (along with its horrible, self-sabotaging BMS), and more recently, upgraded to an Infineon controller, and added a Cycle Analyst.  Sometime I will give a full rundown of the bike's configuration, etc., but that will be another post.  For now, here are the specs:

EM3EV 48V triangle battery, 25AH, Samsung 29E Cells
Infineon 4110 9 Fet Controller w/ regen
Generic Direct-Drive Brushless Motor off eBay
Cycle Analyst v2

E-Bike sitting high atop one of the Mt. Philo lookouts


It was a good day for a ride, and I'd been planning to do this for a while.  Mt. Philo is located in Charlotte, VT and has a car road that is a 968 vertical climb to the top.  My father-in-law's place is right nearby, so I had a convenient way-point for recharging as well as s place to work on something if I had a failure.

Track from my GPS as I rode up, and then down the Mt. Philo motor road.


I headed out in the morning, and rode about 11 miles (using 9AH, just under half of my battery charge) to my Father-In-Law's place.  After charging for about 2 hours, I headed up the mountain.


The ride was, overall, pretty smooth. There was one trip up at a notably steep portion, wherein I ran out of steam and didn't have time to downshift.  You can see me stop the bike in order to get it into the right gear.  I would say about 1/3 of the climb was only possible with my pedaling.  The weakness in the setup was definitely the direct-drive hub motor, as that is not designed for serious hill-climbing.  It was still fun to put it to the test.

The controller and wiring was (expectedly) pretty warm, but everything was in good shape.  No blown fuses.  Used about 2.6 AH  (2.4 after regen from braking on the way back down).  Hub motor was hot, but didn't burn up.

Here's the trip back down, doing lots of regen!  Seriously, I would NOT have wanted to attempt this before I had regen, solely due to the amount of brake pad wear that would have been involved.  With the regen, I barely had to use my brake pads at all.  It was also somewhat more comforting knowing that I had two separate braking methods.



And the stats from the Cycle Analyst after it was over:


Tuesday, January 27, 2015

My Solidoodle 4: One year later

I've had the printer a full year now, and I would say that I've printed at least couple hundred things.  I've downloaded things from Thingiverse, designed my own parts and prototypes, and overall gotten tons of good use out of this machine.  Here it is printing a battery case for my Hubsan X4 quadcopter right now:


My only complaints are: 

  1. The Y axis, which consists of a bar on either side of the machine, is a real pain to keep from binding up (and before you ask, yes I've done all the procedures to equalize tension, align, lubricate, etc.). When it binds up, I get infill gaps.  I run through aforementioned procedures and it's good for a few prints until I start getting infill gaps again. 
  2. The X axis carriage seems to have an some kind of uneven incline, causing prints not to stick as well to the mid-left side of the build platform.  The adjustments on the build platform don't help because the incline is uneven, thus the issue is only over a small part of the platform, away from the edge.  I haven't found any procedures to address this. My only guess is that I need to replace the horizontal aluminum rods, as they must have somehow gotten bent.  
  3. I have never been able to successfully print anything close to 8".  There is a limit around .25 - .5" from the edge of the build platform that, if hit, causes the belt to skip. If this happens it not only ruins the job, but I have to disassemble and realign everything or subsequent prints will come out all screwed up. It's a total nightmare and must be avoided.  I would not buy this printer for it's build platform size.

Besides that, the stock filament holder situation lead to a lot of failed print jobs early on.  Filament would always fall off the side of the reel and get hung up.  There are a lot of ways to fix this fairly easily though.  (I printed some reel clips that do a good job of keeping the filament on, but they are a pain to put on every time and are easily lost).



My friend recently got a Replicator 2x, and it's awesome.  A lot more expensive, but probably what I should have gotten.  Then again, 3D printing is still in its early stages, and as they say... the grass is always greener on the other side.

Wednesday, September 24, 2014

Door-actuated space heater power lockout

Here's a little project I did last night:

Power strip modified for dry-contact switching

Magnetic switch on the door
I'll try to keep this short: due to some insulation issues in the garage under the second floor, Henry's room gets kind of cold in the morning.  This is not compensated by the house thermostat because it's in our room and we sleep with the doors closed.  So we use a little electric space heater to regulate the temperature in Henry's room at night.  With this comes a couple of problems:


  • Heater can be left on in the morning
  • If the door is open, the heater then runs open-loop and tries to heat the rest of the house 
  • The heater will run all day long, if it's set to even 1 degree above the "house" temp.  
  • This costs over $.25/hour
  • It's also (more of) a fire hazard since the heater will potentially be running when no one is in the house
I thought of a bunch of different ways to solve this problem.  Sure, go ahead and tell me about how the best way is to "turn the heater off when it's not needed".  Great, it's not going to happen. The next option I picked is the one that, to me, made the most sense.  Basically the heater power is disconnected when the door is open.  Since the door is always left open during the day, the heater won't run, and even if the door is closed, it's fine since the heater won't run "open-loop" (indefinitely).

To do this I modified a power strip and replaced one of the outlets with a 20A solid-state relay.  These relays are crazy - totally isolated and able to handle a lot of load. Since there aren't any moving parts, they don't wear out and you can switch them with very little current.
Solid State Relay



I wired two of the power strip outlets to the "load" side of the relay, and then installed a 9v battery and some contacts to the side of it.  Then I installed a magnetic switch on the door which will switch the 9v to the control side of the relay.  I was really careful to do everything really cleanly, since this is going to be in my kid's room.  (Don't want some wire  to come off and electrify the power strip case to 110v or something). So it took a couple of hours to build, but I am really happy with the result. It's almost invisible in the room and it works like a charm.

What does Suno mean for us producers & musicians?

 I've been thinking about this for a month or two now, and there is still a lot to process (obviously).  In a way for us musicians and p...