Commit Graph

963 Commits

Author SHA1 Message Date
sjg 2c2a0951a5 [docs](trx-rs): update README config file docs
Document the combined trx-rs.toml search order and clarify\nthe HTTP auth example for combined vs legacy config files.\n\nCo-authored-by: Codex <codex@openai.com>

Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 08:39:55 +01:00
sjg 7a4c2d52b1 [chore](trx-rs): drop legacy ~/.trx-{server,client}.toml search paths
Remove the home-directory dotfile paths that predate the XDG layout.
Search order is now: CWD → ~/.config/trx-rs/ → /etc/trx-rs/, checked
for both the combined trx-rs.toml and the per-binary flat file at each
tier.

Update doc comments and tests accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 08:31:21 +01:00
sjg 5d43578e03 [chore](trx-rs): replace per-binary example configs with trx-rs.toml.example
Remove trx-server.toml.example and trx-client.toml.example in favour of
a single trx-rs.toml.example using [trx-server] and [trx-client] section
headers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 08:18:09 +01:00
sjg d8f030667f [chore](trx-rs): remove unused example_toml() methods
Superseded by example_combined_toml() which now covers all use cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 08:13:00 +01:00
sjg 06312abe42 [feat](trx-app): support combined trx-rs.toml config file
Both trx-server and trx-client now look for a combined trx-rs.toml
with [trx-server] and [trx-client] section headers respectively,
falling back to per-binary config files as before.

Search order per tier: combined trx-rs.toml → flat per-binary file,
checked in CWD, ~/.config/trx-rs/, and /etc/trx-rs/.

--print-config now outputs the config under the appropriate section
header so the combined file can be generated directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 08:08:45 +01:00
sjg 6a47fb00ad [fix](trx-frontend-http,trx-backend-soapysdr): fix audio rate and stereo copy
JS: fix stereo AudioData channel copy — frame.copyTo with planeIndex:0
only fills the left plane; reading it as interleaved data caused every
other sample to be zero, making WFM stereo play at half speed.  Now
calls copyTo per channel with the correct planeIndex.

Rust WFM: replace integer output_decim/output_counter in WfmStereoDecoder
with a fractional phase accumulator (output_phase_inc = audio_rate /
composite_rate).  Integer division caused the effective output rate to
drift from audio_sample_rate when the SDR rate is not an exact multiple
(e.g. 2 MHz SDR → 250 kHz composite → ~50 kHz output instead of 48 kHz,
making audio play 4% slow).

Rust non-WFM: add resample_phase/resample_phase_inc to ChannelDsp and
use a fractional-phase resampler in process_block for non-WFM paths,
ensuring exactly audio_sample_rate samples/sec regardless of SDR rate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 07:57:42 +01:00
sjg 7fa4f5d133 [fix](trx-frontend-http): fix jog multiplier reset and rename unit label
Fix updateJogStepSupport to snap jogUnit (not jogStep) to nearest
supported unit, then recompute jogStep = jogUnit * jogMult so the
multiplier is preserved across rig connect/reconnect.

Rename "Mult" label to "Unit Multiplier" for clarity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 02:37:16 +01:00
sjg 4f8658b773 [fix](trx-frontend-http): fix waterfall freeze, RDS bandwidth, add jog multiplier
Fix waterfall overview freezing at steady state by tracking a monotonic
push counter instead of row array length — the array size stays constant
once the waterfall is full, so the previous row-count comparison never
triggered the incremental draw path.

Fix WFM RDS not decoding when switching to WFM from a narrowband mode:
set_mode now resets audio_bandwidth_hz to the mode-appropriate default
(180 kHz for WFM) before rebuilding the FIR, preventing the 57 kHz RDS
subcarrier from being filtered out.

Add 1×/10×/100× multiplier button group next to the jog unit selector.
jogUnit × jogMult gives the effective jog step; both are persisted to
localStorage independently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 02:25:39 +01:00
sjg eb3b45da64 [perf](trx-frontend-http): reduce spectrum rate to 5 Hz and cache waterfall offscreen
Lower SPECTRUM_POLL_INTERVAL and SSE tick from 100 ms to 200 ms to halve
the number of spectrum frames pushed to the browser.

