|
| 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) |
0 commit comments