Skip to content

Commit ee7c271

Browse files
authored
Merge pull request #290 from nitinn22/feature/gstchange
Added Multimedia Video and Display GStreamer test scripts
2 parents d2585b7 + 72946d2 commit ee7c271

7 files changed

Lines changed: 2515 additions & 0 deletions

File tree

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
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+
- `--resolution <WIDTHxHEIGHT>` - Video resolution (e.g., 1920x1080, 3840x2160) (default: 1920x1080)
77+
- `--duration <seconds>` - Playback duration (default: 30)
78+
- `--pattern <smpte|snow|ball|etc>` - videotestsrc pattern (default: smpte)
79+
- `--width <pixels>` - Video width (alternative to --resolution) (default: 1920)
80+
- `--height <pixels>` - Video height (alternative to --resolution) (default: 1080)
81+
- `--framerate <fps>` - Video framerate (default: 30)
82+
- `--gst-debug <level>` - GStreamer debug level 1-9 (default: 2)
83+
84+
---
85+
86+
## Examples
87+
88+
```bash
89+
# Run default test (1920x1080 SMPTE for 30s)
90+
./run.sh
91+
92+
# Run with custom resolution using --resolution
93+
./run.sh --resolution 3840x2160
94+
95+
# Run with custom resolution and duration
96+
./run.sh --resolution 3840x2160 --duration 20
97+
98+
# Run with ball pattern
99+
./run.sh --pattern ball
100+
101+
# Run with custom resolution using separate width/height
102+
./run.sh --width 1280 --height 720
103+
104+
# Run with different framerate
105+
./run.sh --framerate 60
106+
107+
# Run with higher debug level
108+
./run.sh --gst-debug 5
109+
```
110+
111+
---
112+
113+
## Pipeline
114+
115+
```
116+
videotestsrc num-buffers=<N> pattern=<pattern>
117+
! video/x-raw,width=<W>,height=<H>,framerate=<FPS>/1
118+
! videoconvert
119+
! waylandsink
120+
```
121+
122+
---
123+
124+
## Logs
125+
126+
```
127+
./Waylandsink_Playback.res
128+
./logs/Waylandsink_Playback/
129+
gst.log # GStreamer debug output
130+
run.log # Pipeline execution log
131+
```
132+
133+
---
134+
135+
## Troubleshooting
136+
137+
### "SKIP: No connected DRM display found"
138+
- Check physical display connection
139+
- Verify DRM drivers loaded: `ls -l /dev/dri/`
140+
141+
### "SKIP: No Wayland socket found"
142+
- Check if Weston is running: `pgrep weston`
143+
- Try starting Weston manually
144+
- Check `XDG_RUNTIME_DIR` and `WAYLAND_DISPLAY` environment variables
145+
146+
### "SKIP: waylandsink element not available"
147+
- Install GStreamer Wayland plugin
148+
- Check: `gst-inspect-1.0 waylandsink`
149+
150+
### "FAIL: Playback failed"
151+
- Check logs in `logs/Waylandsink_Playback/`
152+
- Increase debug level: `./run.sh --gst-debug 5`
153+
- Verify Weston is running properly
154+
155+
---
156+
157+
## LAVA Environment Variables
158+
159+
The test supports these environment variables (can be set in LAVA job definition):
160+
161+
- `VIDEO_DURATION` - Playback duration in seconds (default: 30)
162+
- `RUNTIMESEC` - Alternative to VIDEO_DURATION
163+
- `VIDEO_PATTERN` - videotestsrc pattern (default: smpte)
164+
- `VIDEO_WIDTH` - Video width (default: 1920)
165+
- `VIDEO_HEIGHT` - Video height (default: 1080)
166+
- `VIDEO_FRAMERATE` - Video framerate (default: 30)
167+
- `VIDEO_GST_DEBUG` - GStreamer debug level (default: 2)
168+
- `GST_DEBUG_LEVEL` - Alternative to VIDEO_GST_DEBUG
169+
170+
**Priority order for duration**: `VIDEO_DURATION` > `RUNTIMESEC` > default (30)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
metadata:
2+
name: 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_DURATION: "30" # seconds
16+
VIDEO_PATTERN: "smpte" # smpte|snow|black|white|red|green|blue|checkers-1|checkers-2|ball
17+
VIDEO_WIDTH: "1920" # pixels
18+
VIDEO_HEIGHT: "1080" # pixels
19+
VIDEO_FRAMERATE: "30" # fps
20+
VIDEO_GST_DEBUG: "2" # 1-9
21+
22+
run:
23+
steps:
24+
- REPO_PATH="$PWD"
25+
- cd Runner/suites/Multimedia/GSTreamer/Display/Waylandsink_Playback/
26+
- export VIDEO_DURATION VIDEO_PATTERN VIDEO_WIDTH VIDEO_HEIGHT VIDEO_FRAMERATE VIDEO_GST_DEBUG
27+
- ./run.sh --resolution "${VIDEO_WIDTH}x${VIDEO_HEIGHT}" --pattern "${VIDEO_PATTERN}" --duration "${VIDEO_DURATION}" --framerate "${VIDEO_FRAMERATE}" --gst-debug "${VIDEO_GST_DEBUG}" || true
28+
- $REPO_PATH/Runner/utils/send-to-lava.sh Waylandsink_Playback.res || true

0 commit comments

Comments
 (0)