Why the latency?

Submitted by mic on Thu, 05/13/2021 - 21:49

Every time I record a track, the recording is delayed by about 150 ms. It sounds awful. Imagine the playing bass with the prerecorded drums, but then, when listening back, the bass is late on every beat.

Delay in a recorded wave

I guess this could be just my playing and my Focusrite Scarlett and Windows setup, but it is not. I have seen the same thing happen on a MAudio and Linux setup, and with different DAW. The delay will not happen if I record with the same computer, but with the internal non-USB (PCI) soundcard. In other words, it is not my playing. With the Focusrite, the latency is consistent throughout the recorded track and from one recording session to another. It is also the same with different DAW (software).

I see this as a delay in the playback during the recording. The drum track sound comes later than it should be, causing me to play my guitar and bass later and, therefore, producing a delayed recording.

Two types of latencies

There are two types of latencies. There is the delay between the playback of ready tracks and the recording of some new track. This is the one I care about. There is also the delay between the signal being recorded and the same signal being played back during direct monitoring. This is not the one I care about.

I get that ASIO fixes much of this, but all my tests were without ASIO. It bugs me that proprietary software (ASIO) is needed to handle something so simple. There is nothing much to sending some signal to a soundcard for playback and picking up some other signal for recording.

What causes this latency? There is a lot happening when playing and recording sound: the software, the soundcard driver, the operating system (and CPU and USB bus), and the soundcard itself.

Software

I cannot imagine the software causes a delay, especially since this happens with various software, including ones that I have used for a long time and I trust.

Since I have written such software, I can measure the latency caused by it. It takes only 3 ms to start the playback and recording and to send the playback signal to the playback device. Yes, playback and recording seem to be consistently offset by about 15 ms, but that is not to be trusted. While you can supposedly measure the exact position of playback and recording in time, these values in practice are not exact. Either way, none of this will cause a delay of 150 ms.

Soundcard

The soundcard itself should not be the problem. After all, we pay good money for soundcards that boast very little latency. I will just assume that the tests that soundcards producers make are correct. Even if one producer is off, they are not all off.

Driver, operating system, USB bus, CPU

What happens between the software and soundcard is hard to figure out. We do not know everything that the driver, operating system, USB bus, and CPU do. But we can make some inferences.

ASIO supposedly achieves lower latencies by bypassing the operating system. But if the operating system is the problem, then why does everything work fine with PCI soundcards?

There is the CPU. Any processing done by the driver, operating system, and USB bus will go through the CPU, together with any operation done by the software (but not the soundcard). The CPU is a bottleneck. Presumably, things may improve if the CPU is free to do what it needs to do.

This is true. I get lower latency if I close all other applications and remove some startup services. But the difference is minor. Perhaps I shaved off 30 ms from my 150 ms, but the remaining 120 ms are still problematic.

Perhaps the issue is the USB bus. But then there is this:

The Aardvark Direct Mix USB 3

This is the old Aardvark DirectMix USB 3. I used it a decade ago. It had virtually no latency.

It still works. It still has NO LATENCY. It still needs no drivers.

Here is me, tapping on the microphone with a drum beat.

A recording without latency

Aardvark went out of business though.

This leaves the driver. That would be crazy. A driver designed by a company focused on low latency sound produces large latency. This would make some sense if the company focused on ASIO and ignored their non-ASIO driver. Still crazy though…

Why the latency?

So why this latency? I have no idea. The various explanations that I have read make little sense to me. It is not that difficult to handle audio.

And before anyone comments about buffer sizes: We are not talking about direct monitoring from the DAW here, so the buffers should make no difference. Either way, I am testing with the smallest available buffers on my software, which are about 1 ms long.

authors: mic

Add new comment

Filtered HTML

  • Freelinking helps you easily create HTML links. Links take the form of [[indicator:target|Title]]. By default (no indicator): Click to view a local node.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.