latency correction for jack-client apps or plugins

Hey there,

is it possible to have latency correction for an application that processes audio via jack? for example:

the audio goes from ardour via jack to pure data and then back to ardour to rerecord the processed audio. now the processed audio in ardour is not aligned with the rest anymore. is there a way to correct this? (other then moving the tracks manually)

since there are some jack-plugins now (linuxdsp) this would make sense, or not?

Mixbus has now some external latency compensation via jdelay style ping detection, so technically that may work, and is already part of Ardour’s code.

  Seablade

If you add a jack client effect as an ‘insert’ to a channel then if the effect itself doesn’t add any latency, the audio should still be aligned. I’m not sure about puredata but if for example you patch one of my plugins into an audio channel in Ardour’s mixer as an insert (right click in the Ardour’s mixer’s ‘plugin window’ and select ‘Insert’ from the menu and wire up the effect to the resulting ports that get created - I favour using my jack patch bay for the connections but Ardour also provides a method to do this) - you should then be able to apply the effect to the track without causing any latency. Jack introduces no latency in client to client connections but you may experience some latency if you have to route the output from Ardour back into another track input. In this case it may be better to route the audio in a different way (as I’ve described) if you can. As far as I know all my plugins report the correct latency on their ports if they add any and (with the exception of the overdrive plugin ODV2 due to the oversampling) they shouldn’t add any latency anyway. Or if you are using some of my plugins you could try the LV2 versions - more of these will be arriving some time soon…

Perhaps also worth mentioning - I’ve been testing some DSP code that adds controllable phase rotation to the audio, this works like an analogue phase alignment box and seems to work really well for aligning phase / latency in multi-microphone setups, its different to just time slipping or delaying the tracks, watch out for a new plugin in the next month or so - together with a better description of what it is and how it works…

All JACK clients can report latency on their ports. Pd is not reporting latency correctly on its JACK ports. If it did, the result of the send via Pd would still be aligned correctly.

To correct this you need to use an “artificial latency” plugin (in the SWH plugin set) to fake the latency that Pd is adding. There’s no way to know what the number is so you just have to play with it until ardour does the right thing. Oh, and you need to know one other thing: Ardour only does latency updates at each transport stop, so you need to adjust/stop/roll/adjust/stop as necessary.

thanks for all the answers.

@paul: i’ll bring this up in the pd-list…

This post helped a lot in syncing. Sync the track that goes through jamin (insert, of course) was a hell. I’ve used jack_delay to figure out the parameter for artificial latency, but that didn’t work. After an hour of research, I’ve figured out that putting artificial latency on the track that goes through jamin did the trick. Now, this is weird. First thing that comes to my mind is that jamin is reporting incorrect latency time. I didn’t want to file a bug until I consult with you guys. Anyone can confirm this? My system is amd64 3000+, 2.5GB RAM, Gentoo linux, latest versions of software. Thanx!

Hi thanks for sharing of that system that’s pretty good!!!