Latency is one of the most important aspects of online music performance, and also perhaps the least understood. We are writing a series of blog posts to shed more light on the concept and nuances of latency. In this part 2 of 10 on latency (part 1 starts here), we explain the sources of latency that affect the quality of an online music performance, when musicians play together from their homes over the Internet.

Following is a visual diagram showing an example of how audio gets from one musician to another in an online session.

 

Stage 1: Audio Processing (Analog to Digital)
Let’s say a musician is playing a guitar. The musician can either plug a cable from the guitar into an audio interface (explained here if you don’t know what an audio interface is) or use a microphone plugged into an audio interface to capture the sound from the guitar or amp. When sound is produced by the guitar (or another instrument), it is in analog form, which is the form a human’s ears use to hear sound. Computers aren’t people, and they process sound in digital form. The audio interface, working with your computer, translates the analog audio into digital audio the computer can understand. A well-crafted, fast audio interface can do this translation in about 2 milliseconds (ms), which is two thousandths of one second. A slow audio interface may take as much as 5ms (or more). We’ll use 3ms in the example above.

Stage 2: Internet Transit
Once your audio is in digital form, the computer “packetizes” the digital audio. To keep this simple, imagine a sugar packet, and imagine that your computer takes one second of audio, slices that one second of audio into one thousand pieces, and takes each piece and sticks it in a sugar packet. The computer then sends those packets (in order – i.e. the first thousandth of a second of music, then the second thousandth, and so on) from your computer over the Internet to another musician in your session. The amount of time it takes for these packets of digital audio to get from your computer to the other musician’s computer is highly variable. We have seen this as low as 5ms in ideal conditions, and higher than 100ms if you’re trying to playing across huge distances (e.g. from the US to Japan). For the example above, we are using a 15ms transit time to get the audio packets from one musician’s computer to another.

Stage 3: Jitter Queue
As your audio packets move across the Internet, they can encounter traffic, just like you can when driving across town. If this happens, some of your packets can arrive late at the other musician’s computer, and this can cause audio problems like silence, clicks, pops, and other undesirable and distracting artifacts. To deal with this, applications have traditionally used a jitter queue, which is basically a short waiting line for your audio packets to sit in at the other musician’s computer. If that queue is 3 packets deep, then if the next set of packets are a little late, you can play the audio from the packets in the queue to keep the audio flowing and happy. However, there is a latency cost of this queue, and the more packets you keep in this queue, the more latency you will experience in your session. This can be a “silent killer” of your experience in a session. A later article in this series will provide more details on the jitter queue, but for now let’s say that – at least for JamKazam – your jitter queue is 2.5ms on average.

Stage 4: Audio Processing (Digital to Analog)
Once the audio has arrived at the other musician’s computer, it is still in digital form, and human ears don’t know what to do with that. So the other musician’s audio interface, working with their computer, translates the audio from digital to analog format, and then plays the music through the headphones attached to the audio interface. Like Stage 1 above, we’ll use 3ms as a reasonably typical example of the amount of time this takes.

Total Latency Pipeline
If you add up all the stages above, the total time it takes for the audio to move from the musician playing the guitar to the ears of the other musician is 23.5ms. If you recall from our part 1 article on latency, this is an equivalent experience (in terms of latency) to sitting in a room 23.5 feet apart from the other musician while playing together.

The Next Article in the Series
Our next article – part 3 in our series on latency – dives deeper into Internet transit time and how JamKazam uniquely minimizes this.

Curious To See How This Works?
While we understand the natural skepticism many musicians feel about the ability to play together live in sync in online sessions, we’d point out that musicians have now played in more than 3 million online sessions on JamKazam. You can check out a small handful of sample performances in this YouTube video, with all the musicians playing on JamKazam from their homes over the Internet. If you’re interested in trying it out, you can do so risk-free by going to https://www.jamkazam.com and signing up for a free account. We have a support team that can help you get set up and playing online successfully in private sessions with your band or in open/public sessions with other musicians if you’re not in a band.