You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add: implement interlace auto-detection for ST40P RX and update documentation
add ST40/ST40p API flag and frame_info field_num/interlaced propagation
wire gst st40p rx auto-detect property and warn when cadence is unknown
add validation harness + tests for auto-detect; document usage and signals
Copy file name to clipboardExpand all lines: doc/st40_validation_updates.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ This note captures all recent ST40/ST40p feature changes and the accompanying va
9
9
-**Frame-info log surfacing:** When tests pass `log_frame_info=True`, the harness dumps the frame-info file and a summary directly into the test log (no artifact download needed).
10
10
-**ST40P test mutation knobs:** The GStreamer TX plugin accepts `tx-test-mode` with helpers for `no-marker`, `seq-gap`, `bad-parity`, and `paced` (optionally with `tx-test-pkt-count` and `tx-test-pacing-ns`). These drive targeted negative/edge-path tests.
11
11
-**Interlaced & split-mode coverage:** RX/TX can be flagged interlaced independently; mismatch fails fast. Split-mode plus marker handling is now covered in tests.
12
+
-**Interlace auto-detect option:** RX can infer progressive vs interlaced cadence from RTP F bits (`rx-auto-detect-interlaced=true` in GStreamer, `ST40P_RX_FLAG_AUTO_DETECT_INTERLACED` in C API). Use when cadence is unknown; RX updates `interlaced` after first field detection while still logging field_num/interlaced in frame-info.
13
+
-**Warnings when cadence is unknown:** Pipeline RX and the GStreamer RX plugin emit a warning if neither `rx-interlaced` nor auto-detect is set, to avoid silent progressive defaults.
12
14
-**Integration safety nets:** New noctx integration tests for ST40 interlaced flows, and expanded GStreamer validation tests across single-host and dual-host (VF/VF) paths.
13
15
14
16
## Data path (split ANC per RTP)
@@ -44,6 +46,14 @@ flowchart LR
44
46
-**Negative-path observability:** In interlaced mode, a missing marker or sequence gap can occur on just one field. Frame-info shows the gap on that field only, which is why `test_st40i_split_mode_frame_info_logging` and the noctx `st40i_split_seq_gap_reports_loss` exist—to prove per-field accounting is accurate.
45
47
-**Naming clarity:** The `p` in `st40p` refers to the pipeline API, not progressive-only transport. Interlaced support is a first-class, opt-in property (`tx-interlaced` / `rx-interlaced`) and is exercised in both GStreamer and C integration suites.
46
48
49
+
## Interlace auto-detect: usage and expected signals
50
+
51
+
- Enable on RX when cadence is unknown: `rx-auto-detect-interlaced=true` in the GStreamer RX pipeline or set `ST40P_RX_FLAG_AUTO_DETECT_INTERLACED` in `st40p_rx_ops.flags` (C API). Keep `rx-interlaced=false` when auto-detecting.
52
+
- TX still needs to emit F bits (set `tx_interlaced=true` in GStreamer or `interlaced=true` in TX ops) so RX can learn cadence.
53
+
- Warnings: RX logs a warning if both `rx-interlaced=false` and auto-detect are disabled. Expect a GST_WARNING from `mtl_st40p_rx` and a pipeline warning from `st40p` if cadence is unknown.
54
+
- Frame-info fields: `field_num` and `interlaced` are populated once F bits are observed (`0x2/0x3` for interlaced fields, `0x0` for progressive). These are visible in both C API frame_info and GStreamer frame-info dumps.
55
+
- Expect detection log line when auto-detect flips interlaced on RX (`detected interlaced stream (F=0x2/0x3)`); downstream tests assert on these fields rather than relying on caps only.
56
+
47
57
## API and plugin changes (developer-facing)
48
58
49
59
-**TX (GStreamer st40p):**
@@ -95,6 +105,8 @@ Across all single-host tests, frame-info is dumped and summarized in pytest logs
95
105
-`st40i_split_multi_packet_roundtrip` — sends multiple ANC blocks per field (sizes 8/6/4) in split mode; expects RX accumulation and nonzero frames.
96
106
-`st40i_split_loopback` — interlaced split-mode loopback with custom fps and framebuff; ensures split/interlace coexist.
97
107
-`st40i_split_seq_gap_reports_loss` — crafts a manual RTP sequence gap and validates `seq_discont`/`seq_lost` are reported via the C API frame_info, mirroring the GStreamer gap test at a lower level.
-`st40p_rx_auto_detect_interlace` — TX flags interlaced, RX starts progressive with `ST40P_RX_FLAG_AUTO_DETECT_INTERLACED`; asserts `interlaced`/`field_num` populate on RX frame_info.
98
110
99
111
These integration tests exercise the C pipeline APIs directly (outside the GStreamer harness) to prove split-mode, parity, marker, and sequence reporting work end-to-end without additional context setup.
100
112
@@ -107,7 +119,8 @@ These integration tests exercise the C pipeline APIs directly (outside the GStre
4. Inspect log: look for `FrameInfo` lines followed by `FrameInfoSummary` to confirm packet counts and seq accounting.
122
+
4. If cadence is unknown on RX, set `rx-auto-detect-interlaced=true` (GStreamer) or `ST40P_RX_FLAG_AUTO_DETECT_INTERLACED` (C API); leave `rx-interlaced=false` so detection can flip it. Expect a warning if you omit both.
123
+
5. Inspect log: look for `FrameInfo` lines followed by `FrameInfoSummary` to confirm packet counts and seq accounting.
111
124
112
125
## Signals to watch
113
126
@@ -119,7 +132,7 @@ These integration tests exercise the C pipeline APIs directly (outside the GStre
119
132
120
133
- For split-mode validation, set RX `frame_info_path` (for logging) and a power-of-two `rx_rtp_ring_size`; the plugin rejects non power-of-two values.
121
134
- Frame-info summaries rely on the regular expression in the harness; unexpected formats will fall back to raw dump only.
122
-
- Interlaced mismatch between TX/RX fails the test early (before file compare).
135
+
- Interlaced mismatch between TX/RX fails the test early unless RX uses auto-detect; a warning is emitted when neither interlaced nor auto-detect is set.
Copy file name to clipboardExpand all lines: doc/validation_framework.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,7 @@ The `tests/` directory contains test implementations organized by scenario type:
125
125
- Split-mode packetized ANC with frame-info logging (sequence discontinuity, packet totals, RTP marker) and ring-size validation
126
126
- Pacing sanity via RTP sender helpers and ramdisk-backed media fixtures (configure `ramdisk.media` in `configs/test_config.yaml`)
127
127
- Redundant ST40p/ST40i GStreamer ANC cases with per-port seq-gap scheduling (real payloads, lifted packet caps) and frame-info checks for seq discontinuity/loss logging
128
+
- Interlace auto-detect on RX (`rx-auto-detect-interlaced` / `ST40P_RX_FLAG_AUTO_DETECT_INTERLACED`) with warnings if neither interlaced nor auto-detect is set; frame-info now includes `field_num` and `interlaced` for detected cadence
Copy file name to clipboardExpand all lines: ecosystem/gstreamer_plugin/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -492,6 +492,7 @@ The `mtl_st40p_rx` plugin supports all pad capabilities (the data is not checked
492
492
| timeout | uint | Timeout in seconds for blocking frame retrieval | 0 to 300 | 60 |
493
493
| frame-info-path | string | Optional path to append frame info and sequence stats per frame | N/A | NULL |
494
494
| rx-interlaced | boolean | Whether the incoming ancillary stream is interlaced | TRUE/FALSE | FALSE |
495
+
| rx-auto-detect-interlaced | boolean | Enable RTP F-bit based interlace detection when cadence is unknown; leaves `rx-interlaced` optional and will warn if both are false. | TRUE/FALSE | FALSE |
495
496
| output-format | enum | Serialization format for received ancillary data |`raw-udw` / `rfc8331`|`raw-udw`|
496
497
497
498
When `output-format` is set to `rfc8331`, each ancillary packet is serialized with an 8-byte
@@ -502,6 +503,7 @@ its user data words so that downstream elements receive complete RFC8331 payload
502
503
>**Note:**`rtp-ring-size` values are validated at runtime. If the supplied number is not a power of
503
504
> two the element fails to initialize, matching the behavior enforced inside
504
505
>`gst_mtl_st40p_rx_start()`.
506
+
>**Interlace auto-detect:** When cadence is unknown, set`rx-auto-detect-interlaced=true` and leave `rx-interlaced=false`. The plugin warns if both are false. Frame-info includes `field_num` and `interlaced` once F bits are observed.
505
507
506
508
#### 5.2.2. Example GStreamer Pipeline for Reception
0 commit comments