Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ metadata:
Audio record/playback validation using GStreamer (gst-launch-1.0).
Tests 10 scenarios: 4 encode (2 audiotestsrc + 2 pulsesrc) + 6 decode (4 playback + 2 OGG/MP3).
Supports WAV, FLAC, OGG, and MP3 formats with both synthetic audio (audiotestsrc) and hardware capture (pulsesrc).
Duration controlled via AUDIO_DURATION (default 10s): audiotestsrc uses num-buffers, pulsesrc uses timeout.
Duration controlled via AUDIO_DURATION (default 10s): audiotestsrc uses num-buffers calculated after argument parsing, pulsesrc uses timeout.
Uses AUDIO_SHARED_RECORDED_DIR for shared artifact storage across test runs.
os:
- linux
scope:
- functional

params:
AUDIO_TEST_MODE: "all"
AUDIO_TEST_NAME: ""
AUDIO_FORMATS: "wav,flac"
AUDIO_DURATION: "10"
AUDIO_GST_DEBUG: "2"

run:
steps:
- REPO_PATH="$PWD"
- cd Runner/suites/Multimedia/GSTreamer/Audio/Audio_Record_Playback/
- export AUDIO_TEST_MODE AUDIO_FORMATS AUDIO_DURATION AUDIO_GST_DEBUG
- ./run.sh --mode "${AUDIO_TEST_MODE}" --formats "${AUDIO_FORMATS}" --duration "${AUDIO_DURATION}" --gst-debug "${AUDIO_GST_DEBUG}" || true
- cd "$REPO_PATH/Runner/suites/Multimedia/GSTreamer/Audio/Audio_Record_Playback"
- AUDIO_SHARED_RECORDED_DIR="${REPO_PATH%%/tests/*}/shared/audio-record-playback"
- export REPO_PATH AUDIO_SHARED_RECORDED_DIR AUDIO_TEST_MODE AUDIO_TEST_NAME AUDIO_FORMATS AUDIO_DURATION AUDIO_GST_DEBUG
- ./run.sh || true
- $REPO_PATH/Runner/utils/send-to-lava.sh Audio_Record_Playback.res
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ At a high level, the test:
4. **Recording phase (ENCODE - 4 tests)**:
- **audiotestsrc tests**: Generates sine wave at 440Hz, encodes to WAV/FLAC
- **pulsesrc tests**: Captures from hardware audio input, encodes to WAV/FLAC
- Saves recorded files to `logs/Audio_Record_Playback/recorded/`
- Saves recorded files to shared directory (via `AUDIO_SHARED_RECORDED_DIR` / `gstreamer_shared_recorded_dir()`)
- CI/LAVA runs: `<repo_root>/shared/audio-record-playback/`
- Local/manual runs: `logs/Audio_Record_Playback/recorded/` (fallback)
- Duration control:
- audiotestsrc: Buffer count calculated dynamically: `(44100 * duration) / 1024`
- pulsesrc: Uses timeout command to stop recording after specified duration
Expand Down Expand Up @@ -94,15 +96,14 @@ By default, the test runs **10 test cases** with 10 second duration:
## PASS / FAIL / SKIP criteria

### PASS
- **Recording**: Output file is created and has size > 1000 bytes
- **Playback**: Pipeline completes successfully with exit code 0 (clean completion)
- **Note**: Timeout (exit code 124) or termination (exit code 143) are treated as **FAIL** for controlled-duration recordings
- This ensures playback completed successfully rather than being interrupted
- **Recording**: Output file is created and has size > 1000 bytes, and no GStreamer errors detected in log
- Exit code is not directly checked - timeout/termination is acceptable if file is valid
- **Playback**: Pipeline completes successfully with exit code 0 and no GStreamer errors detected in log
- **Overall**: At least one test passes and no tests fail

