Reducing audio latency - some echo measurements with oscilloscope

A few folks in Europe (England, France, Germany, Switzerland) have been checking out JackTrip across longer distances over the last few weeks. We’ve been using a mixture of audio interfaces on both the JackTrip app and digital and analog bridges.

Over the weekend I made some audio tests using my oscilloscope on my own setup, measuring the time delay from a metronome click fed into my microphone and receiving an echo back from the Virtual Studio at my headphone socket.

I first made similar measurements in the spring of 2021 before the JackTrip app became available. I found then that the analog bridge (connected via my Tascam Model 24 mixer) was the lowest latency by some way & I have now reconfirmed this so have used this as a baseline measurement.

I found that using the Tascam with the JackTrip app (MacOS on 2015 Intel iMac) is considerably slower - adding some 16ms - which I suspect is due mainly to the 22/24 channel interface. The same JackTrip app using a Behringer UM2 added only 10ms, confirming some earlier measurements I’d made with the UM2 using the Oblique Audio RTL-Utility.

The most surprising result yesterday was that the UM2 connected to a digital bridge adds some 19ms. I’d expected this to be closer to 10ms as with the JackTrip app.

A few questions arise from this…

  1. Is it possible to set up MacOS Audio Devices such that it only looks at two channels of my Model 24, thereby reducing the latency? In earlier versions the JackTrip app only ever saw channels 1 & 2.
  2. Is the digital bridge USB driver to external audio interfaces optimised for any specific device(s) & if so which?

I’m very likely to go back to my original setup using the analog bridge with my mixer, but I would prefer to use the app as I can then let our drummer have the analog bridge rather than him using the digital bridge + UM2.

2 Likes

thank you @rebholland - very interesting.

and I agree that the drummer should get the lowest latency devices available!

@miked might have comments on your findings.

Thanks for the feedback Synthia. I have managed to swap out our drummer’s digital bridge for my analog bridge but not without some difficulty. It seems that the JackTrip mobile app is no longer available on Google Play Store so he was unable to re-register it to his JackTrip account (Android user only). I had to move the HiFi Berry card from one RPi to the other to make it work. It looks like the only way to register a bridge these days is via the Apple mobile app - is that true? We hope to try out the new configuration later this evening.

1 Like

I’d be interested to learn more about your settings and testing methodology used, including:

  • Sample rate
  • Buffer strategy on device/server
  • Buffer size on device/server
  • Queue settings
  • Which server location?
  • Approximate distance of server location from you
  • Wired ethernet?
  • Fiber Internet?
  • Full round trip times versus just estimates for the latency contribution from interfaces

The analog bridge devices had a pretty efficient audio interface, but as of a few years ago. Today you can get equally good performance with modern USB interfaces from Sweetwater. And with a good interface and drivers, the desktop app should easily outperform JackTrip’s old bridge devices.

This is a gross generalization, but I haven’t found a USB interface on a mixer that performed very well yet. Dedicated external audio interfaces often seem to outperform them.

Digital bridge specifically uses ALSA Linux drviers.

2 Likes

You are correct about the Google Play store. We discontinued the bridge devices years ago, and no longer have the resources to continue working on them. Just about everyone has moved over to using the desktop app instead. It should perform just as well or better, but does require having a good audio interface and drivers.

1 Like

This makes me so happy @miked - thank you! @rebholland hopefully you see
this and it could apply to tonight’s rehearsal.

And going forward - configurations change, so it’s good to have the list
below handy and fill in for each session. Within reason of course.

standing by…

1 Like

Thanks for confirming that @miked - thought I might have missed something re Android mobiles. In an earlier topic I mentioned that older folks (many of my musical friends included) are no longer upgrading their desktops/laptops as they might have done, preferring instead to spend their money on tablets (e.g. to use ForScore). For example, I currently have three MacBookPro 17" machines that I can’t use with the JackTrip app & neither can I donate them to friends for the same reason. I also have an iMac which works OK for me, and an iPad Pro (ForScore). The bridges offered a low cost way of using JackTrip for this social group so I’m keen to find an alternative low cost entry point. I take your point about limited development/support resources & I appreciate everything you’ve achieved so far. Using the analog bridge for our drummer was a great improvement last night, but rather than converting one of our digital bridges I’ll take a closer look at available USB interfaces to see if we can do even better at similar cost.

