Reporting audio output socket latency to host

This forum is for developers of Rack Extensions to discuss the RE SDK, share code, and offer tips to other developers.
Post Reply
User avatar
veezay
RE Developer
Posts: 101
Joined: 28 May 2020
Location: Finland

26 Nov 2020

I'm attempting to report the processing latency of my effect device, but I'm rather lost with the documentation and don't know how it's supposed to be done. Any ideas?

User avatar
Enlightenspeed
RE Developer
Posts: 1103
Joined: 03 Jan 2019

26 Nov 2020

veezay wrote:
26 Nov 2020
I'm attempting to report the processing latency of my effect device, but I'm rather lost with the documentation and don't know how it's supposed to be done. Any ideas?
It's actually very simple, just have a look at the code for the silence detection device :)

User avatar
veezay
RE Developer
Posts: 101
Joined: 28 May 2020
Location: Finland

27 Nov 2020

Enlightenspeed wrote:
26 Nov 2020
It's actually very simple, just have a look at the code for the silence detection device :)
I've tried to go through pretty much every one of the examples, but I can't seem to find anything relevant to sending any DSP latency information to the host. I wonder what I'm missing here. Is it possible they've changed the examples from one SDK version to another?

Thanks for the reply!

User avatar
Enlightenspeed
RE Developer
Posts: 1103
Joined: 03 Jan 2019

27 Nov 2020

veezay wrote:
27 Nov 2020
Enlightenspeed wrote:
26 Nov 2020
It's actually very simple, just have a look at the code for the silence detection device :)
I've tried to go through pretty much every one of the examples, but I can't seem to find anything relevant to sending any DSP latency information to the host. I wonder what I'm missing here. Is it possible they've changed the examples from one SDK version to another?

Thanks for the reply!
Check this for the MoBo declaration:

https://developer.reasonstudios.com/doc ... nd_outputs

The tags are the constants you would expect and you import them as object refs in your constructor, but now that I'm looking at it I'm not seeing anything obvious about the application of the delay in the audio buffer output. The method for setting the DSP buffer output doesn't include that argument (???).

I'd have a try at working on the assumption they work the same as CV output ports, because all that needs to be passed out is an integer value, and there is no overloaded method for JBox_SetDSPBufferData(), so I'd have a crack at seeing if
JBox_StoreMOMPropertyAsNumber(fCVOutObjectRef, kJBox_CVOutputValue, cv) works - add your own values of course, this is pasted from the CV out.

This is a complete guess by the way, I've still to start work on audio plugins. If you're still having no joy after trying the above, go to the "real" RE Dev forum and ask John Engstrom how to do it. :D

Cheers,
Brian

User avatar
buddard
RE Developer
Posts: 1245
Joined: 17 Jan 2015
Location: Stockholm
Contact:

27 Nov 2020

veezay wrote:
26 Nov 2020
I'm attempting to report the processing latency of my effect device, but I'm rather lost with the documentation and don't know how it's supposed to be done. Any ideas?
I think you just do it like this:

Code: Select all

JBox_StoreMOMPropertyAsNumber(outputObjectRef, kJBox_AudioOutputDSPLatency, latencyInSamples);

User avatar
veezay
RE Developer
Posts: 101
Joined: 28 May 2020
Location: Finland

27 Nov 2020

I initially tried doing just that which you both suggested, but I get an error message saying "Could not store property as number: Only properties under rt_owner can be written by DSP". The documentation states that the latency property is owned by the Realtime Controller and not the Realtime.

Also I suppose I don't have access to the actual RE Developer forum because I should first link a company to my account, and I'm not quite there yet to be able to do that.

User avatar
buddard
RE Developer
Posts: 1245
Joined: 17 Jan 2015
Location: Stockholm
Contact:

27 Nov 2020

veezay wrote:
27 Nov 2020
I initially tried doing just that which you both suggested, but I get an error message saying "Could not store property as number: Only properties under rt_owner can be written by DSP". The documentation states that the latency property is owned by the Realtime Controller and not the Realtime.
Ah, that’s right, I think you have to set it in realtime_controller.lua! Sorry, it has been a while since I used the latency stuff...

If you only need to set the latency once (i e if it’s fixed), then you can do it in a lua function that binds to the creation of the RE instance..
If you need to set it dynamically, bind the function to the property or properties that might affect the latency, for example a look ahead setting.
Note that none of the properties that affect latency can be automated, since changing latency on the fly causes audio artifacts. (There is a way to work around this limitation, but it’s not recommended...)

User avatar
veezay
RE Developer
Posts: 101
Joined: 28 May 2020
Location: Finland

28 Nov 2020

buddard wrote:
27 Nov 2020
Ah, that’s right, I think you have to set it in realtime_controller.lua! Sorry, it has been a while since I used the latency stuff...

If you only need to set the latency once (i e if it’s fixed), then you can do it in a lua function that binds to the creation of the RE instance..
If you need to set it dynamically, bind the function to the property or properties that might affect the latency, for example a look ahead setting.
Note that none of the properties that affect latency can be automated, since changing latency on the fly causes audio artifacts. (There is a way to work around this limitation, but it’s not recommended...)
That indeed worked, thanks! It was a case of the classic "so close yet so far away".

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest