1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

What exactly is Audio Latency?

Discussion in 'General DJ Forum' started by dub_masta, Apr 16, 2006.

Thread Status:
Not open for further replies.
  1. dub_masta

    dub_masta New Member

    Messages:
    7
    What exactly is Audio Latency. What part of the process does it affect in Traktor 3 ? I know and have read in this forum that it will affect performance in Traktor 3, but i'd like to know exactly what it stands for. Is it the value representing a time frame needed to transfer information from the computer to the soundcard, does it affect audio quality. What are the drawbacks of a higher audio latency settings? Some enlightment is appreciated. Cheers, Patrick.
     
  2. crucial d

    crucial d NI Product Owner

    Messages:
    1,719
    AFAIK the latency setting is for Final Scratch users. It refers to the (admittedly very small) time lag between moving the timecode vinyl with the hand and the response time of the audio wavefile. The lower the latency, the closer to 'real-time' vinyl manipulation is possible.

    For example, the latency of a normal vinyl record would be 0 Ms.

    The more powerful your computer's processor & the more RAM you have will allow you to have a lower latency setting as this is a processor-intensive thing. The range of latency settings is provided to allow for the wide range of different computers out there. If you set the latency too low for your computer, it may not perform to expectations!

    Hope this helps!

    Crucial D
     
  3. dub_masta

    dub_masta New Member

    Messages:
    7
    @ Crucial D tnx for the reply m8. In my case I don't use FS or any analog external mixer. The different Audio Latency values only become available with a Soundcard configured. From personal experience and from reading in the forum it seems though, that with some Audio Latency settings Traktor becomes "buggy" (clicks when change FX, Waveform freeze, etc.)... But I'd still like to know what the different values represent or better put what are they for, what are the drawbacks with higher values and if they affect sound quality.
     
  4. LoungeLover

    LoungeLover Forum Member

    Messages:
    99
  5. boysteve

    boysteve NI Product Owner

    Messages:
    2,339
    Latency can be simply described as the delay between when you do something with MIDI (press a button, play a keyboard, use the xfader) and when it actually happens. A whole lot of processing can occur in that space. The lower the latency, the less time between action and effect, but the more likely the CPU involvement will cause audio dropouts. More latency, more stability -- but much longer time between action and effect. Usual compromise: lower the latency until you get audio dropouts ("crackling"), then raise it a bit.
     
  6. BENN0

    BENN0 Forum Member

    Messages:
    75
    I sometimes see latency mentioned in samples as well. Is this a FS thing or something from the older versions? How does it relate to the latency in ms? x number of ms equal y number of samples at given sample rate?
     
  7. dub_masta

    dub_masta New Member

    Messages:
    7
    @LoungeLover The article, though adressing a different aspect, definetly answered all my questions. Thanks a lot m8!

    @boysteve Thank you for your reply.
     
  8. daleth

    daleth New Member

    Messages:
    7
    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!
     
  9. DJ_Arrant_Prac

    DJ_Arrant_Prac NI Product Owner

    Messages:
    31
    ...

    Traktor isn't *really* media player software in the same way something like winamp or windows media player are... Although you will notice the effect of audio buffer latency in winamp if you modify it's EQ parameters...

    Similarly latency affects traktor because when you modify a parameter such as gain, or hit a cue - the audio frames that traktor processes as you modify that parameter need to reach the output (your speakers) and of course the time it takes to do this depends on how big the buffers are.
     
  10. somedudenamebill

    somedudenamebill New Member

    Messages:
    6
    why cant i get detailed answers to my questions?
     
  11. AudioRapture

    AudioRapture NI Product Owner

    Messages:
    2,892
Thread Status:
Not open for further replies.