How to Build a Raspberry Pi 4B (RPi 4B) Computer with JackTrip
Version betaSep302022: added how to check RPi OS
This how to guide was created for musicians who would like to try to build a standalone Raspberry Pi 4B (RPi 4B) computer that will work with the latest version of Jacktrip.
Please feel free to email me directly at suziew97 at gmail dot com if you notice any errors or know of updates that should be added to this document.
Limitations:
I didn’t rigorously test for all possible problems that might arise. I only tested and tried to solve issues that arose during my building process. I put the sections on how to deal with issues that might arise towards the end of the document.
You might if you are lucky run into no problems in which case you can just go through the first few sections through to the section Run Jacktrip on your RPi 4B.
Disclaimer:
I originally setup my RPi 4B in October 30, 2020 via NOOBS Offline and network install Version: 3.5.0 Release date: 2020-09-15 Size: 2329 MB which is no longer supported.
September 2022: I updated the section on installing JackTrip-1.6.3 release. This might have to change with subsequent releases of JackTrip, still tbd. I didn't retest burning a microSD, I am guessing it should work with later releases of Debian 11 for the RPi's.
February 2022: I updated a few sections in this guide to reflect both the latest versions of jacktrip version 1.5.1, January 7, 2022 and the Raspberry Pi OS, Release Date January 28, 2022, 64-bit, Debian 11 and 32-bit, Debian 11 (which as of this writing is the “recommended operating system for most users” by the RPi Foundation [https://www.raspberrypi.com/software/operating-systems/]). Hopefully the basic steps and screenshots shown in this guide, will still apply for future versions of jacktrip and the RPi OS.
Hardware you will need:
You can check https://www.raspberrypi.org/products/ to find vendors and/or Amazon.
For items 3. and 4., you can use any keyboard, mouse or monitor as long as you have the right cables/adapters to connect to the RPi 4B board.
1. Raspberry Pi 4 Model B - 2GB RAM × 1 (~$45.00 on Vilros)
2. Official Raspberry Pi 4 Power Supply-(US),UL × 1 Black (~$8.00 on Vilros)
3. Raspberry Pi compatible Keyboard and Mouse (~$36 on Amazon for both)
4. Raspberry Pi compatible Monitor (various sizes/models/prices on Amazon, etc)
5a. 32GB MicroSD card pre-programmed with latest Raspberry Pi OS)
Note: microSD card might not have latest version even if it says it does. If it doesn’t, you can download the latest version via a computer in which case you will also need a MicroSD to USB adapter
or
5b. 32GB MicroSD card (blank or one you don’t mind overwriting)
and a MicroSD to USB adapter (for example: https://www.amazon.com/s?k=Micro+Sd+Card+to+Usb+Adapter)
CONTENTS
Set Up Your RPi 4B
Using Your RPi 4B
Some Useful Terminal Commands
General Tips About Using Terminal
Install Jacktrip on your RPi 4B
Clone and Build JackTrip on Your RPi 4B
Run Jacktrip on your RPi 4B
qjackctl error
Download The Latest Version of RPi OS on your MicroSD
Set Up Your RPi 4B
Follow the steps in the online ‘Setting up your Raspberry Pi Help Guide’ here:
https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up
Note that sometimes it’s hard to get the microSD card into the slot on the RPi 4B; be sure that it is pushed in as far as it will go before trying to boot up your RPi 4B.
If you bought a pre-loaded microSD card, the first time you boot up your RPi 4B, you have to plug your monitor into the leftmost hdmi slot (the slot closest to the power input) on your RPi 4B). The next time you start up your RPI 4B, you can plug the monitor into the other (that is, rightmost) hdmi slot.
When you get to the ‘Start Up your Raspberry PI’ section, if you see a screen with an error message similar to “This board requires newer software”, then go to Download The Latest Version of RPi OS on your MicroSD.
If you see a different error message, refer to to ‘Where to find help’ step in the online ‘Setting up your Raspberry Pi Help Guide’: https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up/5
If you are using Wifi and the Select Wifi Network window doesn’t pop up,
If your wifi is WEP protected and you can’t connect, then go to: Wifi is WEP Protected Fix by Sid Gulick.
If you need more help getting your wifi running, go to the ‘Connecting to the Internet’ section of the online Using your Raspberry Pi guide: https://projects.raspberrypi.org/en/projects/raspberry-pi-using/3
Once your Raspberry Pi setup is complete, you can go on to Using your RPi 4B.
Using Your RPi 4B
You might not need to check out all the steps in the online ‘Using your Raspberry Help Guide’ but it does go through how to get wifi working, how to set up your keyboard and mouse and how access the Terminal app [the same app that’s on a Mac] which you will need to install Jacktrip onto your RPi 4B.
https://projects.raspberrypi.org/en/projects/raspberry-pi-using
If you are unfamiliar with using Terminal, I strongly recommend you read this:
https://projects.raspberrypi.org/en/projects/raspberry-pi-using/8
Before moving on to the next section, open Terminal and check what version of the RPi OS you are running by typing in:
lsb_release -a
then hit the <Enter> key
uname -a
then hit the <Enter> key
if you see armv3 to armv7, the OS is 32-bit, if you see armv8 or aarch64 the OS is 64-bit.
In this first example, the RPi 4B is running under Debian 11 (bullseye), the version is 5.15.61-v8+ and it is 64-bit (aarch64):
In this second example, the RPi 4B is running under Raspian OS (buster), the version is 5.4.51-v7l+ and it is 32-bit (arm7l):
To make sure your RPi 4B is able to access the internet, type in:
ping www.google.com
then hit the <Enter> key
You should see something like this:
Hit <Ctrl>c to stop the stream of text.
Some Useful Terminal Commands
pwd shows what directory you are currently in
cd change directory; if you type in just cd, you will go back to /home/pi
ls without any parameters, lists whatever files are at the current location
man lists help for a particular command; for example man cd yields help for the command cd
uname -a shows you what release of RPi OS you are using and whether it is 32-bit or 64-bit
mv [x] [y] rename file/directory [x] to file/directory [y]; you might have to use sudo mv [x] [y]
sudo if put before a command, executes that command in super user mode
git is used for version/revision control for controlling source code(1)
aplay is a command-line audio player for ALSA (Advanced Linux Sound Architecture) sound card drivers
./[filename] run the program named [filename]
Footnote:
(1) for more details about the git command, please see About the Linux git Command by Bonnie Kwong
General Tips About Using Terminal
- You type in a command line, then hit the <Enter> key to activate that command; it’s usually a good idea to make sure you didn’t make any typos before hitting the <Enter> key
- Terminal is case sensitive, for example -D may not do the same thing as -d
- Hit <Ctrl>c to stop a command
- You can use the up and down arrows on your keyboard to scroll back and forward through commands you’ve typed in, this comes in handy if you forget exactly what a particular command you used was or there was a long command line that you want to edit and try again for example
- You can use the left and right arrows to move along a command line and <Backspace> to delete a character
- If something doesn’t work or nothing happens, be sure you didn’t make a typo in your command line, it happens a lot!
Install Jacktrip Release 1.6.3 on a RPi 4B
** Note from Chris Chafe for future releases of jacktrip on RPi's **
If we don't have an automatic test for Debian we should. I'm not sure about the state of that.
That would give a heads up. Three moving parts that go into the equation for documentation.
--JackTrip updates
--Qt (now becoming qt6)
--Debian OS release
If you don't already have Debian 11 64bit on your microSD card, go to Download The Latest Version of RPi OS on your MicroSD
Otherwise, continue with the following instructions:
Note: For the following instructions, hit the <Enter> key after each command.
1. Open up Terminal on your RPi 4B. You will be typing in the commands shown in the instructions below.
2. First make sure you are in the right directory, type in:
pwd<Enter>
It should say:
/home/pi
3. If you don’t already have a version of jacktrip on your RPi 4B,
skip to: Clone and Build JackTrip on your RPi 4B
4. If you already have a version of jacktrip on your RPi 4B under the directory jacktrip and you want to save it in case you ever need to revert to that older version, do the following steps:
a. Rename the jacktrip directory:
sudo mv jacktrip jacktrip-[xx]<Enter>
where [xx] is the jacktrip version number; for example if you have jacktrip v1.3.0 on your RPi4B and want to save it, you would type in:
sudo mv jacktrip jacktrip-1.3.0<Enter>
b. You can then type:
ls<Enter>
to check that it is there.
Then, if you ever want to use that older version, instead of:
cd jacktrip<Enter>
you would type in:
cd jacktrip-[xx]<Enter>
and from there, use the same sequence of commands you used previously to run jacktrip.
Tip: One nice thing about the sudo mv command is that if you ever make a typo in the new filename, you can do sudo mv again with the mispelled filename as the source and the correct filename as the destination.
Clone and Build JackTrip on Your RPi 4B
0. Type in the following to update your RPi software (a few non-fatal error messages are ok) - as for all Terminal commands, hit <Enter> key after each command line:
sudo apt-get update && apt-get upgrade<Enter>
Type in these commands shown in boldface (after each command, hit <Enter> key):
sudo apt-get update<Enter>
sudo apt-get dist-upgrade<Enter>
sudo apt-get install gedit<Enter>
sudo apt install qtbase5-dev qt5-qmake qtbase5-dev-tools<Enter>
sudo apt install --no-install-recommends build-essential<Enter>
sudo apt install --no-install-recommends autoconf automake libtool make libjack-jackd2-dev git help2man<Enter>
sudo apt install qjackctl qt5-qmake qttools5-dev libqt5svg5-dev libqt5networkauth5-dev qtdeclarative5-dev qml-module-qtquick-controls libqt5websockets5-dev<Enter>
if building with RtAudio, type in this command:
sudo apt install librtaudio-dev<Enter>
Check version of qt:
qmake -v<Enter>
you should see:
QMake version 3.1
Using Qt version 5.15.2 in /usr/lib/aarch64-linux-gnu
1. Once the sudo apt install command completes (this might take a few minutes), type in:
git clone --recurse-submodules https://github.com/jacktrip/jacktrip.git<Enter>
Now you have the source code locally
2. Change directories to jacktrip:
cd jacktrip
Build jacktrip:
./build
3. Once the build is complete (this might take a while), confirm the version:
Get to correct directory:
cd
cd jacktrip
cd builddir
Then check version:
./jacktrip -v
You should see:
JackTrip VERSION: 1.6.3
Copyright (c) 2008-2021 Juan-Pablo Caceres, Chris Chafe.
SoundWIRE group at CCRMA, Stanford University
This build of JackTrip is subject to LGPL license.
JackTrip source code is released under MIT and GPL licenses.
See LICENSE.md file for more information
Run Jacktrip on your RPi 4B
Note: Some of the screenshots shown in this section might look different depending on what version of qjackctl you are using. I tested “QjackCtl Version 0.5.0” and “QjackCtl Version 0.9.1 Using: Qt 5.15.2” ; I include screenshots from both versions where there are major differences and split step 7. into 7a. and 7b.
0. For consistent results, make sure your audio interface is powered on and correctly hooked up to your RPi 4B before you power on your RPi 4B.
1. Open two Terminal windows on your RPi 4B, one window will be used to run qjackctl, the other to run jacktrip.
2. In one Terminal window, type in:
qjackctl
The Jack Audio Connection Kit window should appear [if not, see qjackctl error at end of this section]:
Note: the difference between the two versions of qjackctl is Connect vs. Graph
in the lower left corner of the main menu
3. Click on the Setup button; the Setup/Parameters window should appear:
4. Click on Advanced tab, the Setup/Advanced window should appear:
5. Back on the Jack Audio Connection Kit window, click on the Start button:
6. Now go to your blank Terminal window and start jacktrip by typing in these commands:
cd jacktrip
cd builddir
./jacktrip -C [xxx.xx.xxx.xxx] -q16 -z -n1
where [xxx.xx.xxx.xxx] is the IP address or alias of the server
-n1 means one audio channel (mono), it’s a safer option to try if you have trouble connecting due to internet issues. Increasing the -q number can sometimes improve a poor connection.
7a. Using Connect — qjackctl Version 0.5.0
If you need to make adjustments to the channels you are sending to jacktrip or you want to hear in both ears of your headphones, you can click on the Connect button on the Jack Audio Connection Kit window;
the Connections window should appear:
In the Connections window, the capture ports are what you are sending to jacktrip and the playback ports are what you are receiving from jacktrip.
To see all ports, click on the + signs.
To connect from port to port, you click on the two ports you want to connect (they will be highlighted), and then click on the Connect button on the bottom of the window.
In the example shown above, to send a second channel from your Audio Device to jacktrip, click on capture_2 on the left, then click on send_1 on the right, then click on the Connect button.
In the example shown above, to send the audio from jacktrip to the R ear of your headphones, you would click on the IP_address [in the example above 171.64.197.204] on the left, then click on playback_2 on the right, and then click on the Connect button.
7b. Using Graph — qjackctl Version 0.9.1
If you need to make adjustments to the channels you are sending to jacktrip or you want to hear in both ears of your headphones, you can click on the Graph button on the Jack Audio Connection Kit window;
the Graph window should appear:
In the Graph window, the capture ports are what you are sending to jacktrip, represented by the center box labelled with the hub server’s IP_address [in the example above 45.79.67.133], and the playback ports are what you are receiving from jacktrip.
To connect from port to port, you click on the first port and then <shift>click on the second port you want to connect to (they will be highlighted in blue), and then click on the Connect button (the first option on the horizontal bar of options right over the graphs)
In the example shown above, to send a second channel from your Audio Device to jacktrip, click on capture_2 on the left, then <shift>click on send_1 on the right, then click on the Connect button.
In the example shown above, to send the audio from jacktrip to the R ear of your headphones, you would click on receive_1 in the center box (labelled with the IP_address), then <shift>click on playback_2 on the right, and then click on the Connect button.
qjackctl error
[as of February 2022 with jacktrip v1.5.1, jackd might not be installed]
Observations by Gloria Damijan during February 6, 2021 NowNet Arts Lab Ensemble sound check:
If you get a connection error message in Step. 2 and The Jack Audio Connection Kit window doesn’t appear, open another Terminal window and make sure your RPi 4B sees your audio interface by typing in:
aplay -l
a. If you don’t see your interface listed:
- shut down your RPi 4B
- make sure your audio interface is powered on and correctly hooked up to your RPi 4B
- then power on your RPi 4B.
Open two Terminal windows and in one of the Terminal windows, type in:
aplay -l
If your RPi 4B now sees your audio interface, you can now proceed from Step 2 of this section.
If your RPi 4B still doesn’t see your audio interface, there is something else going on. It could be your USB cable or something is up with your audio interface.
b. If you do see your interface listed, then it must be another issue. Try to take a screenshot or take a photo of the error message you got in Step 2.
Open a new Terminal window and type in:
jackd -v
Make note of what results — it will either be the version number or an error message.
See if you can find the error message from Step 2. listed on one of the forums, if not, email the jacktrip development team (gather as much information as possible regarding what exactly happened including what version of jacktrip you have installed, what kind of audio interface you have).
c. Another observation that Gloria made is that if qjackctl is running, typing in jackd -v [to check what version of jackd you have] might not work.
Download The Latest Version of RPi OS on your MicroSD(2)
You will need internet access plus your 32 GB MicroSD and a MicroSD to USB adapter that works on your computer.
For downloading the latest version of the RPi OS via Chrome OS, Linux, Windows, go to: https://www.raspberrypi.com/documentation/computers/getting-started.html and try using the instructions and video related to the Raspberry Pi Imager.
If that doesn’t work, click on the appropriate Installing Images section listed in the leftmost column of that page:
If you are able continue on and load your MicroSD successfully, go back to Set Up Your RPi 4B.
For Mac OS (I tested this back in February 2022, hopefully it works with some different filenames in later releases of the RPi OS)
A. If you are running MacOS higher than 10.10.5 (Yosemite), go to: https://www.raspberrypi.com/software/
or something else fails, you need to go on to B., otherwise follow the instructions shown in the video and once you are able continue on and load your MicroSD successfully, go back to Set Up Your RPi 4B.
B. If you are running MacOS 10.10.5 (Yosemite) or earlier (or A. failed), go to:
https://www.raspberrypi.com/software/operating-systems/
In the following examples, the microSD card is a 32GB SanDisk and
the RPi OS 32-bit version which is dated 2022-01-28 but it also worked for the 64-bit version
Once 2022-01-28-raspios-bullseye-armhf.zip has finished downloading into your Downloads folder on your Mac (note it might take a while as it’s over 1.3GB), follow these instructions:
1. Unzip(4) 2022-01-28-raspios-bullseye-armhf.zip
You should now have an image file named 2022-01-28-raspios-bullseye-armhf.img
2. Insert your microSD card via a USB adapter into a USB slot on your Mac.
3. Format the microSD Card to MS-DOS FAT 32 by running the Disk Utility app (under your Utilities folder):
Once the microSD card is erased, quit Disk Utility.
4. Launch the Terminal app. In the Terminal commands that follow, press the return key after each line:
5. Find the correct device/disk identifier for your microSD card by typing in:
diskutil list
6. Unmount the disk:
diskutil unmountDisk /dev/disk1
7. Set your directory to Downloads:
cd Downloads
8. Write the .img file to the microSD card:
sudo dd bs=1m if=2022-01-28-raspios-bullseye-armhf.img of=/dev/rdisk1
If Password: is asked for, type in the admin/login password for your Mac - note that the password will not be visible and the cursor will not move. Once you hit the return key, the cursor will move to the next line.
It might take several minutes for the process to complete. You can hit <Ctrl>t to see the progress. When completed, a message similar to the one shown here should appear:
9. Your MicroSD should now be loaded successfully.
Eject the microSD card [note that you might be asked for Password: again as shown in this example]:
sudo diskutil eject /dev/rdisk1
10. Quit out of Terminal and go back to Set Up Your RPi 4B.
Footnotes:
(2) References: https://www.raspberrypi.com/documentation/computers/getting-started.html and https://www.uubyte.com/burn-img-to-sd-card-mac.html
(3) I also tested Raspberry Pi OS (64-bit) Raspberry Pi OS with desktop Release date: January 28th 2022
System: 64-bit Kernel version: 5.10 Debian version: 11 (bullseye) Size: 1,135MB
(4) if unzip doesn’t work, you can download The Unarchiver app from https://theunarchiver.com/ into your Applications directory on your Mac and use The Unarchiver to unzip whichever RPi OS zip file you downloaded
(5) dd is a Linux command whose primary purpose is to convert and copy files