2 Likes

A couple of months I learned about a collaboration between JackTrip and Connect For Education (C4E) and my understanding was that there was a turnkey setup.
It would be interesting to know details because that could be a huge time (and trouble) saver.
I can understand the attachment to older equipment that had its merits at a time. But when it comes to being serious about making music online with others, up to date recipes for success may not be a luxury. This does not mean it needs to be expensive, on the contrary.

1 Like

Very simply, my audio source was a mechanical metronome in front of a microphone connected to one channel of my oscilloscope (Tektronix MSO4104). This became my JackTrip send signal.

A second channel of the 'scope monitored the returned signal driving my headphones, which included direct monitoring, JackTrip app “Monitor” and “Studio echo” where these measurements were available.

I was just interested in finding out where the delays were being introduced as I suspected the different interfaces.

I used the default settings for the Studio and interfaces but didn’t record them.

I used wired ethernet (100Mb) on a FTTC connection (roughly 80Mb download, 20Mb upload) on the BT / OpenReach network in the UK.

Two servers were tried - one in London, England (180 miles), the other in St Ghislain, Belgium (around 300 miles).

In the following (1) is London, (2) is St Ghislain, (a) is JackTrip monitor, (b) is Studio Echo. The timings for (a) and (b) were measured using the 'scope’s on screen cursors from the microphone input trigger level.

JackTrip App + Tascam Model 24
(1) Connection 15.8ms, (a) 25.03ms, (b) 46.48ms
(2) Connection 19.4ms, (a) 25.03ms, (b) 54.78ms

JackTrip App + Behringer UM2
(1) Connection: 13.5ms, (a) 17.33ms, (b) 40.88ms
(2) Connection: 18ms, (a) 17.33ms, (b) 46.88ms

Note that the UM2 is significantly quicker than the Tascam - measurement (a).

Digital Bridge + Behringer UM2
(1) (b) 49.38ms
(2) (b) 56ms

Analog Bridge
(1) (b) 30.48ms
(2) (b) 38.98ms

Note that the analog bridge gives the best overall performance for measurement (b) (Studio Echo) - much better than the digital bridge / UM2 solution.

I took a series of photos of the resulting traces, noting that when using the bridges the network connection time is not displayed so I was unable to tell if this had changed significantly while taking the sets of bridge measurements. I suspect not.

2 Likes

Thanks @rebholland, this detail is very helpful!

The (a) monitor measurements really stand out to me, and seem to be indicative of a problem. These should be very small (single digit) numbers, since all JackTrip does is take the input signal and add it to the output signal, inside the same callback from the audio interface. My guess is that something is “going wrong” here and that if corrected you’d see better overall numbers from the desktop app, since it includes major performance (and quality) improvements involving network buffering etc that have not (at least yet) been ported back to the bridge devices.

I think it would be useful to double-check that the same buffer sizes are used for both app and bridge devices for all test cases. In case you are not doing so already, I’d strongly recommend testing each signal individually (studio 100% and monitor 0%, then monitor 100% and studio 0%) to ensure you are measuring what you think (I’ve made this mistake many times before). There could be something going on with the specific drivers or hardware that is making these so slow (if we were certifying audio interfaces, I would consider both of these failed), but a larger buffer size may also account for all the differences you’ve observed.

I’m also going to make some time to re-run monitor performance tests myself, just to make sure there isn’t some weird regression that crept into the signal chain.

2 Likes

certifying audio interfaces is an interesting idea.

1 Like

This list is as close as we have to certified devices today, although admittedly the testing performed to date is as rudimentary as possible: does it work, and does it have working Windows ASIO drivers. Ideally we’d have a lab and team that runs them through a stringent regimen with measurements, etc. Roon Ready seems like a nice model to emulate. Hopefully we’ll get there eventually. :slight_smile:

2 Likes

I started a new thread here with my thoughts on the topic of inexpensive onramps for JackTrip.

2 Likes

Thanks @miked.

I’ll check the (a) measurements.

The difference between the Behringer and Tascam didn’t seem unreasonable from earlier measurements I’d made (using the RTL Utility) but the absolute values may indicate something else is going on.

I completed a bunch of measurements which I’m still processing, but going to just dump the raw results here for others who may be following this.

