Skip to content

audio: add ALSA card registration preflight test#458

Open
smuppand wants to merge 2 commits into
qualcomm-linux:mainfrom
smuppand:audio
Open

audio: add ALSA card registration preflight test#458
smuppand wants to merge 2 commits into
qualcomm-linux:mainfrom
smuppand:audio

Conversation

@smuppand
Copy link
Copy Markdown
Contributor

@smuppand smuppand commented May 13, 2026

AudioPlayback and AudioRecord validate end-to-end userspace audio flows, but they can fail due to backend, routing, mixer, clip, or runtime environment issues.

This PR adds a lightweight preflight test to validate the lower-level kernel/ALSA audio card registration path first. This helps quickly identify whether the audio card itself registered correctly before running playback or record tests.

The test is useful for Qualcomm boards where failures may come from:

  • ASoC machine driver probe issues
  • codec or macro registration failures
  • SoundWire/LPASS/WSA/TX/RX/VA audio stack issues
  • missing /dev/snd nodes
  • missing ALSA control node
  • delayed card registration after boot

What this PR changes

  • Adds common helper functions in Runner/utils/[audio_common.sh](http://audio_common.sh/) to:

    • dump ALSA sound inventory
    • detect non-dummy registered ALSA cards
    • wait for ALSA card registration
    • validate /dev/snd/controlC<N>
    • optionally validate PCM/playback/capture entries
    • infer whether audio is expected from DT/sysfs
    • collect audio-focused dmesg diagnostics
  • Adds new test:

    • Runner/suites/Multimedia/Audio/Audio_Card_Registration/[run.sh](http://run.sh/)
    • Runner/suites/Multimedia/Audio/Audio_Card_Registration/Audio_Card_Registration.yaml

Test behavior

The test validates that at least one valid, non-dummy ALSA card is registered and that the matching card has a control node.

By default, the test keeps PCM validation optional to avoid false failures on boards where playback/capture topology can vary by image or platform.

Default checks:

  • ALSA card registration
  • non-dummy card filtering
  • /dev/snd/controlC<N> validation
  • audio-related dmesg triage

Optional checks:

  • any PCM entry
  • playback PCM entry
  • capture PCM entry
  • card name/id substring matching

Result file

The test writes a single fixed result file:

Audio_Card_Registration.res

Lava job for reference with the current changes. https://lava.infra.foundries.io/scheduler/job/212244#L2496

@smuppand smuppand added the enhancement New feature or request label May 13, 2026
smuppand added 2 commits May 14, 2026 09:33
Add common audio helper functions for validating ALSA sound card
registration from tests.

The new helpers provide support to:
- dump ALSA/kernel sound inventory for CI debug
- detect registered non-dummy ALSA cards
- wait for card registration
- validate /dev/snd/controlC<N> nodes
- optionally validate PCM/playback/capture entries
- infer whether audio registration is expected from DT/sysfs
- collect audio-focused dmesg triage

These helpers are intended for lightweight audio preflight tests and do
not start or restart PipeWire, PulseAudio, ADSP, or remoteproc.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Add a new Audio_Card_Registration test to validate that the kernel/ALSA
audio card is registered after boot.

The test validates:
- ALSA card presence under /proc/asound/cards
- non-dummy sound card registration
- /dev/snd/controlC<N> node creation
- optional PCM/playback/capture entries
- audio-related dmesg diagnostics

This provides a fast audio preflight check before running playback or
record tests. It helps distinguish kernel/ASoC card registration issues
from userspace audio backend, routing, clip, or mixer failures.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant