Latency definiton
From Ssl-wiki
Taken from this thread from the Native Instruments boards (thanks to Daleth, a user from the board):
- Re: What exactly is Audio Latency?
- To be more precise, latency is the amount of time it takes to fill up the sound card driver's sound buffer. Imagine water pouring into a bucket: you can only drink the water until the bucket is full. If the water has to go through a narrow tap, it takes longer to get into the bucket and therefore longer before it gets to your mouth.
- Now imagine you can drink the water faster than the bucket can be filled: You have a problem. You'll get gaps in the water supply and you'll be gasping like a fish out of water. So what's a good solution? Make the bucket larger! That way you'll be drinking the whole time while it's still being filled. In fact, you could calculate with complete precision just how big the bucket would need to be, if you knew how much water you intended to drink. A lot of internet video is streamed by doing just this calculation.
- The size of the sound buffer / bucket is measures in samples. All digital recording (not just for sound) takes samples of the source material a certain number of times per second. The measurement, taken in Hertz (cycles per second) is the [strong]sampling rate[/strong]. Most systems (Most notably CD Audio) samples sound data 44,100 times per second.
- So the buffer size is also a measure of time: If the buffer is set to hold 2048 samples, that equals 2048 / 44100 = 0.046 seconds, or 46 milliseconds (ms). So if your audio card's latency is set to 2048 samples, it will take 46ms for the buffer to be filled. So you hit the play button and 46 thousandths of a second later, the buffer is full and the audio card begins outputting the data.
- Now, further the analogy: what if the water has to go through another series of narrow pipes before you can drink it? This is essentially what happens if you run the signal through effects. It takes time for the signal to be processed, so once again it is not being output at the same rate it is being input.
- If you're running on a computer with a built-in soundcard, chances are it doesn't have the hardware or drivers to handle that processing very efficiently: it will rely on your computer's CPU (remember that the C stands for Central). If you have a soundcard with special drivers (like ASIO) and hardware, it can take on much, if not all, of the burden itself. This allows the signal to be streamed much closer to real-time, so the buffer doesn't have to be as big.
- I'm sure many of you are already aware of what tends to happen when your buffer is too small: you get really obnoxious clicks. These are called "Buffer underruns," and it's what happens when the buffer is emptied while there's still more signal to go. So the soundcard / drivers has to refill the buffer in the middle of the song! Suddenly 46ms sounds MUCH longer than you thought it was!
- For media player software like Traktor, latency isn't always a problem because the buffer size is, in a sense, irrelevant. All you're doing (MOST of the time) is playing a sound file back, so if you can stand that initial brief delay, you're fine. Latency becomes a MUCH bigger problem if you're recording or generating sound in real time. When you hit a key on your controller, you want to hear the sound immediately! When you play a note on a guitar and listen to it through a mic, you don't want the sound to be out of sync. It's unplayable.
- Luckily, super low-latency hardware and software is much more commonplace than it used to be, and decent ASIO compatible cards are not very expensive. On the other hand, most "normal" applications of sound cards do not require anything special of them (listening to music or watching Simpsons episodes), so manufacturers don't have a good reason to get fancy about the built-in sound.
- I hope you found this enlightening and educational. Note that this general theory of computer science applies to quite a few different things, not just sound (i.e., the video example I mentioned).
- Post any more questions you have!
Another link latency article from Sound and Sound
