Roon Bridge for ARM: a beginner’s guide to Raspberry Pi and Cubox-i

Update 04/03/17:
This guide was written in april 2016. While it is still technically correct, things have changed over time. These days, you may want to consider using DietPi or Ropieee as the OS for your Pi-based Roon Bridge.

With the advent of Roon 1.2, Roon Bridge has made its appearance: a nifty piece of software allowing to you create audio endpoints with machines otherwise underpowered to run ‘full Roon’. Roon Bridge relies on RAAT (Roon Advanced Audio Transport) – Roon’s own audio distribution technology that allows for stable streaming, zone linking and superior audio clocking.

Roon Bridge for ARM is targeted at [ARM development boards]((http://elinux.org/Development_Platforms): small, low-power microcomputers based on the ARM-chipset, usually running Linux off a micro SD-card. In this guide I will be looking at two of the most popular ones: the Raspberry Pi and the Cubox-i and explain in easy step-by-step guides how to turn them into Roon Bridge endpoints.

Why would I want one?

ARM dev boards are extremely cost-effective and enable you to add one or more extra audio zones throughout your house. Music in the kitchen! In the bedroom! In the bath… well – you get it by now. They also enable you to separate your Roonserver system from your audio system: place a low-powered RoonBridge endpoint near your kit and delegate the server to a cupboard far, far away. Less noise all around.

A well-dressed Pi wears a HAT

What about audio quality? Well, with the Pi, it’s pretty awful out of the box: the onboard audio system is very noisy and its drivers are still pretty half-baked. Don’t let this scare you off though: luckily, the Pi has a smart expansion system in the form of a 40-pin GPIO header. This header allows for easy connection of small daughterboards, or, in Pi-lingo: HATs (Hardware Attached to Top).

Several of these HATs are dedicated to getting high quality audio out of your Pi, using the I2S interface on the header – and succeed admirably in doing so. A HAT can function as a DAC (providing an analog signal), as a digital board (providing optical or coaxial S/PDIF out) or even a DAC/AMP combo (ready for attaching a pair of speakers to).

A few examples:

  • IQ Audio offers the Pi-DAC+: a very nice 192/24 DAC with hardware volume control that is fully RoonReady certified. IQ Audio supplies a readymade image in the downloads section of its website. They also offer a DAC/AMP combo – and nice matching cases.
  • Hifiberry makes DACs, digital boards (Digi+, allowing for S/PDIF optical and coaxial) and DAC/AMP combo’s that will work nicely with RoonBridge.

Many other audio HATs are available as well. As a rule of thumb: if it works with ALSA (Linux’s default audio system), it will most probably work with Roon Bridge.

I already own a USB DAC – can I leave my HAT off?

Yes, you can. After installing Roon Bridge, just plug in your DAC and it will show up in Roon as a Roon Bridge capable endpoint. While the Raspberry Pi’s network and USB configuration is slightly compromised (they all share one 480Mbps system bus), recent driver versions have alleviated earlier timing issues somewhat. In normal circumstances, the Pi performs fine up to 192kHz/DSD64. At higher bitrates, YMMV – but in recent testing, my Pi3 performs fine at 384kHz/DSD128.

The Cubox-i has separate buses for USB and network (though the latter is limited to 480Mbps by itself), allowing for higher bitrates (I use one at 768kHz/DSD256 with no problems). Added bonus with the Cubox-i is the on-board S/PDIF port, allowing for optical connections up to 192kHZ out of the box.

A word about WiFi

The Raspberry Pi 3 and some the Cubox-i’s come equipped with WiFi. While convenient, in most cases WiFi is not the best solution for a networked audio endpoint. Transfer speeds are limited to the 802.11n specification – and since the antennae are on small boards hidden in small cases, network strength is not optimal.

In most use cases you’ll be fine at CD-quality (44.1kHz) bitrates, but you may be running into trouble at higher bitrates, as data traffic increases. If possible, use a wired connection.

Cleaning up the power

Most devices come with cheap, switching type wall-wart power supplies. Aqvox and SBooster sell nice, linear power supplies, while iFi’s iPower aims to be a very clean switching one. Whether any of these will bring audible benefits is dependent on your setup and ultimately up for you to judge.

Roon Bridge alternatives

PiCorePlayer is a highly optimised Squeezebox emulator for the Raspberry Pi, that allows for easy configuration through a web browser. While the Squeezebox protocol is supported by Roon, you’ll miss out on the niceties RAAT has to offer.

Users of HQ Player (a great upsampling audio player that can function in conjunction with Roon) may want to install the NAA (Network Audio Adapter) software on their devices. It is available in ready-to-install images for Pi and Cubox.

So – which one should I choose?

  • Get a Pi with a DAC HAT of choice when you need analog out;
  • Get a Pi with a Hifiberry Digi+ when you need digital out through S/PDIF (coaxial or optical) or get a Cubox if you just need optical;
  • If you want to attach a DAC through USB, get either (though a Cubox is better equipped for higher bitrates);
  • Get a Cubox If you want to output through HDMI (the Pi’s HDMI out is limited to 48/16 in the current kernel, or to 192/16 in development kernels)

Great, let’s get started. Now what do I need?

For Raspberry Pi, you’ll need a Pi 2 or 3 (as these have the required ARMv7 chipset), a power supply (min. 2A/5V, 2,5A recommended if you attach anything consuming power to USB on a Pi 3) and a case of choice (if you are using a HAT, be aware that for most HATs there are specialised cases). You’ll also need a micro SD-card for installing OS + Roon Bridge (4GB is plenty). Most resellers offer starter kits containing all of the above at discounted prices. The Cubox-i already has its own case and comes everything you need (Cubox, power, SD-card).

After unpacking and/or assembling your Pi or Cubox, you will need to install the OS to your SD-card, config your HAT (if applicable) and install Roon Bridge – see the installation guides below.

Note: this is meant to be a friendly guide for those new to using a Pi or Cubox with Linux/Roon Bridge and by no means an ‘end-all’ piece on these matters. Suggestions and additions welcome, questions entertained. :slight_smile:

24 Likes

Roon Bridge on a Raspberry Pi: an installation guide

Your Pi will run off a micro SD-card, that you can insert in the Pi’s card holder. Before doing so, you will need to prepare the card by installing the OS and Roon Bridge. While some of these step my look slightly daunting for the first time, just follow through – it is not as hard as it may look and help is around! :slight_smile:

In this guide, I will assume you are using a wired network connection. If you want to use the Pi 3’s WiFi (not recommended – see ‘A word about Wifi’ above), see ‘Configuring Wifi on a Pi 3’ at the end of this guide.

Downloading the OS

In this guide, we will be using Raspbian Jessie Lite – a relatively lightweight Linux version for the Raspberry Pi that is distributed, maintained an supported by the Raspberry Pi Foundation. You can download the OS from the Foundation’s website (choose Raspbian Jessie Lite). After unpacking the ZIP-file, you will have an .img file containing the entire OS.

Writing the OS to the SD card

Next you’ll have write the OS to the SD Card. You will need and SD-card reader for this (built-in to some computers, but otherwise you can use a USB SD-card reader). Most micro SD-cards will come with an adapter included - you will need one to fit the small card to the larger reader.

For writing the .img file to the SD-card, Windows users can download the freeware Win32DiskImager application from the Sourceforge project page and follow instructions on the Foundation’s website (in short: launch Win32DiskImager, select the .img file downloaded above, select the drive letter your PC has assigned to your SD-card and click ‘Write’).

OS X users can download [Apple Pi Baker]((http://www.tweaking4all.com/hardware/raspberry-pi/macosx-apple-pi-baker/) (seriously!) and follow instructions (basically: launch PiBaker, select the SD-card, browse to the .img file downloaded above in the ‘Pi-ingredients’ section and press ‘Restore Backup’).

Linux buffs will most likely know what to do but can find a refresher’s course here.

The writing process will take a few minutes. When it’s finished, just close the app. On recent Raspbian distributions, you will have to enable SSH access. You can do so by placing a file called ‘ssh’ (without any extension) on the boot partition of the SD-card. The file itself can be empty. At first boot, your Pi will detect the file and enable the SSH-server.

Now, you can eject your SD-card. Insert the freshly written SD-card into your Pi, attach network and power cables and off you go!

Controlling your Pi through SSH

You can take command of your Pi through SSH (Secure Shell): a small, text-based terminal window that offers remote access: you can look at your shell window as if it were a monitor, attached to your Pi.

Windows users can use PuTTY for SSH access: a free, lightweight SSH-application that can be downloaded from greenend.org.uk. Instructions for use with the Pi can be found here on the Foundations website.

OS X users can use the Terminal.app (located in Applications > Utilities) while Linux users can open a terminal windows of their choice.

Finding out your Pi’s IP address

You connect to your Pi using its IP address. On most networks, this address is assigned dynamically using DHCP. Most routers will have a page showing which IP address on your network is in use by which device.

Another easy way of finding out your Pi’s IP address is by using Fing, a freeware app available for Android and iOS. Fing scans your network and shows all active devices – your Pi will have ‘Raspberry Pi Foundation’ next to its MAC-address.

Connecting to your Pi

In PuTTY, enter the IP address of your Pi in the ‘Host Name (or IP address) box and press ‘Open’. A security alert about the server’s host key may pop up – you can safely press ‘Yes’.

You can now log in to your Pi by entering ‘pi’ for username and ‘raspberry’ for password.

OS X and Linux users can connect to their Pi in their respective terminal apps by issuing the following command:

ssh -l pi ip-address-of-your-pi

When asked accepting the host key, type ‘yes’ and press enter. When asked for the password, type ‘raspberry’.

A little housekeeping

After logging in successfully, let’s get your Pi ready for action.

First, you’ll to change a few settings by issuing:

sudo raspi-config

  1. You’ll want to make sure your Pi uses the space on your SD-card in its entirety by choosing option 1: Expand filesystem.

  2. For security reasons, you may want to change the default password to something different. Choose 2: Change user password and follow instructions.

  3. The default hostname of your Pi is ‘raspberrypi’. While apt and technically correct, things can get confusing if you plan on employing multiple Pi’s. You may want to change this using 9: Advanced Options, followed by A2: Hostname.

After the above, leave raspi-config by using Tab to select Finish. You Pi will now ask you to reboot.

Rebooting will take about 30 seconds. After logging in again, you’ll want to make sure your OS is up-to-date by issuing:

sudo apt-get update && sudo apt-get upgrade

It will take a while to finish. Grab a beverage of your choice and watch in mild bewilderment. When asked if you want to continue, press y + enter.

When it’s finished, reboot your Pi once again:

sudo reboot

Configuring your HAT

In modern Raspbian releases, all you will have to do to let your Pi know which HAT is present, is adding a little line of text to the configuration file after logging in again:

sudo nano /boot/config.txt

This will open the file in a text editor called ‘nano’. Scroll to the end of the text with your arrow keys and add the dtoverlay for your HAT on a new line. Refer to your HAT manufacturer for the correct overlay. A few examples:

For the IQ Audio DAC+:

dtoverlay=iqaudio-dacplus

For the Hifiberry DAC+:

dtoverlay=hifiberry-dacplus

For the Hifiberry Digi+:

dtoverlay=hifiberry-digi

While you’re at it, you may want to disable to on-board audio altogether by commenting out the line ‘dtparam=audio=on’:

# dtparam=audio=on

You can close the nano text editor and save the file by typing CTRL-X, followed by ‘y’ when prompted to save.

(If you will be using a USB DAC, you do not have to define overlays. You still may want to comment out the on-board audio though.)

Reboot your Pi when done:

sudo reboot

(Optional) Configuring WiFi on a Pi 3

Enabling WiFi on the Pi 3 is quite easy. You’ll need to edit the ‘wpa-supplicant’ configuration file:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

at the bottom of the file (use your arrow keys to navigate), add this text:

network={
	ssid="My-WiFi-network-name"
	psk="My-WiFi-password"
}

For ssid, enter the name of your WiFi network. For psk, enter your WiFi network’s WPA or WPA2 password.

Save the file by entering CTRL-X, y.

Your WiFi connection will activate within a few seconds. You can verify that it is connected by issuing

ifconfig wlan0

If inet addr has a value next to, you’re connected. You can now remove your wired network cable and reboot your Pi.

Installing Roon Bridge

Roon provides excellent instructions for installing Roon Bridge. The Raspbian Lite installation outlined above meets all the required dependencies for Roon.

In short, after logging in again it boils down to three small steps for mankind:

  1. Download the easy installer:
    curl -O http://download.roonlabs.com/builds/roonbridge-installer-linuxarmv7hf.sh
  2. Make the installer script executable:
    chmod +x roonbridge-installer-linuxarmv7hf.sh
  3. Run the installer script:
    sudo ./roonbridge-installer-linuxarmv7hf.sh

Just answer ‘y’ when it asks to install.

The Roon Bridge service is now active and configured to auto-load at reboot. In Roon Remote (desktop, tablet or phone), the new Roon Bridge audio device(s) will be visible in Settings > Audio. You can enable and name your new zone(s) in the usual way.

That’s all folks – enjoy the music!

Roon Bridge on a Cubox-i: an installation guide

Installing Roon Bridge on a Cubox-i is roughly comparable to the way a Raspberry Pi is setup, with a few notable differences. Your Cubox-i will run its OS off a micro SD-card, that you can insert into the Cubox’s card holder. Before doing so, you will need to prepare the card by installing the OS and Roon Bridge. While some of these step my look slightly daunting for the first time, just follow through – it is not as hard as it may look and help is around! :slight_smile:

Downloading the OS

In this guide, we will be using Armbian – a relatively lightweight and well maintained Linux version based on Debian. You can download the OS from the Cubox page on the Armbian website (choose Jessie server from the Legacy section – this is the only release that fully supports all bitrates up to 192Khz in the S/PDIF port).

The download is available as a zipped 7z archive, that can be uncompressed with 7-Zip on Windows, Keka on Mac and 7z on Linux (apt-get install p7zip-full). After unzipping, you’ll have an Armbian folder with a .raw file containing an image of the OS.

Writing the OS to the SD card

Next you’ll have write the OS to the SD Card. You will need and SD-card reader for this (built-in to some computers, but otherwise you can use a USB SD-card reader). Most micro SD-cards will come with an adaptor included - you will need one to fit the small card to the larger reader.

On Windows, .raw files can be written to the card using the freeware app Rufus. Check ‘Create a bootable disk using’ > DD image and browse for the Armbian .raw file by clicking on the optical drive icon. You will need to select ‘All files’ in the browse window before you can see the Armbian .raw file – it will write to card just fine.

On OS X and Linux, you will need to use the ‘dd’ command using the command line in the Terminal. Linux buffs will know what to do – OS X users will find Terminal.app in Applications > Utilities. Before writing to the card, you will need to make sure it is not mounted. On OS X, type

diskutil list

in the terminal. From the list, you will see which device is your card. I’ll use /dev/disk2 for example. To unmount, type

diskutil unmountDisk disk2

Now you will need to navigatie to the folder your .raw file is in. To make it easy on yourself, you can just copy (or drag) the file to your home directory and work from there. Next, issue the following command to start writing the file to the card:

dd bs=1m if=filename.raw of=/dev/rdiskx

In this example, where the SD-card is /dev/disk2 and the Armbian release is 5.10 Legacy:

dd bs=1m Armbian_5.10_Cubox-i_Debian_jessie_3.14.67.raw of=/dev/rdisk2

On Linux, the command is slightly different:

dd bs=1M if=filename.raw of=/dev/sdx

The writing process will take a few minutes. When it’s finished, just close the app and eject your SD-card. Insert the freshly written SD-card into your Cubox, network and power cables and off you go!

Controlling your Cubox through SSH

You can take command of your Cubox through SSH (Secure Shell): a small, text-based terminal window that offers remote access: you can look at your shell window as if it was a monitor, attached to your Pi.
Windows users can use PuTTY for this: a free, lightweight SSH-application that can be downloaded from greenend.org.uk.

OS X users can use the Terminal.app (located in Applications > Utilities) while Linux users can open a terminal window of their choice.

Finding out your Cubox’s IP address

You connect to your Pi using its IP address. On most networks, this address is assigned dynamically using DHCP. Most routers will have a page showing which IP address on your network is in use by which device.

Another easy way of finding out your Cubox’s IP address is by using Fing, a freeware app available for Android and iOS. Fing scans your network and shows all active devices.

Connecting to your Cubox

In PuTTY, enter the IP address of your Cubox in the ‘Host Name (or IP address) box and press ‘Open’. A security alert about the server’s host key may pop up – you can safely press ‘Yes’.

You can now log in to your Cubox by entering ‘root’ for username and ‘1234’ for password.

OS X and Linux users can connect to their Pi in their respective terminal apps by issuing the following command:

ssh -l root ip-address-of-your-cubox

When asked accepting the host key, type ‘yes’ and press enter. When asked for the password, type ‘1234’.

A little housekeeping

At the first boot, Armbian will automatically resize the file system for you, so your Cubox can use the full size of your SD card.

After logging in, it will ask you the change the default root password (1234) to something differtent and to create a new user (you). You can choose a username and password yourself. All other questions can be left blank and answered by a simple ‘enter’.

Now, you’ll want to make sure your OS is up-to-date by issuing the following command:

sudo apt-get update && sudo apt-get upgrade

When it is finished, reboot your Cubox and login again – this time using the new user / password combo you have created.

Installing Roon Bridge

Roon provides excellent instructions for installing Roon Bridge. The Armbian installation outlined above meets all the required dependencies for Roon.

In short, after logging in again it boils down to three small steps for mankind:

  1. Download the easy installer:
    curl -O http://download.roonlabs.com/builds/roonbridge-installer-linuxarmv7hf.sh
  2. Make the installer script executable:
    chmod +x roonbridge-installer-linuxarmv7hf.sh
  3. Run the installer script:
    sudo ./roonbridge-installer-linuxarmv7hf.sh

Just answer ‘y’ when it asks to install.

The Roon Bridge service is now active and configured to auto-load at reboot. In Roon Remote (desktop, tablet or phone), the new Roon Bridge audio device(s) (S/PDIF or a DAC connected by USB) will be visible in Settings > Audio. You can enable and name your new zone(s) in the usual way.

That’s all folks – enjoy the music!

34 Likes

Thank you Rene, a wonderful resource.

Excellent! It saves me the trouble of writing up my own version…

One nit - apparently Roon Labs has recently taken the decision to move away from the InternetNames convention, so henceforth RoonBridge will be known as Roon Bridge.

You might also want to include mention of the IQaudIO RoonReady (now Roon Ready?) image in the Roon Bridge alternatives section… I see a distinction between the Roon Bridge software that’s available for download from Roon Labs for installation onto Linux distros, and Roon Ready devices, where the software comes from the hardware supplier, and where the software/hardware package has been certified by Roon Labs as “Roon Ready”. I may be wrong in seeing this distinction…

Look forward to seeing the next instalment :slight_smile:

The main distinctions between Roon Ready and Roon Bridge are:

  • Roon Ready is baked into the device, needs no configuration by the user and can support features of the particular hardware that Roon Bridge can’t;

  • Roon Bridge has to be installed by the user and is a “one size fits all” compromise when it comes to hardware features of devices.

Other than that, they perform the same function, which is enabling the device to be a RAAT endpoint.

@andybob - thanks, that’s helpful, although for some devices (e.g. IQaudIO hardware), the users still need to download and install the Roon Ready software themselves, since we’re still talking about DIY Roon endpoints.

Yes, that’s true. I think because the Pi has no firmware, so an SD card has to be used.

Hmm, there’s a marketing opportunity for @Gordon_Garrity here, I think: IQaudIO already sells SD cards along with the rest of the hardware, he could sell SD cards with the Roon Ready image preinstalled, to make it even easier for non-technical users. Just assemble, plug-in and listen…

Edit: or, indeed, picking up on Steve’s point below, there’s a further marketing opportunity for IQaudIO to sell pre-assembled and tested Roon Ready units… just plug in and listen…

That’s an interesting edge case one actually. I suppose technically, to be RoonReady, should it not be sold as a complete unit with a pre-installed SD card, PiBoard, Case, power supply, etc? Otherwise it’s sort of RoonBridge+ or RoonReadyDIY ;). Somehow having a Pi add-on board that needs user installation, in the same category as a totaldac server, seems a bit confusing? Well, to me anyway.

What about the Beaglebone Black? Is there a reason a Pi or Cubox is preferred?

It would even be better if they sold a metal housing for it too, when fully assembled and loaded with their firmware. One that looks great and maybe has the option to be screwed onto a wall or behind a cabinet.

And what about an auto-firmware-upgrade option. The same as Roon has, but automatically. So when a new version is uploaded to IQAudio’s site and when the endpoint checks (say every week or so) it downloads the firmware and updates itself. Space enough on the SD-card for that.

The biggest risk of these devices will be not updates endpoints with non-fixed security bugs.

I’m not particularly bothered about a metal housing, but you make a good point about auto-upgrades. For turnkey products, this should be provided by default (but it often is not).

I fully agree. Please, @Gordon_Garrity, can you fix that. Make it auto-updating. I think Roon Ready endpoints deserve that.

All, thanks for the ideas. We are already working on an Alu case with OLED display and rotary encoder etc.

I take note about the auto updates too.

Moving offices this week so will need a little time.

Gordon

The Pi and Cubox are amongst the most widely used boards, are well-supported and have (especially in the Pi’s case) a wide ecosystem (HATs, cases, etc.). Other than that – there’s no reason why a BeagleBoard (or a WandBoard, or any of the other ARM boards Iinked to) wouldn’t make a fine Roon Bridge. Same with OS distros: if you’d like to run Arch, it’ll be fine (or even better). I just would not recommend it to beginners.

Thanks, any security concerns with these OS’ end users should worry about?

Also, would love to see a beginner’s guide from you on Linux distros for RoonServer. I like the way you’ve laid this out.

Thank you Rene, a wonderful resource.

I think his guide is knowledge base quality. If I would be Roon (@andybob) I would move it out of the community section into the official user guides spot of Roon.

We are already working on an Alu case with OLED display and rotary encoder etc.

Will this case with all the above compatible with all the Pi and IQAudio combo’s already in the field/world, @Gordon_Garrity? Any estimation of time (month in 2016)?

And a rotary encoder, with leds (eg. this rotary encoder with led ring)? Cool!

Please make the case look awesome high-end for an affordable price. Your product deserves it (and Roon too :wink: eg. like this or like this)

I like this nice base with no screws on the front panel

Thanks, any security concerns with these OS’ end users should worry about

You need some good understanding of and skills in Linux to go the road of the self-deployed-OS way to keep them updated and secure. The latter requires the most skills and knowledge.

If you stick with IQAudio, it will work out if the box (when you copy their image to the sd of the Pi). Depending on their updating and hardening skills it will be ‘ok’, ‘good’ or ‘awesome’.

It’s more or less choosing between a diy way and an easy way. Up to you.

In general the biggest issue in the world of the Internet-of-things (where these endpoints are close to in my view) will be keeping them secure. You just need 1 vulnerability in your network to compromise the network. And with more and more things connected to networks and in the end to the internet, more and more possibilities for vulnerabilities.

Read: what-should-be-done-to-secure-raspberry-pi
Or: make-your-raspberry-pi-more-secure

Besides, Roon also need some improvements as currently it runs as root (at least on Linux using the install), which is the last you want to do on a system. It goes against the basic security guidelines/best practices.

1 Like

OK, well that’s it. I’ve ordered an RP3 today. Thanks Rene - awesome job. Will let you know how I get on !

1 Like

Hi,
for me it does not work. I’m using an older raspberry pi B with armv6. As you mentioned older pi’s will work as well, but in my case not.
I tried both: the easy install script and the manual install method.
Does anyone can help?

The install script always fails because of the wrong architecture. It says this script is for armv7 and wont work on your hardware. I tried to change the line with “ARCH=armv7hf” to something like armv6, armv6l or armv6hf, nothing worked.
uname -a tells me that I have an *armv6l
I also tried the manual method:
Downloaded the package and copied it to /opt/RoonBridge

root@minibian:/opt/RoonBridge# ./check.sh

Checking to see if RoonBridge can run on this machine
Checking for Binary Compatibility [ OK ]
Checking for ALSA Libraries [ OK ]

STATUS: SUCCESS

root@minibian:/opt/RoonBridge# ./start.sh
./start.sh: line 44: 8866 Illegal instruction $ROOTDIR/Bridge/RoonBridge “$@”
./start.sh: line 34: kill: (8866) - No such process

I really hope someone can hep me.

Thanks in advance!
Cheers

Uh-oh… That’s a small oversight in the instructions. Roon Bridge is compiled for ARMv7 (and x86) only – older Pi’s with earlier chipsets are not supported. I’ve corrected the post above – sorry for any confusion here!