Skip to content

SSTV: decoder unit + TX player elements, bump station-agent to e8859cdb - #123

Merged
peterus merged 6 commits into
mainfrom
feature/sstv-image
Nov 25, 2026
Merged

peterus merged 6 commits into
mainfrom
feature/sstv-image

Conversation

@peterus

@peterus peterus commented Nov 25, 2026

Copy link
Copy Markdown
Member

SSTV feature, image part (station-manager plan docs/superpowers/plans/2026-11-24-sstv.md, Task 15). station-manager side merged in OE5XRX/station-manager#235.

Changes

  • oe5xrx-decoder-run: new sstv) case
    pw-record --raw -P '{ node.dont-fallback=true node.dont-reconnect=true }' --target $node --rate $rate --channels 1 --format s16 - | python3 -I -m station_agent.sstv.rx_unit --port $port --rate $rate.
    Env as written by station_agent/decoders/sstv.py: OE5XRX_SSTV_PORT (= 8200 + slot), OE5XRX_SAMPLE_RATE (8000). The port must be exactly 4 digits, 8200–8299 and equal 8200 + <instance slot>. Clean pipeline end → exit 1 (same as aprs, so Restart=on-failure fires). The pw-record part is now a shared record() function; KISS-port + runtime-dir validation moved into the aprs) case (sstv needs neither). -I (isolated mode) is a small hardening on top of the plan's python3 -m.
  • oe5xrx-decoder recipe: RDEPENDS python3-numpy + station-agent (the rx_unit module ships in the agent package).
  • oe5xrx-audio-system: the agent's SSTV TX player (sstv_tx.build_play_argv: filesrc ! rawaudioparse ! audioconvert ! audioresample ! volume ! pipewiresink) needs rawaudioparse, which no installed package provided → pin gstreamer1.0-plugins-base-rawparse. Also pin -audioconvert, -audioresample, -volume as split packages (they relied on the empty -base package's -meta RRECOMMENDS until now). Checked against oe-core @ lock (gstreamer1.0-plugins-base_1.28.2: rawparse is built by default, split names via gstreamer1.0-plugins-packaging.inc). l3-audio-rdepends-lint.sh updated.
  • QEMU gate (tests/audio/audio_selfcheck.sh): gst-inspect also rawaudioparse + volume; new step imports numpy + station_agent.sstv.rx_unit as user oe5xrx-decoder via systemd-run with MemoryDenyWriteExecute=yes, MemoryMax=96M, NoNewPrivileges, ProtectSystem=strict (plan step 2–4 check, run by the PR's Hetzner build + QEMU job).
  • Static tests (test_decoder_static.py): sstv argv, pw-record no-fallback, port validation (range, slot mismatch, leading zero, whitespace/newline, injection), failure propagation, KISS port ignored for sstv, RDEPENDS, element→package mapping, lint + selfcheck coverage, agent SRCREV pinned.
  • station-agent SRCREV → e8859cdb0f22be2f564a0d09bd116df19f3aba62 (via scripts/pin-station-agent.sh).

Sandbox: unchanged, why

  • MemoryDenyWriteExecute=yes: numpy has no JIT and does not create W+X mappings on import or in the decoder path (no ctypes callbacks). The new QEMU step runs the import under exactly this setting.
  • MemoryMax=96M / CPUQuota=50%: python3 + numpy is ~35–40 MB RSS; the decoder streams rows at 8 kHz mono. Plan Task 17 measures real CPU/RSS on .211 and raises limits only for the sstv instance if needed.
  • IPAddressAllow=localhost: rx_unit binds 127.0.0.1:820N itself.

Notes

  • oe-core ships numpy 2.4.3; station-manager's dev pin is >=2.5.5. The decoder only uses long-stable APIs (convolve, interp, cumsum, median, hamming, sinc, …), so no blocker.
  • No local bitbake; the real x64 build + QEMU boot is this PR's CI.

🤖 Generated with Claude Code

…nt to e8859cdb

- oe5xrx-decoder-run: `sstv)` case — pw-record --raw (no fallback/reconnect)
  | python3 -I -m station_agent.sstv.rx_unit --port --rate. OE5XRX_SSTV_PORT
  must be 4 digits, 8200–8299 and equal 8200 + instance slot. KISS port and
  runtime dir validation moved into the aprs case.
- oe5xrx-decoder: RDEPENDS python3-numpy + station-agent (rx_unit module).
- oe5xrx-audio-system: pin gstreamer1.0-plugins-base-{rawparse,audioconvert,
  audioresample,volume} for the agent's SSTV TX player (rawaudioparse was
  missing; the others relied on the -meta RRECOMMENDS). Lint updated.