Introduce an OffscreenCanvas cache for the overview waterfall: at steady
state only the new row is painted and the existing image is scrolled up,
reducing per-frame work from O(rows × cols) to O(cols).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 02:13:00 +01:00
sjg f65135cb5e [feat](trx-frontend-http): display RDS PS name overlay on overview strip
When a WFM/SDR spectrum stream carries RDS data, show the Program
Service name (8-char station name) centered on the visible waveform
area in DSEG14 monospace — the same font as the frequency display.

- Add #rds-ps-overlay div inside .overview-strip (pointer-events: none,
  z-index: 2, absolutely positioned at the center of the visible canvas)
- updateRdsPsOverlay(rds) shows/hides and updates text on every spectrum
  frame; trims trailing spaces common in RDS PS strings
- Overlay cleared on spectrum disconnect / null frame
- text-shadow uses CSS color-mix against --bg for legibility across all
  style/theme combinations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 02:04:51 +01:00
sjg ff885dd5fd [fix](trx-frontend-http): match center frequency input color to wavelength
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:57:46 +01:00
sjg 51c1d6b912 [fix](trx-frontend-http): style theme toggle button as the opposite theme
When in dark mode the button has a light appearance; when in light mode
it has a dark appearance. This makes the button a preview of what
clicking will switch to, rather than mirroring the current theme.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:55:21 +01:00
sjg 4930e5cc45 [fix](trx-frontend-http): fix TDZ on lastSpectrumData at style init
Same root cause as the overviewDrawPending TDZ: setStyle() references
lastSpectrumData at module init time but it was declared far below.
Hoist let lastSpectrumData = null to the top variable block and remove
the now-duplicate declaration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:53:08 +01:00
sjg 4f650f5ffb [fix](trx-frontend-http): fix TDZ on overviewDrawPending at style init
setStyle() was called at module init time (to restore the saved style
from localStorage) before the let overviewDrawPending declaration, which
caused a ReferenceError: Cannot access 'overviewDrawPending' before
initialization.

Fix: hoist let overviewDrawPending = false to the top of the variable
declarations block, before any top-level code that may call
scheduleOverviewDraw(). Remove the now-duplicate declaration from its
original location.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:51:43 +01:00
sjg 7520796869 [feat](trx-frontend-http): add style picker with Nord, Monokai, Contrast themes
Add a style picker dropdown to the tab bar (right of rig picker) with
four styles — Original, Nord, Monokai, Contrast — each with full
light/dark variants.

CSS: define data-style attribute overrides for all CSS custom properties
(bg, card-bg, borders, text, accents, jog, audio level, filter, spectrum
background) for each of the three new styles × two themes (6 new blocks).

JS: introduce CANVAS_PALETTE lookup table covering spectrum/waveform/
waterfall colors for all style×theme combinations. Add currentStyle(),
canvasPalette(), setStyle() helpers. Persist selection to localStorage.

Replace all isLight ternaries in drawing code with palette lookups:
- drawOverviewWaterfall, drawOverviewSignalHistory, waterfallColor
  signatures changed from isLight flag to pal object
- drawSpectrum uses canvasPalette() for grid lines, labels, fill, line
- spectrumBgColor() now delegates to canvasPalette().bg

Theme toggle also triggers a spectrum redraw so canvas colors update
immediately when switching light/dark.

Also fix light-theme spectrum rendering broken since canvas drawing used
hardcoded dark-only colors (white grid lines invisible on light bg).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:48:45 +01:00
sjg 094d11835c Merge pull request #3 from sgrams/feat/mobile-ux
[feat](trx-frontend-http): improve mobile UX and fix S0/S9 label offset
2026-02-28 01:37:45 +01:00
sjg 4e9516871f [feat](trx-frontend-http): improve mobile UX and fix S0/S9 label offset
- Add viewport meta tag so mobile browsers use device width instead of
  the default 980px desktop viewport
- Add 520px breakpoint: remove controls-tray forced min-width (was
  52–58rem, causing horizontal scroll on phones), stack controls-row
  into a single column with jog wheel first (order: -1)
- Scale frequency DSEG14 display with clamp() on narrow screens
- Make volume sliders responsive width with larger 20px thumb
- Raise spectrum Set/Auto button and input heights to 2.2rem (overrides
  the min-height: 0 that blocked the existing 760px touch-size rule)
- Add overflow-x: auto + flex-shrink: 0 to sub-tab-bar so all six
  plugin tabs are reachable on small screens without clipping
- Swap spectrum hint text based on input device: mouse/keyboard hint
  hidden on touch devices, touch-specific hint shown instead
- Offset S0/S9/S9+ signal history labels 6px below their grid lines

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:37:04 +01:00
sjg 449663ddd7 [feat](trx-frontend-http): refine decoder and SDR displays
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:22:30 +01:00
sjg b67fdeef8c [feat](trx-frontend-http): offset header blur panel
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:18:56 +01:00
sjg 01485f3cd4 [fix](trx-frontend-http): rename browser title
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:09:42 +01:00
sjg 7258ea57b2 [fix](trx-frontend-http): restore tabs and relocate peak hold
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:08:56 +01:00
sjg 7d9a00cc4e [fix](trx-frontend-http): move overview scales to the right
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:03:42 +01:00
sjg 4e79820e14 [feat](trx-frontend-http): refine header controls and overlays
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 01:02:51 +01:00
sjg 4c4d14b705 [feat](trx-rs): refine overview strip and logging
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:57:15 +01:00
sjg 8d4a729d7c [fix](trx-frontend-http): keep control tray within width
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:52:12 +01:00
sjg cd045d353c [feat](trx-rs): tighten spectrum refresh and header layout
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:49:55 +01:00
sjg eb920ce138 [fix](trx-frontend-http): clean spectrum stream warning
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:44:56 +01:00
sjg c703a5bafd [perf](trx-rs): optimize spectrum streaming and header overlay
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:43:32 +01:00
sjg adc17507ce [feat](trx-frontend-http): refine top bar and overview controls
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:37:37 +01:00
sjg b5cac4be41 [feat](trx-frontend-http): wrap and layer main controls
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:34:50 +01:00
sjg b976465e37 [feat](trx-frontend-http): align overview strip with spectrum view
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:31:22 +01:00
sjg cf7b2cb3a5 [fix](trx-frontend-http): restore overview startup order
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:25:13 +01:00
sjg 54c6320f73 [fix](trx-frontend-http): show auth gate before startup checks
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:22:12 +01:00
sjg e422dc0b89 [fix](trx-frontend-http): restore auth-gated startup
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:18:37 +01:00
sjg 258258920d [refactor](trx-frontend-http): align logo header naming
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:14:34 +01:00
sjg d9b73479c7 [fix](trx-frontend-http): remove boxed shell and fix auth gate
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:11:20 +01:00
sjg 2154279d78 [feat](trx-frontend-http): restructure top frontend bars
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:08:34 +01:00
sjg c010073e0c [feat](trx-frontend-http): replace header graph with adaptive strip
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-28 00:04:17 +01:00
sjg fffc4c6b90 [feat](trx-rs): add WFM RDS and playback controls
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:57:46 +01:00
sjg f77d0b0bb1 [perf](trx-frontend-http): smooth SDR spectrum rendering
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:43:48 +01:00
sjg e212283d3c [feat](trx-frontend-http): refine SDR bandwidth control
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:42:51 +01:00
sjg e392e7ffa5 [feat](trx-backend-soapysdr): decode WFM stereo in SDR pipeline
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:40:25 +01:00
sjg 8827b2fa21 [feat](trx-frontend-http): add editable SDR bandwidth control
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:34:51 +01:00
sjg b8c154af60 [feat](trx-frontend-http): add WFM mono and stereo playback switch
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:32:09 +01:00
sjg 14cefd1198 [fix](trx-frontend-http): raise WFM bandwidth cap to 300 kHz
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:30:05 +01:00
sjg c5f1c5308b [fix](trx-server): duplicate mono SDR frames for stereo opus
Signed-off-by: Stan Grams <sjg@haxx.space>
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:29:23 +01:00
sjg dee165008d [fix](trx-frontend-http): hide transmit power controls on RX-only rigs
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-27 23:21:08 +01:00
sjg 7f222eaf10 [chore](trx-rs): refine pending SDR frontend and backend changes
Signed-off-by: Stan Grams <sjg@haxx.space>
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-02-27 23:09:21 +01:00
sjg 071157e5bf [feat](trx-frontend-http): tune SDR spectrum with ctrl-scroll
Signed-off-by: Stan Grams <sjg@haxx.space>
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-02-27 23:05:20 +01:00
sjg bc206e8f6b [fix](trx-frontend-http): hide TX audio controls on RX-only rigs
Signed-off-by: Stan Grams <sjg@haxx.space>
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-02-27 23:03:46 +01:00