Arch manual pages

ALSABAT(ALSA Basic Audio Tester) is a simple command-line utility
intended to help automate audio driver and sound server testing with little
human interaction. ALSABAT can be used to test audio quality, stress test
features and test audio before and after PM state changes.

ALSABAT's design is relatively simple. ALSABAT plays an audio stream and
captures the same stream in either a digital or analog loop back. It then
compares the captured stream using a FFT to the original to determine if the
test case passes or fails.

ALSABAT can either run wholly on the target machine being tested (standalone
mode) or can run as a client/server mode where by alsabat client runs on the
target and runs as a server on a separate tester machine. The client/server
mode still requires some manual interaction for synchronization, but this is
actively being developed for future releases.

The hardware testing configuration may require the use of an analog cable
connecting target to tester machines or a cable to create an analog loopback
if no loopback mode is not available on the sound hardware that is being
tested. An analog loopback cable can be used to connect the "line
in" to "line out" jacks to create a loopback. If only headphone
and mic jacks (or combo jack) are available then the following simple circuit
can be used to create an analog loopback :-

https://source.android.com/devices/audio/loopback.html

If tinyalsa is installed in system, user can choose tinyalsa as backend lib of
alsabat, with configure option "--enable-alsabat-backend-tiny".

Duration of generated signal. The value could be either of
the two forms:

1. Decimal integer, means number of frames;

2. Floating point with suffix 's', means number of seconds.

The default is 2 seconds.

-k

Sigma k value for analysis.

The analysis function reads data from WAV file, run FFT against the data to
get magnitude of frequency vectors, and then calculates the average value
and standard deviation of frequency vectors. After that, we define a
threshold:

threshold = k * standard_deviation + mean_value

Frequencies with amplitude larger than threshold will be recognized as a
peak, and the frequency with largest peak value will be recognized as a
detected frequency.

ALSABAT then compares the detected frequency to target frequency, to decide
if the detecting passes or fails.

Internal loopback mode. Playback, capture and analysis
internal to ALSABAT only. This is intended for developers to test new
ALSABAT features as no audio is routed outside of ALSABAT.

--standalone

Add support for standalone mode where ALSABAT will run on a
different machine to the one being tested. In standalone mode, the sound
data can be generated, playback and captured just like in normal mode, but
will not be analyzed. The ALSABAT being built without libfftw3 support is
always in standalone mode. The ALSABAT in normal mode can also bypass data
analysis using option "--standalone".

--roundtriplatency

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