How is Internal Plugin latency Applied in Tracktion Engine?

Ok that’s interesting to know. I was able to get my playback graph printed and couldn’t find any issues there so that would rule out the way latency is being handled, leaving the amount of latency reported.

I guess I have to go learn how plugins calculate their latency and figure out how to tamper with that to try to understand what’s happening.

Let me know if anything comes of the failed tests. Thanks!

Are you just using the stock PitchShiftPlugin?

I added a cents control to it, otherwise it’s stock. The cents parameter just gets added in to the semitones float, nothing fancy.

And if you do the exact same thing as in my video above what do you see?

It sounds correct, and I get this much latency in the cpu monitor (great feature!), 277.33ms. I don’t know if my version of Waveform is using Rubberband though, it’s just the regular build everyone gets off the website. I assume the plugins it loads are built into it, no?

In Waveform we use Elastique Pro.

I did a special build of Waveform to use Rubber Band but it shows the result is the same (so the Pitch Shift Plugin) is working the same.

What I meant was to replicate that test in your own software. It should sound the same there if you’re using Rubber Band.

Oh yeah I did this earlier:

They’re off, and the reason for the initial post.

Check out this excellent text file which explains more.

2024-07-31 16-07-38.mp4.txt (6.4 MB)

Is it possible to have the plugin report the correct latency and to play at the correct time, but to have another track play early? Here I’ve set the latency of PitchShiftPlugin to be 10 times greater than it reports. The pitch is correct, the delay seems reasonable too, but playback of the first track starts as soon as I press play on the transport. What parts of the system might need to be configured to address this sort of discrepancy?

2024-07-31 16-48-50.mp4.txt (5.5 MB)

I don’t really understand what’s going on in that second example. It’s like the latency compensation is backwards…

If your PitchShiftPlugin is reporting something like 1000ms but only actually applying ~200ms of latency, you’d expect that the first track (with no latency) would be heard about 800ms after the first (as it should have been delayed 800ms).


There is a Plugin called LatencyPlugin in the Engine which we use for testing purposes. All it does is report some latency and optionally delay the incoming signal by that amount. This is useful to test the scenarios we’ve discussed here.

Can you add that to your app and set a large latency and see if you get the same result? I tend to reduce the gain of one track to identify the different ones and probably remove the number of hats so there’s more space between them.

Like this:
latency_tester.mp4.txt (1.6 MB)

1 Like

Alright, in the video PitchHACK is the latency plugin which I’ve hard coded to return 48000 samples of delay. The delay is applied to the first track which is also hard panned right. You can hear that the first track starts playing about a second later than the first.

2024-08-01 10-59-13.mp4.txt (3.6 MB)

Does this clarify anything?

It certainly looks like the PDC isn’t working correctly (i.e. the LatencyNodes aren’t getting created or doing their job).

But I don’t remember a time when this wasn’t working in the Engine. It’s pretty fundamental and we have test coverage for it.

What commit of the engine are you forked off?

This is my best guess:

$ git merge-base HEAD upstream/master
113459301f61b8f4aeb1f7774d610970e3964e17

$ git show 113459301f61b8f4aeb1f7774d610970e3964e17
commit 113459301f61b8f4aeb1f7774d610970e3964e17
Author: David Rowland <drowland96@gmail.com>
Date:   Wed Dec 14 11:25:23 2022 +0000

    TSan:   Another fix

The MVP Dave Rowland with another fix haha. Yeah the fork is quite old at this point. I want to update to the latest version of the engine because the new features look wonderful but that would be quite a task at the moment.

That’s two and a half years old. There’s probably been thousands of changes in that time :joy:

We really can’t be expected to support such an old version I’m afraid as there have been tons of fixes since and tests added to verify behaviour.

1 Like