Updated: Feb 25
Earlier in 2020 online jams just exploded. With musicians in isolation, bands had to resort to online tools to be able to play together and even record. We had a look at online tools for jamming in this article, but at that stage JackTrip wasn't the focus. It has evolved quite a lot since then and that is what we want to cover in this article specifically.
So JackTrip is a bit different than Jamulus in the sense that it was based in a peer-to-peer architecture with no codec - audio is 48kHz 16-bit 2-channel PCM whereas Jamulus and others use lossy codecs like the OPUS.
Having said that, you can use JackTrip in a client-server configuration. More on this below.
Getting Started with JackTrip
The best way to understand all the small parts that make JackTrip and online jams possible is to check out this article here. The elements that generate latency are described there, as well as the pros and cons of peer-to-peer and client-server (or hub and spoke).
To simplify things, I want to focus on the client-server application as it is simpler to configure and covers the use cases I am aiming for. If you are seriously tech-minded and want to go down the peer-to-peer path, check out this article that shows how to connect two computers in that mode (and the process needs to be repeated for every other computer connected to the JackTrip network in this mode). Warning: this involves port forwarding and use of the command line.
If that is not for you, let's then discuss the steps for client-server.
Of course you will need a computer running Mac or Windows, and a fast internet connection. Given the use of lossless audio, bandwidth requirements are higher than Jamulus. This article here suggests 2.0 Mbps download and upload so of course slow ADSL or dial-up won’t cut it. You need fast broadband, NBN if in Australia, cable, fibre or equivalent. Note that the specific client-server configuration we will discuss here has means to test if you are eligible or not, so watch this space - more on that below.
Extremely important: get your computer close to your router and connect via Ethernet. Do not use WiFi as this will make the latency even worse and cause additional audio issues.
Apart from that, you need an audio interface, your instrument and/or a microphone.
If you don’t have an interface my recommendation is the Focusrite Scarlett Solo:
The server path
First step is to download and install Jack and JackTrip. Instructions for Mac OS X are here, whereas the windows instructions are here. As you will notice, these instructions allow you to install and test Jack and JackTrip, but not much else. So that is where the quest for a server begins. And that is where I found a shortcut for those who want to play music as soon as possible instead of having to install servers by themselves. Sometimes convenience is king.
Enter Musicians Together Apart, a service that provides the servers for JackTrip in various locations of the world, and are even able to deploy servers if not immediately available. Yes there is a fee involved, but you can try for 14 days and get some serious tech support in case things don't work. More importantly, you can head on to their website and test the coverage in your area. Click on test your coverage and pick your region or city. You will then be able to check eligibility by measuring download speed, upload speed, ping time and jitter.
Connecting everything together
Now that you have a server, you should also receive the IP for that server, and a web page that allows you to control the server mode, the buffer size and the server ring buffer size.
The server mode is easier to understand, basically one mode doesn't loop back your audio to you - you will need direct monitoring on your audio interface to listen to yourself. the loopback mode allows you to hear yourself, so it is recommended that in that case you turn your direct monitoring off.
The buffer size is called Frames/Period inside Jack. In this case it is important that they all match - server and all clients - or you won't be able to connect.
So you have to configure server first by heading to the web page provided when you hired the server. Then each user will have to configure theirs inside the 'setup' area of Jack before attempting a connection.
Now it's important to note that Jack does not have an audio interface configuration of its own and so it follows your system setup (windows or MacOS) and only for 2 channels. So the inputs and outputs selected by the system will be used. For example, let's say you have a Focusrite with 4 channels in and out and that is selected as the interface in your system settings. Jack will 'see' the first two channels of that interface, both for input and output.
A typical use case would be to have a guitar connected on channel 1, a microphone on channel 2 and they will both be routed into the session with other musicians. The 2-channel output would be connected to headphones where you can then listen to the session and jam.
The server ring buffer size is additional protection around the network side of JackTrip, and can be different on server and clients. The recommendation is to start with the lowest number (8) and then increase musicians first and then server if you hear crackling or glitches in the audio.
Both buffer size and server ring buffer size will affect latency. So the trick here is to find a trade off where both audio quality and latency are still acceptable.
Step by step
Alright let's then go through the steps to be able to play:
· Make sure the server is running, check the web page provided and the IP for the server
· Make sure each player configures their system to point to their audio interface
· Verify that the instruments to be used are connected to the first 2 channels of their interfaces
· Launch Jack on each player's computer
· Configure Frames/Period to the same value as the server
· Start Jack by pushing the play button on the GUI that looks like an old mp3 player
· Open a terminal window / command line
· Start by connecting with a server ring buffer size (q) that is the same as the server (8 in the example below)
· The command for each client will look like this in the command line: jacktrip -C [IP address of your server] -q 8
You should at this stage hear each other and be able to play together to test.
If you hear crackling or glitches in the audio, raise the q value first, at each player then at the server. If it still doesn't work, then you need to disconnect, set up a higher buffer size (server) and matching Framers/Period (jack) and start over again.
During my tests, a server in Melbourne, Australia was provided by the folks from Musicians Together Apart. All musicians were located around Point Cook, which is around 20km from Melbourne's CBD. We had success with a buffer size around 32 and a q ranging from 16 to 24 depending on the musician. I then stretched the buffer size to 64 to be on the safe side.
We were all connected to NBN Australia via different providers, with upload speeds above 50 Mbps and download speeds above 20 Mbps.
Unlike Jamulus, JackTrip doesn't give you a latency metric (apart from the server tests mentioned before). So the way I measured the latency was to record the 'return' from JackTrip using Logic Pro X - making sure the direct monitoring was muted. That way I knew that the distance between peaks of my 'clap' sound into my microphone was the return latency I was experiencing. The result was around 50 ms at the highest buffer settings I tried (64 buffer, q 24) which was very conservative but the audio quality was flawless. So I was able to achieve a high audio quality with borderline acceptable latency (anything more than that would make it complex to play in time).
Many players may ask how they can route their audio through some software to process their sound before it goes to JackTrip. They might also wonder if other channels from their interfaces can be routed, since JackTrip only 'sees' the first two channels.
My answer to that is to use Loopback on MacOS (equivalent using Voice Meeter Banana on Windows).
Remember that if you do this, you will have to set the 'device' created with Loopback as your system audio input, as this is what Jack will use.
In my case, I created a device to route the Aux (a virtual input) of my Universal Audio Apollo Twin mkII into Jack. To that Aux, I routed my guitar, microphone and a backing track via the UA console. This allows me to play a backing track in cases where our drummer is not able to join the session, for example.
A great addition to the world of online jams. In a nutshell, I was able to achieve a similar result with my band as to what I had using Jamulus, with better audio quality.
The trick is to use the servers provided by a service like Musicians Together Apart or to come up with your own server, and then optimise the buffers a little bit until you find the sweet spot between latency and audio quality.