Skip to content

feat: add native tinySA spectrum analyzer backend - #6

Closed
AlCalzone wants to merge 7 commits into
musithang:mainfrom
AlCalzone:alcalzone-tinysa-backend
Closed

feat: add native tinySA spectrum analyzer backend#6
AlCalzone wants to merge 7 commits into
musithang:mainfrom
AlCalzone:alcalzone-tinysa-backend

Conversation

@AlCalzone

Copy link
Copy Markdown
Contributor

Summary

  • Add a native tinySA backend that publishes calibrated dBm traces directly. It never synthesizes IQ or calls process_block.
  • Support the spectrum, waterfall, marker, band-plan and wide-sweep surfaces. Layouts that require IQ samples, ADC data, demodulation, RF-chain modelling or stream timing are hidden.
  • Add USB CDC discovery, explicit serial paths and model handling for basic tinySA, ZS405, ZS406 and ZS407 devices.
  • Add device options for point count, RBW, attenuation, LNA, LNA2, AGC, spur handling and external-gain correction.

Protocol

A dedicated worker owns the serial port. Startup aborts stale scans, verifies version and info, queries the configured zero level and forces analyzer input mode. Acquisition uses counted scanraw START STOP POINTS 1 frames with signed little-endian levels. Scan deadlines follow span, RBW, point count and spur settings. Basic and Ultra devices switch RF input paths at their model-specific boundaries.

Hardware verification

The backend was tested on a tinySA Ultra ZS405 running tinySA4_v1.4-236-ge5aa115. The live checks covered discovery, normal and Ultra RF paths, spectrum frames, native wide sweeps, cancellation, point changes and LNA/attenuation coupling. The device was disconnected before the final upstream-main rebase, so the rebased integration was validated through the automated checks below.

Validation

  • 1,294 library-free tests pass.
  • 1,304 tests pass with both native backend cfgs enabled.
  • Clippy passes with warnings denied, apart from the existing collapsible_match allowance.
  • Rust 1.88 cargo check --all-targets passes.
  • cargo package --locked passes.

This implements the frame-based backend discussed in #5.

AlCalzone and others added 6 commits September 7, 2026 09:06
Add calibrated power-trace acquisition, tinySA serial protocol support, device options, spectrum-only layouts, and optional native SDR build dependencies.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve the hardware discovery and gain-model refactor, preserve valid layout fallbacks, and make direct sweep setup recoverable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve NET feeds, use RateSet for span changes, and keep power-sweep layout and recovery behavior on current upstream main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Track explicit cursor jumps and select a surviving trace layout when leaving direct-power sweeps.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Force analyzer input mode, abort stale continuous scans before probing, and scale scan deadlines with RBW and span.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Applying new sweep settings no longer changes the user's RX state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AlCalzone
AlCalzone marked this pull request as draft September 7, 2026 08:56
@AlCalzone

Copy link
Copy Markdown
Contributor Author

Converting to draft, until I'm happy with it.

Defer device options, native wide sweeps, and optional native-library builds to focused follow-up changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AlCalzone

Copy link
Copy Markdown
Contributor Author

Superseded by a focused PR stack starting with #7. The concrete tinySA backend and follow-up features will be submitted as dependent draft PRs.

@AlCalzone AlCalzone closed this Sep 7, 2026
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