Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Runner/config/pkg_command_map.conf
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,13 @@ ubuntu:package-set:graphics=kgsl-dkms adreno-common adreno-gles1 adreno-gles2 ad

# Base Debian Audio stack.
debian:package-set:audio-base=alsa-utils pipewire-bin wireplumber pulseaudio-utils


# Ubuntu Audio package profiles. Server images require ALSA utilities only.
# Desktop images additionally require the PipeWire daemon, PulseAudio
# compatibility service, session manager, and playback/control clients.
ubuntu:package-set:audio-base=alsa-utils
ubuntu:package-set:audio-desktop=pipewire pipewire-pulse wireplumber pipewire-bin pulseaudio-utils

# Debian Qualcomm AudioReach overlay stack.
#
# This package set is complete by itself because overlay mode checks only
Expand Down
40 changes: 36 additions & 4 deletions Runner/suites/Multimedia/Audio/AudioPlayback/Read_me.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,47 @@ The test suite includes 10 diverse audio clip configurations covering various sa

## Prerequisites

Ensure the following components are present in the target Yocto build:
Yocto images must provide the following components. The suite does not change
the Yocto package flow.

- PipeWire: `pw-play`, `wpctl`
- PulseAudio: `paplay`, `pactl`
- ALSA: `aplay`, `amixer`, `alsaucm` when UCM is available
- Common tools: `pgrep`, `timeout`, `grep`, `wget`, `tar`
- Daemon: `pipewire` or `pulseaudio` must be running

### Ubuntu package preparation

When run as root, the suite uses the shared package provider to install missing
Ubuntu audio packages. It does not run a blanket distribution upgrade.

- `auto` is the default profile. It selects `desktop` when `graphical.target`
is active and otherwise selects `server`.
- `server` ensures `alsa-utils` for ALSA playback.
- `desktop` ensures `alsa-utils`, `pipewire`, `pipewire-pulse`, `wireplumber`,
`pipewire-bin`, and `pulseaudio-utils`.
- Set `AUDIO_PACKAGE_UPDATE=1` only when installed packages should be upgraded
as part of the test preparation.

The optional `snd-soc-wcd938x` codec module is loaded only when the running
kernel provides it. Targets without that module are unchanged.

```sh
# Let the suite detect a server or desktop Ubuntu image
./run.sh --clip-name "playback_config1 playback_config7"

# Force desktop package preparation
AUDIO_PACKAGE_PROFILE=desktop \
./run.sh --clip-name "playback_config1 playback_config7"

# Upgrade the selected profile's installed packages
AUDIO_PACKAGE_PROFILE=desktop AUDIO_PACKAGE_UPDATE=1 \
./run.sh --clip-name "playback_config1 playback_config7"
```

## Backend and Route Selection

When no backend is requested, the suite uses automatic selection. A physical PipeWire audio sink uses `pw-play`, and a physical PulseAudio sink uses `paplay`. Dummy, null, monitor, and loopback PipeWire sinks are not accepted as speaker routes.
When no backend is requested, the suite uses automatic selection. A physical PipeWire audio sink uses `pw-play`, and a physical PulseAudio sink uses `paplay`. For the `speakers` route, a speaker endpoint takes precedence over headphones, then other physical outputs. Dummy, null, monitor, and loopback PipeWire sinks are not accepted as speaker routes.

If automatic selection finds no physical managed speaker sink, the suite probes direct ALSA playback. It selects an ALSA card and PCM from the available device inventory, applies only mixer controls exposed by that card, and runs `aplay -D <device>`. This supports the Shikra primary-MI2S, secondary-TDM, and codec-direct route capabilities without selecting a form factor or assuming card `0`.

Expand Down Expand Up @@ -242,8 +272,10 @@ DMESG_SCAN Scan dmesg for errors after playback 1
VERBOSE Enable verbose logging 0
EXTRACT_AUDIO_ASSETS Download/extract audio assets if missing true
ENABLE_NETWORK_DOWNLOAD Enable network download of missing audio files false
AUDIO_CLIPS_BASE_DIR Custom path to pre-staged audio clips (CI use) unset
JUNIT_OUT Path to write JUnit XML output unset
AUDIO_CLIPS_BASE_DIR Custom path to pre-staged audio clips (CI use) unset
AUDIO_PACKAGE_PROFILE Ubuntu package profile: auto, server, or desktop auto
AUDIO_PACKAGE_UPDATE Upgrade selected Ubuntu audio packages 0
JUNIT_OUT Path to write JUnit XML output unset
SSID Wi-Fi SSID for network connection unset
PASSWORD Wi-Fi password for network connection unset
NET_PROBE_ROUTE_IP IP used for route probing (default: 1.1.1.1) 1.1.1.1
Expand Down
24 changes: 21 additions & 3 deletions Runner/suites/Multimedia/Audio/AudioPlayback/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,15 @@ Usage: $0 [options]

Environment:
AUDIO_PLAYBACK_VOLUME
PipeWire speaker volume applied to the dynamically discovered sink.
Default: 1.0. Null sinks are not unmuted or assigned a volume.
PipeWire speaker volume applied to the dynamically discovered sink.
Default: 1.0. Null sinks are not unmuted or assigned a volume.

AUDIO_PACKAGE_PROFILE
On Ubuntu, select package preparation profile: auto, server, or desktop.
Auto selects desktop only when graphical.target is active.

AUDIO_PACKAGE_UPDATE=1
On Ubuntu, upgrade already installed packages in the selected Audio profile.

Testing Modes:
Clip Discovery Mode (Recommended):
Expand Down Expand Up @@ -459,7 +466,18 @@ if [ "$AUDIO_PLAYBACK_OS_ID" = "debian" ]; then
AUDIO_PLAYBACK_DEBIAN_ROOT_MODE=1
fi

export AUDIO_PLAYBACK_DEBIAN_ROOT_MODE
# Desktop Ubuntu images run PipeWire and the PulseAudio compatibility server in
# the logged-in user's session. The test itself is often launched by root, so
# command-level backend probes and players must join that session rather than
# querying root's empty runtime directory. audio_run_as_test_user discovers the
# owner dynamically, which avoids hardcoding a desktop username.
AUDIO_USE_DESKTOP_SESSION=0
if [ "$AUDIO_PLAYBACK_OS_ID" = "ubuntu" ] &&
[ "$(id -u 2>/dev/null || echo 1)" -eq 0 ]; then
AUDIO_USE_DESKTOP_SESSION=1
fi

export AUDIO_PLAYBACK_DEBIAN_ROOT_MODE AUDIO_USE_DESKTOP_SESSION

# Auto-enable network download if WiFi credentials provided
if [ -n "$SSID" ] && [ -n "$PASSWORD" ]; then
Expand Down
Loading
Loading