Skip to content

feat: add auto-port-reset opt-out - #24

Merged
andrescera merged 5 commits into
mainfrom
todo15/au-alignment-wip
Jul 30, 2026
Merged

feat: add auto-port-reset opt-out#24
andrescera merged 5 commits into
mainfrom
todo15/au-alignment-wip

Conversation

@andrescera

Copy link
Copy Markdown
Member

What

Add the public auto-port-reset boolean property, defaulting to true, with mock coverage for the false path and documentation.

Verification

  • ctest --test-dir build --output-on-failure: 169/169 passed
  • Board candidate SHA: 877fd59ff523e8bf0cf243304a1528506c083383871271c96da5fe9d37e28a87
  • Board health confirmed before and after testing.
  • The observed-usbfs-holder SIGKILL cycles for both TRUE and FALSE self-recovered before the subject opened; neither entered the wedge recovery path, so board behavioral proof is explicitly inconclusive.

Evidence

Board-Evidence-SHA256: 15daa61f1a40f7112b25bc7f37fdc0809973468de33f5c06bb5f5c9258a3be8c is on the documentation commit and identifies the retry record.

Risks

No default behavior change; setting FALSE intentionally skips USB port reset and uses normal disconnect handling.

… access unit

The element advertises `alignment=au` on both pad templates but pushed one
GstBuffer per NAL unit, so any multi-slice picture (common at 2160p) fragmented
across multiple buffers that each claimed to be a whole access unit. Downstream
(`h264parse`, `v4l2slh264dec`/`mppvideodec`, the muxers) trusts that claim to
find frame boundaries.

Fix: `frame_callback()` now partitions each libuvc delivery into access units
via `split_access_units()` and emits exactly one buffer per AU. Boundary
detection, in priority order: an Access Unit Delimiter when present (exact,
no heuristic), else first-slice-of-new-picture detection via a one-bit test
on the slice payload (H.264 `first_mb_in_slice`/H.265
`first_slice_segment_in_pic_flag`), else never split (deliberately biased
toward under-splitting). PTS convention: an aggregated AU carries the
delivery's arrival running-time, identical to what its first slice would have
received under the old per-NAL path. No caps change, no new timing constant.

Board-proven at both resolutions on the Osmo Pocket 3 (192.168.78.131,
2026-07-30 ~08:26-08:43Z): 1080p30 parses cleanly through `h264parse`,
byte-identical to the pre-aggregation path; 2160p30 parses cleanly with full
SPS-derived caps (3840x2160/high/5.2/4:2:0); exact 90-in/90-out buffer count
verified via identity probes on both sides of `h264parse` for a 90-buffer
2160p30 request, confirming the contract holds with zero drift at the
resolution most likely to expose a splitting bug.

Local gate: 103/103 baseline ctest, both new AU-alignment cases red before the
fix (3 buffers / 2 buffers where 1 was expected), 106/106 after (103 + 3 new),
161/161 under `-DENABLE_SANITIZERS=ON` with zero ASan/TSan findings.
`compat_caps_contract` unmodified; `alignment=au` unchanged.

Board-Evidence-SHA256: 4585c999f72a419edd079cf5b10e1af86105d0eee6cfbfbf76b7ab43e8683800
Board-Evidence-SHA256: 15daa61f1a40f7112b25bc7f37fdc0809973468de33f5c06bb5f5c9258a3be8c
@andrescera
andrescera merged commit 1e14b26 into main Jul 30, 2026
5 checks passed
@andrescera
andrescera deleted the todo15/au-alignment-wip branch July 30, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant