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...