- audio_selfcheck (QEMU): gst-inspect rawaudioparse/volume; import numpy +
  station_agent.sstv.rx_unit as oe5xrx-decoder under the unit's W^X/MemoryMax.
- station-agent SRCREV -> e8859cdb (station-manager #235, SSTV).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@peterus peterus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-loop round 1 (bugs+tests, security+performance). A1 green: pytest -m unit 224 passed, shellcheck clean, l3-audio-rdepends-lint.sh OK. Image ↔ agent contract checked against station-manager @ e8859cd (decoders/sstv.py env, sstv/rx_unit.py argv/exit codes/bind 127.0.0.1, sstv_tx.build_play_argv elements, pyproject.toml lists station_agent.sstv) and the oe-core package names: all consistent. 4 low-severity findings below.

Comment thread tests/audio/audio_selfcheck.sh Resolved
Comment thread tests/audio/audio_selfcheck.sh Resolved
- audio_selfcheck 2b: run the real station_agent.sstv.rx_unit (import, bind,
  clean EOF exit) under every sandbox/identity/limit directive parsed from the
  installed oe5xrx-decoder@.service; unit test guards that no sandbox key of the
  unit is left out of the mirror.
- audio_selfcheck header: step list + 'no Python' wording updated.
- decoder unit comments decoder-neutral (aprs/sstv).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@peterus peterus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-loop round 2 (bugs+tests, security+performance): 2 low-severity findings. A1: unit tests 224 passed, shellcheck clean, rdepends lint OK. Cross-checked the wrapper against the agent at e8859cd: decoders/sstv.py env(), sstv/rx_unit.py CLI/exit codes, and sstv_tx.py build_play_argv, plus the station_agent.sstv package list in pyproject and the oe-core python3 manifest. No mismatches.

Comment thread tests/audio/audio_selfcheck.sh Resolved
- audio_selfcheck 2b: rx_unit probe binds 8299 (slot 99) instead of the live
  sstv-slot1 port 8201.
- decoder unit: SyslogLevel comment states that all rx_unit stderr logging
  (INFO per picture + errors) is kept, bounded by the rate limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@peterus peterus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-loop round 3 (bugs+tests, security+performance): 2 low findings. A1 green: 224 unit tests pass, shellcheck clean, l3 lint OK. Wrapper/unit checked against station_agent @ e8859cd (sstv.py env(), rx_unit argv/exit codes, sstv_tx build_play_argv); split package names checked against OE-core gst-plugins-base 1.28.2 (rawparse not disabled).

- sstv pw-record failure test uses exit 3 and asserts the code propagates
  (pw_exit=1 was indistinguishable from the clean-end fallback).
- oe5xrx-audio-system comment maps audioconvert/audioresample/volume to their
  split packages; drop the stale 'four sub-plugins' count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@peterus peterus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-loop round 4 (bugs+tests, security+performance): 2 low-severity findings. Unit tests (224 passed), shellcheck, l3-audio-rdepends-lint green; image side cross-checked against station-manager e8859cd (sstv.py env(), rx_unit argv/bind/exit codes, sstv_tx build_play_argv) and oe-core gst-plugins-base 1.28.2 split packages.

- wrapper: document that the sstv decoder always runs the pinned
  station_agent (also on the dev image, where the agent runs from /mnt/dev).
- tests: drop dead rundir setup in _run_sstv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@peterus peterus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review-loop round 5 (bugs+tests, security+performance): 1 low-severity finding. Checked: unit tests (224 passed), shellcheck, l3 RDEPENDS lint, wrapper ↔ agent env contract (decoders/sstv.py env(), rx_unit exit codes/bind, sstv_tx build_play_argv ↔ pinned split packages), self-check sandbox mirroring, rx_unit CPU headroom under CPUQuota=50% (decoder benchmark: ≤0.7% of one x86 core in real time for robot36/martin1/pd180).

Comment thread tests/audio/audio_selfcheck.sh Resolved
- audio_selfcheck: audioconvert/audioresample comment names the pinned split
  packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@peterus
peterus merged commit 856a206 into main Nov 25, 2026
13 checks passed
@peterus
peterus deleted the feature/sstv-image branch November 25, 2026 21:26
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