]> git.alsa-project.org Git - alsa-utils.git/commit
alsabat: add round trip audio latency test
authorvivian,zhang <vivian.zhang@intel.com>
Fri, 3 Jun 2016 02:05:08 +0000 (10:05 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 8 Jun 2016 13:11:25 +0000 (15:11 +0200)
commit4157528808e992d0b280f9f9bd8df7d6c81176e5
tree58bcda3e2d101e187d0e395a0daf2d7e49fd55e0
parent2b3adf8668ab4e0e57168725f2562006bb5472ef
alsabat: add round trip audio latency test

Audio latency is the time delay as an audio signal passes through
a system. There are many kinds of audio latency metrics. One useful
metric is the round trip latency, which is the sum of output latency
and input latency.

The measurement step works like below:
1. Listen and measure the average loudness of the environment for
one second;
2. Create a threshold value 16 decibels higher than the average
loudness;
3. Begin playing a ~1000 Hz sine wave and start counting the samples
elapsed;
4. Stop counting and playing if the input's loudness is higher than
the threshold, as the output wave is probably coming back;
5. Calculate the audio latency value in milliseconds.

Signed-off-by: Zhang Vivian <vivian.zhang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
bat/Makefile.am
bat/alsa.c
bat/alsabat-test.sh
bat/alsabat.1
bat/bat.c
bat/common.h
bat/latencytest.c [new file with mode: 0644]
bat/latencytest.h [new file with mode: 0644]
bat/tinyalsa.c