selftests: alsa - add PCM test
authorJaroslav Kysela <perex@perex.cz>
Tue, 8 Nov 2022 11:59:14 +0000 (12:59 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 16 Nov 2022 14:02:17 +0000 (15:02 +0100)
commitaba51cd0949aee50a2b93f1b32ed3668cd613649
tree678a89cebc9fab6370e441abf30fbb49f960afdd
parent3827597a89f85de0e136c67bf38677f2b2fda566
selftests: alsa - add PCM test

This initial code does a simple sample transfer tests. By default,
all PCM devices are detected and tested with short and long
buffering parameters for 4 seconds. If the sample transfer timing
is not in a +-100ms boundary, the test fails. Only the interleaved
buffering scheme is supported in this version.

The configuration may be modified with the configuration files.
A specific hardware configuration is detected and activated
using the sysfs regex matching. This allows to use the DMI string
(/sys/class/dmi/id/* tree) or any other system parameters
exposed in sysfs for the matching for the CI automation.

The configuration file may also specify the PCM device list to detect
the missing PCM devices.

v1..v2:
  - added missing alsa-local.h header file

Cc: Mark Brown <broonie@kernel.org>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Cc: Liam Girdwood <liam.r.girdwood@intel.com>
Cc: Jesse Barnes <jsbarnes@google.com>
Cc: Jimmy Cheng-Yi Chiang <cychiang@google.com>
Cc: Curtis Malainey <cujomalainey@google.com>
Cc: Brian Norris <briannorris@chromium.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20221108115914.3751090-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
tools/testing/selftests/alsa/Makefile
tools/testing/selftests/alsa/alsa-local.h [new file with mode: 0644]
tools/testing/selftests/alsa/conf.c [new file with mode: 0644]
tools/testing/selftests/alsa/conf.d/Lenovo_ThinkPad_P1_Gen2.conf [new file with mode: 0644]
tools/testing/selftests/alsa/pcm-test.c [new file with mode: 0644]