Output latency


#1

Is there any possibility to ask host about output latency of plugin? I mean not only the latency that imposes my plugin, but the whole latency of the channel. The sum of delays that is made through whole channel processing, including all plugins, etc.

In VST there was something like getInputLatency and getOutputLatency, and I could ask host about the whole latency before my plugin and after my plugin. In AudioProcessor Class I found getLatencySamples, but it returns something like = getOutputLatency - getInputLatency , and I am interested in both of them, not only the difference.

thank You in advance for any help :slight_smile:


#2

Huh? That would make no sense… There’s a latency between a sample going into a plugin and coming out again, but no way to break that down (??)


#3

If I understand it correctly, what faldbrzus describes does make sense to me, so I’ll use an example to clarify what I understand from it and hopefully it’ll make sense:

[list]
[] Audio channel goes into the DAW via interface via microphone etc[/]
[] Host’s audio buffers add latency of 256 samples. How much of this is before our plugin and how much is after? There’s no real answer to this. Some samples we get when they are new and some may be from 256 samples ago. So let’s say on average half of this latency comes before us and half of it comes after us.[/]
[] Audio on the channel gets processed by several plugins:[/]
[] Plugin FOO is before us and adds latency of 500 samples[/]
[] Our plugin is next on the chain and adds latency of 200 samples as it reports in setLatencySamples.[/]
[] Plugin BAR is after us and adds latency of 1000 samples.[/][/list]

What are the different latencies:
[list]
[] Our own latency is 200 samples as we reported.[/]
[] Total latency on the channel is 256+500+200+1000 = 1956 samples.[/]
[] Latency of samples from input to our plugin is approx. 128+500 = 628 samples. Half of the host buffers plus Plugin FOO’s latency.[/]
[] Latency of samples from our plugin to output is approx. 1000+128 = 1128 samples. Plugin BAR’s latency plus half of the host buffers.[/][/list]

Why would we want to know output latency? For example maybe we want to show graphics which is timed approximately right with the sound, etc.


#4

Ah, sorry, I mis-read the OP’s question. Getting the host’s latency is really nasty, and even if there’s something to do it in VST, it’s unlikely to be supported in all hosts, or other plugin formats. I know that tracktion won’t be able to provide that information (and to do so would be surprisingly difficult/impossible depending on how the plugin is being routed).


#5

[quote=“yairadix”]

Why would we want to know output latency? For example maybe we want to show graphics which is timed approximately right with the sound, etc.[/quote]

That’s exactly what I was thinking about :slight_smile:

Huh… So thank You anyway :). Have a nice day !