Latency Measurements Protocol
This protocol consists on sending a digital pulse to trigger a square wave. This digital pulse is sent from the Soundcard's OUT0 pin to the IN0. Then, when the computer receives the information that the IN0 switched from LOW to HIGH, it tells the soundcard to start playing the sound in index 2. So, the latency measured with this protocol takes into account the two-way data streaming via USB.
For this protocol, a Harp SoundCard is used and it is assumed that both the USB drivers and the board's firmware are already installed. If these are not installed, follow the instructions in the device's repository.
Protocol
- Download this Bonsai environment and extract it.
- Open the Harp Sound Card GUI and load
square_wave.bin(which is in the Bonsai environment's directory) to index 2. - Run
Bonsai.exeand open thelatency.bonsaiworkflow. - Connect the OUT0 and IN0 pins of the SoundCard.
- Connect either the left or right audio channel from the Soundcard to one of the oscilloscope's input channels.
- Connect OUT0 (and one of the Soundcard's ground pins) to another oscilloscope's input channel.
- Start the Bonsai workflow and press
Ato send a 100 ms pulse from the OUT0 pin. This pulse will then trigger the signal. - Measure the delay between the start of the pulse and the start of the square wave. In the figure below, the measured latency is of 2.5 ms (the blue signal is the pulse and the red one is the square wave).