-
Notifications
You must be signed in to change notification settings - Fork 33
Latency
The signal processing after recording a signal and before playing it back takes some time, called latency. Latency can result in undesired perceptual artifacts and therefore limit the performance of the hearing device. Latency can disturb in different manners:
- Interference with the direct sound leaking through the earplug and the sound played back by the device. This is referred to as comb-filtering effects, which are perceivable already at very low delays of less than a millisecond
- A noticeable delay between visual movements and the expected change in perceived sound, become relevant above roughly 80 ms.
As a rule of thumb: Values below 5 ms can be considered good, up to 10 ms acceptable, and above 10 ms potentially disturbing.
There are several different ways to measure the processing latency.
- Configure your sound card correctly, e.g., adjust the volume with
alsamixer
- Start byobu:
byobu
(Instead, you can also use different terminals with Ctrl+Alt+F2, Ctrl+Alt+F3, ... or connect several times via ssh)- With byobu, split the window in three tiles, e.g, pressing Shift+F2 twice.
- Toggle between the windows with Shift+F3 and Shift+F4
- Start Jack in one terminal:
jackd -dalsa -dhw:audioinjectorpi -p48 -n2 -r48000 -s
- Start jack_iodelay in another terminal:
jack_iodelay
- Start njconnect in the last terminal and press "a"
- Connect "jack_delay:out" with "system:playback_1" and "system:capture_1" with "jack_delay:in"
- Read out the delay: In my example 3.587 ms
Please note, that the value here only includes the recording and playback with jack, but not the signal processing time of openMHA and hence denotes a lower limit.
The feedback path contains the information about the time that the signal needs for a whole cycle though the device (including the acoustic delay which is negligible with about 0.03 ms/cm).
It can be measured and visualized with on-board tools.
Here is an example:
feel free to add your measurements