For all the test cases, I generated signal by clapping into a microphone. This was plugged into a mixer so that I could split the signal out two paths: (1) to an interface on a “measurement computer” and (b) to be the input source for the device under test.

I plugged the output for the device I was testing to a second input channel on the measurement computer. On the measurement computer, I ran a DAW (Reason) that recorded both channels: the original source coming straight out of the mixer, and the signal coming out of the output of the device I was testing. I then measured the distance between a common point in the two waveforms. It’s a bit more tedious, but I don’t own an oscilloscope for testing these sort of things…

I tested using 128 and 64 buffer size because I knew that makes a big difference, which you can see in the results.

For the “studio loop” I used a studio running on my LAN with default settings (and the same buffer size), to remove Internet connection variability from the results.

A few initial observations:

  • Analog bridge does outperform most options, other than RME and UA Apollo. At under $18 (USD) Behringer’s UCA222 performs well for the cost.
  • The digital bridge devices do not seem to perform well at all, in general. It appears to be caused by the introduction of a piece of software called “Zita” into the signal chain, which is used to mix together audio across multiple devices. This appears to have introduced a 6-12ms regression in performance.
  • JackTrip’s monitor feature appears to be performing well, with comparable results to Reason’s recording monitor
  • As expected, using a buffer size of 64 versus 128 makes a significant difference
  • As expected, the most recent JackTrip release shaves a few milliseconds off latency.

Analog Bridge (48k)

128
JACK loopback: 6ms
JackTrip v1.6.0 studio loop: 17ms
JackTrip v2.4.1 studio loop: 14ms

64
JACK loopback: 4ms
JackTrip v1.6.0 studio loop: 12ms
JackTrip v2.4.1 studio loop: 10ms

Windows
RME Babyface Pro FS (48k)

128
JackTrip monitor loop: 10ms
JackTrip studio loop: 17ms

64
Reason recording monitor: 5ms
JackTrip monitor loop: 5ms
JackTrip studio loop: 9ms

Mac
UA Apollo x4 (48k)

128
Reason monitor: 9ms
JackTrip monitor loop: 11ms
JackTrip studio loop: 19ms

64
Reason monitor: 7ms
JackTrip monitor loop: 7ms
JackTrip studio loop: 9ms

Windows
UA Volt 476 (48k)

128
JackTrip monitor loop: 13ms
JackTrip studio loop: 21ms

64
JackTrip monitor loop: 8ms
JackTrip studio loop: 12ms

Mac
UA Volt 476 (48k)

128
Reason monitor: 13ms
JackTrip monitor loop: 15ms
JackTrip studio loop: 19ms

64
Reason monitor: 10ms
JackTrip monitor loop: 10ms
JackTrip studio loop: 16ms

Fedora Linux Laptop
UA Volt 476 (48k)

128
JackTrip monitor loop: 15ms
JackTrip studio loop: 21ms

64
JackTrip monitor loop: 9ms
JackTrip studio loop: 18ms

Digital Bridge (48k)
UA Volt 476
With Zita

128
JACK loopback: 25ms
JackTrip v1.6.0 studio loop: 36ms

64
JACK loopback: 14ms
JackTrip v1.6.0 studio loop: 21ms

Digital Bridge (48k)
UA Volt 476
Without Zita

128
JACK loopback: 13ms
JackTrip v1.6.0 studio loop: 26ms

64
JACK loopback: 7ms
JackTrip v1.6.0 studio loop: 15ms

Mac
Behringer UM2 (48k)

128
JackTrip monitor loop: 18ms
JackTrip studio loop: 26ms

64
JackTrip monitor loop: 12ms
JackTrip studio loop: 18ms

Digital Bridge (48k)
Behringer UM2
With Zita

128
JackTrip v1.6.0 studio loop: 34ms

64
JackTrip v1.6.0 studio loop: 22ms

Mac
Behringer UCA222 (48k)

128
JackTrip monitor loop: 18ms
JackTrip studio loop: 23ms

64
JackTrip monitor loop: 12ms
JackTrip studio loop: 17ms

Digital Bridge (48k)
Behringer UCA222
With Zita

128
JACK loopback: 25ms
JackTrip v1.6.0 studio loop: 33ms
JackTrip v2.4.1 studio loop: 33ms

64
JACK loopback: 15ms
JackTrip v1.6.0 studio loop: 21ms
JackTrip v2.4.1 studio loop: 23ms

