Skip to contentSkip to conversation

selftests: alsa - add PCM test

RFC PATCH Superseded Jaroslav Kysela 1 participant 1 message Nov 8, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jaroslav Kysela

author maintainer
#0 lore raw

RFC PATCH 1/1 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.

Cc Mark Brown <[email protected]>
Cc Pierre-Louis Bossart <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Jesse Barnes <[email protected]>
Cc Jimmy Cheng-Yi Chiang <[email protected]>
Cc Curtis Malainey <[email protected]>
Cc Brian Norris <[email protected]>
---
 tools/testing/selftests/alsa/Makefile         |   4 +-
 tools/testing/selftests/alsa/conf.c           | 379 +++++++++++++
 .../alsa/conf.d/Lenovo_ThinkPad_P1_Gen2.conf  |  76 +++
 tools/testing/selftests/alsa/pcm-test.c       | 523 ++++++++++++++++++
 4 files changed, 981 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/alsa/conf.c
 create mode 100644 tools/testing/selftests/alsa/conf.d/Lenovo_ThinkPad_P1_Gen2.conf
 create mode 100644 tools/testing/selftests/alsa/pcm-test.c
tools/testing/selftests/alsa/Makefile +3 -1
index fd8ddce2b1a6..8ac22d2eb2ba 100644
@@ -7,6 +7,8 @@ ifeq ($(LDLIBS),)
 LDLIBS += -lasound
 endif
 
-TEST_GEN_PROGS := mixer-test
+TEST_GEN_PROGS := mixer-test pcm-test
+
+pcm-test: pcm-test.c conf.c
 
 include ../lib.mk
tools/testing/selftests/alsa/conf.c new file +379 -0

379 lines not on this page · raw message

tools/testing/selftests/alsa/conf.d/Lenovo_ThinkPad_P1_Gen2.conf new file +76 -0

76 lines not on this page · raw message

tools/testing/selftests/alsa/pcm-test.c new file +523 -0

523 lines not on this page · raw message

Signature · 1 line
2.35.3