### FAIL
- **Recording**: No output file created or file size too small
- **Playback**: Pipeline exits with non-zero code (including timeout 124 or termination 143) or GStreamer errors detected
- **Recording**: No output file created, file size too small (≤ 1000 bytes), or GStreamer errors detected in log
- **Playback**: Pipeline exits with non-zero code or GStreamer errors detected in log
- **Overall**: One or more tests fail

### SKIP
Expand Down Expand Up @@ -131,15 +132,39 @@ By default, logs are written relative to the script working directory:
playback_flac.log
playback_pulsesrc_wav.log
playback_pulsesrc_flac.log
recorded/ # Recorded audio files
record_wav.wav
record_flac.flac
record_pulsesrc_wav.wav
record_pulsesrc_flac.flac
dmesg/ # dmesg scan outputs (if available)
dmesg_errors.log
```

### Recorded Audio Artifacts

Recorded audio files are stored in a shared directory to enable artifact reuse across test runs:

**Local/Manual Runs** (fallback):
```
./logs/Audio_Record_Playback/recorded/
record_wav.wav
record_flac.flac
record_pulsesrc_wav.wav
record_pulsesrc_flac.flac
```

**CI/LAVA Runs** (shared path):
```
<repo_root>/shared/audio-record-playback/
record_wav.wav
record_flac.flac
record_pulsesrc_wav.wav
record_pulsesrc_flac.flac
```

The recorded artifact directory is determined by:
1. **Explicit override**: `AUDIO_SHARED_RECORDED_DIR` environment variable (if set)
2. **LAVA/tests detection**: Shared path derived from repository structure (if script path contains `/tests/`)
3. **Local fallback**: `./logs/Audio_Record_Playback/recorded/` (for manual runs)

This ensures that in CI/LAVA environments, recorded artifacts are placed in a shared location accessible across multiple test runs, while local/manual runs use a simple local directory.

---

## Dependencies
Expand Down Expand Up @@ -530,21 +555,30 @@ fi
- `SKIP` - No tests executed or all skipped
- Test summary is logged showing pass/fail/skip counts
- Individual test logs are available in `logs/Audio_Record_Playback/`
- Recorded files are preserved in `logs/Audio_Record_Playback/recorded/` for debugging
- Recorded files are preserved in the shared recorded directory for debugging:
- CI/LAVA runs: `<repo_root>/shared/audio-record-playback/`
- Local/manual runs: `logs/Audio_Record_Playback/recorded/` (fallback)

### LAVA Environment Variables

The test supports these environment variables (can be set in LAVA job definition):

- `AUDIO_TEST_MODE` - Test mode (all/record/playback) (default: all)
- `AUDIO_TEST_NAME` - Individual test name for single test execution (optional)
- `AUDIO_FORMATS` - Comma-separated format list (default: `wav,flac`)
- `AUDIO_DURATION` - Recording duration in seconds (default: 10)
- `RUNTIMESEC` - Alternative to AUDIO_DURATION (for backward compatibility)
- `AUDIO_GST_DEBUG` - GStreamer debug level (default: 2)
- `GST_DEBUG_LEVEL` - Alternative to AUDIO_GST_DEBUG
- `AUDIO_CLIP_URL` - URL to download test audio files (OGG/MP3) (default: GitHub release URL)
- `AUDIO_CLIP_PATH` - Local path to test audio files (overrides AUDIO_CLIP_URL if files exist)
- `AUDIO_SHARED_RECORDED_DIR` - Shared directory for recorded audio artifacts (optional)
- `REPO_PATH` - Repository root path (set by YAML, used for path resolution)

**Priority order for duration**: `AUDIO_DURATION` > `RUNTIMESEC` > default (10)

**Shared Artifact Directory**: The test uses `AUDIO_SHARED_RECORDED_DIR` to store recorded audio files in a shared location across multiple test runs. If not set, the test will automatically determine the appropriate directory based on the environment (LAVA vs local).

### Test Counting

- **Total tests**: 10 (when running with default wav,flac formats in all mode)
Expand Down
Loading
Loading