Digital Bridge (48k)
Behringer UCA222
Without Zita

128
JACK loopback: 14ms
JackTrip v1.6.0 studio loop: 27ms
JackTrip v2.4.1 studio loop: 24ms

64
JACK loopback: 9ms
JackTrip v1.6.0 studio loop: 17ms
JackTrip v2.4.1 studio loop: 16ms

Fedora Linux Laptop
Behringer UCA222 (48k)

128
JackTrip monitor loop: 24ms
JackTrip studio loop: 37ms

64
JackTrip monitor loop: 18ms
JackTrip studio loop: 28ms

Wonderful stuff @miked & thanks for taking the time out to do these measurements.

I just repeated my measurements of the Behringer UM2 on a Mac in case my use of an aggregated interface was causing problems, but it appears not to do so. I also wanted to repeat the measurement with a buffer size of 64. My (a) measurement (Monitor loop) is now 13.83ms (down from 17.33ms at a buffer size of 128). The (b) measurement (Studio loop to London) is 29.68ms (down from 40.88ms). See attached photo.

The Digital Bridge measurements with/without Zita are interesting. I first started using the RPi before USB audio devices were officially supported (I figured out how to link these into the chain) and ran like this until my analog bridge became available, using JackTrip on a London based Linode host. A group of local folks (Sheffield) played well together with these during spring of 2021. I noticed that some time later a slider was added to the bridge settings to allow use of ‘all available audio devices’ - would this have been the Zita addition? I did try turning this off when making my earlier measurements with the digital bridge but it seemed to make no difference.

Regarding the lower cost interfaces you’ve listed above, the UCA222 appears very useful on a Mac for anyone who already has some form of mixer, with the UM2 an option if you require both Mic preamp and Instrument inputs, but there remain driver issues on Windows.

(attachments)

1 Like

Just for comparison I measured the iMac built-in mic / headphone socket at 128 samples. Monitor loop (a) was 21.63ms, Studio loop to London (b) was 45.68ms.

Just a few more take-aways as I’ve been reflecting more on this topic:

  • Always use buffer sizes of 64 when you can. This perhaps has the biggest impact overall and is also mentioned in our guide on optimizing latency. It raises the question, “why does JackTrip default to 128?” This is a question that I still struggle with myself. Lower buffer sizes require faster CPUs, and many computers and audio interfaces can’t handle it. Some even have trouble with 128. So it’s mainly a matter of trying to balance how many people we have complain that it doesn’t work (bad audio) versus latency optimization. To put things in context though, 1024 would have been the number not 10 years ago, and I could see it being 32 or 16 10 years from now… with time everything will get faster, and all of this will get easier.
  • Your audio interface’s round-trip latency is perhaps the most significant single metric, other than the Internet round-trip measurements already provided by JackTrip. After going through measuring all these things that slow/hard way, I (re-)discovered this RTL Utility, which maybe we should just settle on as the go-to for measurement. I do think it’s helpful to have other methods used to compare and verify it, though, which I’ll be doing with my previous results to gain more confidence.
  • Low-latency audio isn’t unique to JackTrip, and many other efforts have focused on this over the years, including measuring many different audio interfaces. Perhaps the most popular is DAW Bench. This seems to be far from complete, however, and focuses more on the high end use for DAWs. There are many thousands of audio interfaces out there, all of which deserve independent measurements. It’s a shame that most manufacturers don’t do this themselves and report it in specifications. But considering the massive differences, I can understand why.
  • I hesitate creating yet another effort to measure audio interfaces when so much has been done already, but I also haven’t found a comprehensive, open and crowd sourced database that I feel is required. Perhaps others know of more resources out there?

I created a new forum category here to start building an open, crowd-sourced database of latency round-trip loopback measurements.

The Presonus AudioBox devices significantly outperform many of the devices that I’ve tested so far. Presonus’ Windows ASIO driver seems to be fantastic, on par with RME. Given that you can buy an AudioBox USB 96 for $85 (USD) at Sweetwater, I currently consider that the best value for the money. At $59 (USD) on Amazon, the Neva Uno appears to be another great low-cost option. It also has built-in virtual channels which make DAW integration a lot easier (no extra third party tools).

I’m sure there are many other great options are out there, and many more to appear in the coming months.