Old 08-13-2010, 02:00 PM   #1
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,514
Default Loop-back testing JS FX

Been trying to get to grips with the latency of my USB audio device (Lexicon Lambda), I performed several loop-back tests as detailed by Lokasenna here http://forum.cockos.com/showthread.php?t=48884. But I got tired of manually adjusting the time selection to read the number of delayed samples, so I wrote this little JS FX to do the testing for me. It seems to work fine, and maybe it is useful to someone else to get to grips with the latency in their systems.

What it does is, when playing or recording, it waits a specified amount of time (default 0.5 secs) and then outputs a single sample pulse on the left channel. This pulse is then routed through the master channel to the left output of the audio device. The left output of the device should be connected by a cable to the right input of the audio device, this is the "loop-back" (see pic).

[IMG]http://a.**************/img842/8808/loopbacktestersetup.th.jpg[/IMG]

The device then returns its (im)pulse-response on the right channel, and the loop-back tester JS FX counts the number of samples between when the pulse was output and when the response returns. The threshold for determining when the pulse comes in can be adjusted (default -52dB). You can also adjust the level of the pulse (default -12dB), as well as the time to wait before outputting the pulse (default 0.5 secs).

Attached is also a small Reaper project that I have used to do the testing of the loop-back tester JS FX, but it is set up specifically for my system, so you have to adapt it to your own setup, of course. Basically this means going into preferences and selecting the device you want to test, and to set the master output to the left channel of the device. All else is already taken care of, I think (and hope).

The attached zip contains the code for the loop-back tester JS FX, just drop the "MF" dir in your Reaper "Effects" dir. There is also the .RPP-file for the loop-back testing project, and a jpg of the setup (this jpg is used in the RPP).

