ioap_hf_get_latency_estimate()

Get the latency estimate from a latency test.

Synopsis:

#include <acoustic/hf.h>

int ioap_hf_get_latency_estimate(
                int apd,
                ioap_hf_latency_estimate_t* estimate);

Arguments:

apd
The handle to io-acoustic.
estimate
Pointer to the structure with the results of the latency test.

Library:

libacoustic

Description:

The ioap_hf_get_latency_estimate() function retrieves the results of latency tests started by ioap_hf_start_latency_test() and placed in the ioap_hf_latency_estimate_t data structure.

A latency test determines the latency for each of nine clicks that are played back. The two smallest and two largest latency values are discarded. The remaining five latency values are used to calculate the three values returned by the test:
  • latency estimate
  • latency spread
  • cross-correlation
A successful latency test should return a latency-spread of < 4 milliseconds and a cross-correlation of > 500. If the latency spread is greater than 4 milliseconds or the cross-correlation is less than 500, the signal to noise ratio of the clicks should be increased, for example by increasing the playback volume or decreasing the ambient noise level. If the latency is > 100 milliseconds, you should increase the offset specified when starting the test in order to move the estimate calculation into the correct measurement window.

The msrefdelta_default key in the .conf configuration file should be set to the difference between the msprime and the returned latency estimate. See "Configuration keys".

Returns:

0
Success
-1
An error occurred (errno is set).

Errors:

EINVAL
Invalid handle or null pointer argument.
EACCESS
Acoustic processing hasn't been started.
EAGAIN
Test result isn't ready yet.
EFAULT
An error occurred while retrieving the estimate.
ENOTSUP
Diagnostics processing hasn't been enabled.

Classification:

QNX Neutrino

Safety:  
Interrupt handler No
Signal handler No
Thread Yes