Skip to content

Commit e08522e

Browse files
committed
Added Multimedia Video and Display GStreamer test scripts
Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
1 parent 3725379 commit e08522e

6 files changed

Lines changed: 1767 additions & 0 deletions

File tree

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Waylandsink_Playback (GStreamer) — Runner Test
2+
3+
This directory contains the **Waylandsink_Playback** validation test for Qualcomm Linux Testkit runners.
4+
5+
It validates **Wayland display** using **GStreamer waylandsink** with:
6+
- Weston/Wayland server connectivity checks
7+
- DRM display connectivity validation
8+
- Video playback using `waylandsink` element
9+
- Uses `videotestsrc` to generate test patterns
10+
11+
The script is designed to be **CI/LAVA-friendly**:
12+
- Writes **PASS/FAIL/SKIP** into `Waylandsink_Playback.res`
13+
- Always **exits 0** (even on FAIL/SKIP)
14+
- Comprehensive Weston/Wayland environment detection
15+
- Automatic Weston startup if needed
16+
17+
---
18+
19+
## What this test does
20+
21+
1. Sources framework utilities (`functestlib.sh`, `lib_gstreamer.sh`, `lib_display.sh`)
22+
2. **Display connectivity check**: Verifies connected DRM display via sysfs
23+
3. **Weston/Wayland server check**:
24+
- Discovers existing Wayland socket
25+
- Attempts to start Weston if no socket found
26+
- Validates Wayland connection
27+
4. **waylandsink element check**: Verifies GStreamer waylandsink is available
28+
5. **Playback test**: Runs videotestsrc → videoconvert → waylandsink pipeline
29+
6. **Validation**: Checks playback duration and exit code
30+
31+
---
32+
33+
## PASS / FAIL / SKIP criteria
34+
35+
### PASS
36+
- Playback completes successfully (exit code 0 or 143)
37+
- Elapsed time ≥ (duration - 2) seconds
38+
39+
### FAIL
40+
- Playback exits with error code (not 0 or 143)
41+
- Playback exits too quickly (< duration - 2 seconds)
42+
43+
### SKIP
44+
- Missing GStreamer tools (`gst-launch-1.0`, `gst-inspect-1.0`)
45+
- No connected DRM display found
46+
- No Wayland socket found (and cannot start Weston)
47+
- Wayland connection test fails
48+
- `waylandsink` element not available
49+
50+
---
51+
52+
## Dependencies
53+
54+
### Required
55+
- `gst-launch-1.0`
56+
- `gst-inspect-1.0`
57+
- `videotestsrc` GStreamer plugin
58+
- `videoconvert` GStreamer plugin
59+
- `waylandsink` GStreamer plugin
60+
61+
### Display/Wayland
62+
- Weston compositor (running or startable)
63+
- Connected DRM display
64+
- Wayland socket (`/run/user/*/wayland-*` or `/dev/socket/weston/wayland-*`)
65+
66+
---
67+
68+
## Usage
69+
70+
```bash
71+
./run.sh [options]
72+
```
73+
74+
### Options
75+
76+
- `--duration <seconds>` - Playback duration (default: 10)
77+
- `--pattern <smpte|snow|ball|etc>` - videotestsrc pattern (default: smpte)
78+
- `--width <pixels>` - Video width (default: 1920)
79+
- `--height <pixels>` - Video height (default: 1080)
80+
- `--framerate <fps>` - Video framerate (default: 30)
81+
- `--gst-debug <level>` - GStreamer debug level 1-9 (default: 2)
82+
83+
---
84+
85+
## Examples
86+
87+
```bash
88+
# Run default test (1920x1080 SMPTE for 30s)
89+
./run.sh
90+
91+
# Run with 30 second duration
92+
./run.sh --duration 30
93+
94+
# Run with ball pattern
95+
./run.sh --pattern ball
96+
97+
# Run with custom resolution
98+
./run.sh --width 1280 --height 720
99+
```
100+
101+
---
102+
103+
## Pipeline
104+
105+
```
106+
videotestsrc num-buffers=<N> pattern=<pattern>
107+
! video/x-raw,width=<W>,height=<H>,framerate=<FPS>/1
108+
! videoconvert
109+
! waylandsink
110+
```
111+
112+
---
113+
114+
## Logs
115+
116+
```
117+
./Waylandsink_Playback.res
118+
./logs/Waylandsink_Playback/
119+
gst.log # GStreamer debug output
120+
run.log # Pipeline execution log
121+
```
122+
123+
---
124+
125+
## Troubleshooting
126+
127+
### "SKIP: No connected DRM display found"
128+
- Check physical display connection
129+
- Verify DRM drivers loaded: `ls -l /dev/dri/`
130+
131+
### "SKIP: No Wayland socket found"
132+
- Check if Weston is running: `pgrep weston`
133+
- Try starting Weston manually
134+
- Check `XDG_RUNTIME_DIR` and `WAYLAND_DISPLAY` environment variables
135+
136+
### "SKIP: waylandsink element not available"
137+
- Install GStreamer Wayland plugin
138+
- Check: `gst-inspect-1.0 waylandsink`
139+
140+
### "FAIL: Playback failed"
141+
- Check logs in `logs/Waylandsink_Playback/`
142+
- Increase debug level: `./run.sh --gst-debug 5`
143+
- Verify Weston is running properly
144+
145+
---
146+
147+
## LAVA Environment Variables
148+
149+
- `VIDEO_DURATION` - Playback duration
150+
- `VIDEO_PATTERN` - videotestsrc pattern
151+
- `VIDEO_WIDTH` - Video width
152+
- `VIDEO_HEIGHT` - Video height
153+
- `VIDEO_FRAMERATE` - Video framerate
154+
- `VIDEO_GST_DEBUG` - GStreamer debug level
155+
- `RUNTIMESEC` - Alternative to VIDEO_DURATION
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
metadata:
2+
name: gstreamer-waylandsink-playback
3+
format: "Lava-Test Test Definition 1.0"
4+
description: >
5+
GStreamer waylandsink playback validation with Weston/Wayland server checks
6+
on Qualcomm Linux platforms. Uses videotestsrc to generate test patterns
7+
and displays them via waylandsink. Validates display connectivity and
8+
Wayland compositor functionality.
9+
os:
10+
- linux
11+
scope:
12+
- functional
13+
14+
params:
15+
# Video resolution (WIDTHxHEIGHT)
16+
VIDEO_RESOLUTION: "1920x1080"
17+
18+
# Test pattern for videotestsrc
19+
VIDEO_PATTERN: "smpte" # smpte|snow|black|white|red|green|blue|checkers-1|checkers-2
20+
21+
# Playback duration in seconds
22+
PLAYBACK_DURATION: "30"
23+
24+
# Frame rate
25+
FRAMERATE: "30"
26+
27+
# GStreamer debug level
28+
VIDEO_GST_DEBUG: "2" # 1-9
29+
30+
run:
31+
steps:
32+
- REPO_PATH="$PWD"
33+
34+
# Navigate to test directory
35+
- cd Runner/suites/Multimedia/GSTreamer/Display/Waylandsink_Playback/
36+
37+
# Build CLI args only when params are non-empty
38+
- |
39+
CMD="./run.sh"
40+
41+
[ -n "${VIDEO_RESOLUTION}" ] && CMD="${CMD} --resolution ${VIDEO_RESOLUTION}"
42+
[ -n "${VIDEO_PATTERN}" ] && CMD="${CMD} --pattern ${VIDEO_PATTERN}"
43+
[ -n "${PLAYBACK_DURATION}" ] && CMD="${CMD} --duration ${PLAYBACK_DURATION}"
44+
[ -n "${FRAMERATE}" ] && CMD="${CMD} --framerate ${FRAMERATE}"
45+
[ -n "${VIDEO_GST_DEBUG}" ] && CMD="${CMD} --gst-debug ${VIDEO_GST_DEBUG}"
46+
47+
echo "[LAVA] Running: ${CMD}"
48+
sh -c "${CMD}" || true
49+
50+
# Send result to LAVA
51+
- "${REPO_PATH}/Runner/utils/send-to-lava.sh Waylandsink_Playback.res || true"

0 commit comments

Comments
 (0)