Notes:
* It is important that you connect left output of your device to its right input (or an input that comes in to Reaper on the right channel, if you have multiple inputs) with an appropriate cable. Doing otherwise (connecting left out to left in, for instance) may create a loop which could potentially break your interface (potentially, I don't really see how, but still, better safe than sorry...)
* Make sure those are line level inputs and outputs (or at least matching, but what else but line level and high impedance are there?)
* Have Reaper set to mute master output above, say, +3 dB for extra protection.
* The Master should be set to only output on the left channel (click the "IO" button on the master track and select the left channel hardware output).
* Disconnect the left input pin on the JS FX (click the "2 in 2 out" button on the plugin in the FX window, see pic below).
* I also recommend disconnecting (physically) all other ins and outs on your audio device.
* The track with the loop-back tester JS FX should be record armed with Record Monitoring: ON, and the Stereo Input.
* If you want to record the pulse and the response (this is not necessary for measuring the latency), you should Record: output (stereo).
* The latency is reported by the plugin as number of samples between sending the pulse and receiving the input, that is, the "round-trip" (you read this on the plugin at the bottom slider where it says "samples waited (read only)", see pic below).

[IMG]http://img838.**************/img838/8127/loopbacktesterpins.th.png[/IMG]

The supplied project should (ideally) work straight away, it has all the settings correctly set, so you should (ideally) only have to connect the physical cables and then play (or record). But, if you don't get it to work out-of-the-box, the points above hopefully guides you how to set it up for your particular system.

Any questions bugs etc, don't hesitate...
Attached Files
File Type: zip LoopbackTester.zip (37.9 KB, 528 views)
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...

Last edited by Fabian; 11-07-2010 at 12:15 PM.
Fabian is offline   Reply With Quote
Old 11-07-2010, 12:06 PM   #2
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,514
Default

Some extra help/discussion about this plugin here http://forum.cockos.com/showthread.php?p=613392
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 11-15-2010, 08:43 AM   #3
d. gauss
Human being with feelings
 
Join Date: May 2006
Posts: 1,393
Default

hi, no matter where i put the MF directory, reaper can't find your plugin. any advice? oops never mind i founbd it.

Last edited by d. gauss; 11-15-2010 at 08:51 AM.
d. gauss is offline   Reply With Quote
Old 11-15-2010, 01:35 PM   #4
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,514
Default

Quote:
Originally Posted by d. gauss View Post
hi, no matter where i put the MF directory, reaper can't find your plugin. any advice? oops never mind i founbd it.
Good that you find. As a reference for others:

How to find where to put the JS FX
Within Reaper, run the action "Show REAPER resource path in explorer". This opens your file explorer in the folder which holds a folder named "Effects". It is there that you put your JS effects. On my W7x64 machine this is C:\Uses\Fabian\AppData\Roaming\REAPER, and the JS's go into the Effects folder that's already there. This is where you put the "MF" folder from the zip-file downloadable above. If you're on Mac I guess it's very similar.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 04-13-2011, 02:43 PM   #5
Cableaddict
Human being with feelings
 
Join Date: Apr 2008
Posts: 1,883
Default

I'd like to try this (a time-saver) but before I go to the trouble:

What do you mean, route the signal back to the RIGHT input? I have 16 inputs.

What exactly is the plugin looking to see, as a return signal?

============

Also a note about your bundled session:

I have found that, with some hardware, RT latency can change depending upon the plugins setup. For instance (and I'm not kidding) With my Lynx PCIe card & Aurora, if I disable PDC on EVERY single plugin, I actually get 1.8 ms MORE delay than if I leave one PDC active. (on a heavy-delay plugin) I swear.
I think what happens is that the Lynx double-buffer protection kicks in.

Anyway, the point is that accurate latency testing can only be done on the exact session you want to know about. Too many hardware & software issues could be unknown factors.

Last edited by Cableaddict; 04-13-2011 at 02:51 PM.
Cableaddict is offline   Reply With Quote
Old 04-13-2011, 04:42 PM   #6
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 25,054
Default

The loop back test (in DAW terms) is as old as DAWs themselves. I actually find it surprising that this is still somewhat unknown to so many users.

Quote:
Anyway, the point is that accurate latency testing can only be done on the exact session you want to know about. Too many hardware & software issues could be unknown factors.
It doesn't really matter what the factors are, just compensate for them. Create a project called "calibration.rpp"; Open it and make the required adjustment anytime you are doing something important or do it on new projects specifically. A script isn't needed for this btw but it likely makes it easier for some. Either way, everyone should know how to quickly and easily measure and make this adjustment. I'm still quite surprised we are this far into the game and it isn't common knowledge for most anyone using a DAW and recording live sources. It doesn't need to be over analyzed, just needs to be done.

Karbo
__________________
Clever is not the same as good, clever is from the head, good is from the heart. -Benmont Tench
karbomusic is online now   Reply With Quote
Old 04-14-2011, 12:42 AM   #7
Fabian
Human being with feelings
 
Fabian's Avatar
 
Join Date: Sep 2008
Location: Sweden
Posts: 5,514
Default

Quote:
Originally Posted by Cableaddict View Post
What do you mean, route the signal back to the RIGHT input? I have 16 inputs.
OK; good point, Cableman...

You put the FX on a track... When you play or record, the FX outputs a one-sample (im-)pulse on that tracks channel 1 (spl0 in JS terms) and waits for input on channel 2 (spl1 in JS). So, in whatever way you route those channels, the corresponding physical output and input need to be connected by a physical cable.

OK?

And, the idea is to test with a single track with this single FX on, otherwise of course, anything can cause any type of latency disruption. Basically, the JS FX automates what was suggested by Lokasenna to do manually in the post linked to in my OP.
__________________
// MVHMF
I never always did the right thing, but all I did wasn't wrong...
Fabian is offline   Reply With Quote
Old 04-14-2011, 08:34 AM   #8
Cableaddict
Human being with feelings
 
Join Date: Apr 2008
Posts: 1,883
Default

Quote:
Originally Posted by karbomusic View Post
T
It doesn't really matter what the factors are, just compensate for them.

Karbo
You can't compensate for them if you aren't aware of them. See my specific example, above, with the Lynx card. I wasn't even looking for that, but it exists.

--------------

Fabian, thanks for the clarification.
Cableaddict is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.