Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Latency - what's new?

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    3

    Latency - what's new?

    Hi all

    I searched this forum to find the lowest obtainable end-to-end latency using Teensy 4.0, the audio adapter board and the audio library. I found some posts a few years old, but no very new. Obviously both buffer size and sample rate are important. With Teensy and the most recent audio library, what is achievable? How many buffers will always be in processing when using the library? 2? More?

    Am I right in assuming that: minimal latency = 2 * blocksize / samplerate? And that 16 sample buffers at 44.1 kHz is no problem on Teensy 4.0 when only doing 'light' processing (simple iir filters and some nonlinear distortion).

    Best,

    Morten Joehnk

  2. #2
    Junior Member
    Join Date
    Oct 2019
    Posts
    3
    Oh and by the way: I know that latencies below 5-10 ms are imperceptible. My issue is that comb filtering effects when mixing the delayed signal and the unprocessed signal are noticeable even at very low latencies.

    A bonus question, that I forgot in the first post: Can the stereo channel of the SGTL5000 be split in two totally independent channels or are they somehow tied to each other? I would like to do something like: Audio in -> A/D -> digital processing part 1 -> D/A -> analog processing -> A/D -> digital processing part 2 -> D/A -> Audio out.

    /MJ

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,681
    Latency should be exactly the same as with Teensy 3.x. Same code, same codec hardware = same latency.

    Reducing the block size is the way to get low latency. Some latency exists within the codec. As I recall, it's under 1ms, but there's nothing you can do about it. Best guess is it's mostly due to the digital filters needed after sigma-delta... but they give almost no info about how the chip works internally, so that's just guesswork.

    Yes, the stereo input and output can be used as 2 mono channels.

  4. #4
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    41
    Hi @Mortjo,

    A bit of practical feedback from a live audio effect project that I've been working on. I had same issue with mixing dry and wet signals giving a noticable clangy chorus effect on output.

    I measured 12.2.ms latency to start with which is very noticeable, the project has about 20 objects (effects, filters, mixers etc).

    Re-ordering the order objects are created in took that down to 9.1ms.

    Reducing AUDIO_BLOCK_SAMPLES to 32 took it to 2.7ms and then to 16 took it to 1.7ms.

    All the objects that I used worked fine at 16 samples per block and 1.7ms latent sounds fine to my ears.

    This was on a teensy 3.2 which was also doing a fair bit of work on inputs/outputs ( button pads, leds, knobs etc).

    Only thing to watch is when you update you need to remember to change the block size in the library again if it's overwritten, Cheers, Paul

  5. #5
    Junior Member
    Join Date
    Oct 2019
    Posts
    3
    Hi

    Thanks to both of you for fast replies. I'll order a Teensy 4.0 and a rev D audio adapter when the latter becomes available here in Europe and try my luck.

    Is there any documentation on how the number and ordering of objects changes the number of buffers in flight and thus latency?

    Cheers,

    Morten

  6. #6
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    41
    https://www.pjrc.com/teensy/td_libs_...onnection.html

    Covers a little of this although probably not all the detail you’re looking for.

    I was going to do some experiments to synchronise the wet and dry lines (if that makes sense) however block size got me to where I wanted to get to cheers P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •