From 9942ee611a5e57a24de6dbaade861dce20794cd5 Mon Sep 17 00:00:00 2001 From: Jan Svabenik Date: Wed, 18 Mar 2026 07:52:31 +0100 Subject: [PATCH] Add decoder tool stubs and refresh README --- README.md | 53 ++++++++++++++++------------------- tools/README.md | 18 ++++++++++++ tools/dmr/dmr_decoder.bat | 5 ++++ tools/dstar/dstar_decoder.bat | 5 ++++ tools/fsk/fsk_decoder.bat | 5 ++++ tools/ft8/ft8_decoder.bat | 5 ++++ tools/psk/psk_decoder.bat | 5 ++++ tools/wspr/wspr_decoder.bat | 5 ++++ 8 files changed, 72 insertions(+), 29 deletions(-) create mode 100644 tools/README.md create mode 100644 tools/dmr/dmr_decoder.bat create mode 100644 tools/dstar/dstar_decoder.bat create mode 100644 tools/fsk/fsk_decoder.bat create mode 100644 tools/ft8/ft8_decoder.bat create mode 100644 tools/psk/psk_decoder.bat create mode 100644 tools/wspr/wspr_decoder.bat diff --git a/README.md b/README.md index b0b7a4f..e78fa73 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,16 @@ # SDR Visual Suite -Go-based SDRplay RSP1b live spectrum + waterfall visualizer with a minimal event recorder. +Go-based SDRplay RSP1b live spectrum + waterfall visualizer with an event recorder, classifier, and demod/recording pipeline. ## Features - Live spectrum + waterfall web UI (WebSocket streaming) - Event timeline view (time vs frequency) with detail drawer -- In-browser spectrogram slice for selected events -- Basic detector with event JSONL output (`data/events.jsonl`) -- Events API (`/api/events?limit=...&since=...`) +- Event JSONL output (`data/events.jsonl`) - Runtime UI controls for center frequency, span, sample rate, tuner bandwidth, FFT size, gain, AGC, DC block, IQ balance, detector threshold -- Display controls: averaging + max-hold - Optional GPU FFT (cuFFT) with toggle + `/api/gpu` -- Recorded clips list placeholder (metadata only for now) -- Windows + Linux support +- IQ/audio recording + recordings list +- Live demod endpoint +- WFM stereo + RDS baseband - Mock mode for testing without hardware ## Quick Start (Mock) @@ -71,31 +69,31 @@ Edit `config.yaml`: - `recorder.*`: enable IQ/audio recording, preroll, output_dir - `decoder.*`: external decode commands (use `{iq}` and `{sr}` placeholders) -## Web UI -The UI is served from `web/` and connects to `/ws` for spectrum frames. - -### Controls Panel -Use the right-side controls to adjust center frequency, span (zoom), sample rate, tuner bandwidth, FFT size, gain, AGC, DC block, IQ balance, and detector threshold. Preset buttons provide quick jumps to 40m/20m/17m. - -### Event Timeline -- The timeline panel displays recent events (time vs frequency). -- Click any event block to open the detail drawer with event stats and a mini spectrogram slice from the latest frame. - +## APIs ### Config API -- `GET /api/config`: returns the current runtime configuration. -- `POST /api/config`: updates `center_hz`, `sample_rate`, `fft_size`, `gain_db`, `tuner_bw_khz`, `use_gpu_fft`, and `detector.threshold_db` at runtime. -- `POST /api/sdr/settings`: updates `agc`, `dc_block`, and `iq_balance` at runtime. -- `GET /api/gpu`: reports GPU FFT availability/active status. +- `GET /api/config` +- `POST /api/config` +- `POST /api/sdr/settings` +- `GET /api/gpu` ### Events API -`/api/events` reads from the JSONL event log and returns the most recent events: +`/api/events` reads from the JSONL event log: - `limit` (optional): max number of events (default 200, max 2000) - `since` (optional): Unix milliseconds or RFC3339 timestamp -Example: -```bash -curl "http://localhost:8080/api/events?limit=100&since=1700000000000" -``` +### Recordings API +- `GET /api/recordings` +- `GET /api/recordings/:id` (meta.json) +- `GET /api/recordings/:id/iq` +- `GET /api/recordings/:id/audio` +- `GET /api/recordings/:id/decode?mode=FT8|WSPR|DMR|D-STAR|FSK|PSK` + +### Live Demod API +- `GET /api/demod?freq=...&bw=...&mode=...&sec=...` → audio/wav + +## Decoder Tools +Put external decoder binaries/scripts under `tools/` and configure `decoder.*` in `config.yaml`. +See `tools/README.md` for examples. ## Tests ```bash @@ -107,6 +105,3 @@ go test ./... - If you see `sdrplay support not built`, rebuild with `-tags sdrplay`. - If the SDRplay library is not found, ensure `CGO_CFLAGS` and `CGO_LDFLAGS` point to the API headers and library. - Use `--mock` to run without hardware. -lay`. -- If the SDRplay library is not found, ensure `CGO_CFLAGS` and `CGO_LDFLAGS` point to the API headers and library. -- Use `--mock` to run without hardware. diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000..d9c920f --- /dev/null +++ b/tools/README.md @@ -0,0 +1,18 @@ +# Decoder Tools + +Place external decoder binaries here and update `config.yaml` decoder commands. + +Examples (Windows): +- `tools/ft8/ft8_decoder.bat` +- `tools/wspr/wspr_decoder.bat` +- `tools/dmr/dmr_decoder.bat` +- `tools/dstar/dstar_decoder.bat` +- `tools/fsk/fsk_decoder.bat` +- `tools/psk/psk_decoder.bat` + +Each script should accept: +``` +--iq --sample-rate +``` + +The app replaces `{iq}` and `{sr}` placeholders in config commands. diff --git a/tools/dmr/dmr_decoder.bat b/tools/dmr/dmr_decoder.bat new file mode 100644 index 0000000..160693a --- /dev/null +++ b/tools/dmr/dmr_decoder.bat @@ -0,0 +1,5 @@ +@echo off +REM Placeholder decoder. Replace with real DMR decoder binary. +REM Usage: dmr_decoder --iq --sample-rate +echo DMR decoder placeholder. IQ=%2 SR=%4 +exit /b 0 diff --git a/tools/dstar/dstar_decoder.bat b/tools/dstar/dstar_decoder.bat new file mode 100644 index 0000000..df24744 --- /dev/null +++ b/tools/dstar/dstar_decoder.bat @@ -0,0 +1,5 @@ +@echo off +REM Placeholder decoder. Replace with real D-STAR decoder binary. +REM Usage: dstar_decoder --iq --sample-rate +echo D-STAR decoder placeholder. IQ=%2 SR=%4 +exit /b 0 diff --git a/tools/fsk/fsk_decoder.bat b/tools/fsk/fsk_decoder.bat new file mode 100644 index 0000000..f889432 --- /dev/null +++ b/tools/fsk/fsk_decoder.bat @@ -0,0 +1,5 @@ +@echo off +REM Placeholder decoder. Replace with real FSK decoder binary. +REM Usage: fsk_decoder --iq --sample-rate +echo FSK decoder placeholder. IQ=%2 SR=%4 +exit /b 0 diff --git a/tools/ft8/ft8_decoder.bat b/tools/ft8/ft8_decoder.bat new file mode 100644 index 0000000..84d7c1c --- /dev/null +++ b/tools/ft8/ft8_decoder.bat @@ -0,0 +1,5 @@ +@echo off +REM Placeholder decoder. Replace with real FT8 decoder binary. +REM Usage: ft8_decoder --iq --sample-rate +echo FT8 decoder placeholder. IQ=%2 SR=%4 +exit /b 0 diff --git a/tools/psk/psk_decoder.bat b/tools/psk/psk_decoder.bat new file mode 100644 index 0000000..af8215d --- /dev/null +++ b/tools/psk/psk_decoder.bat @@ -0,0 +1,5 @@ +@echo off +REM Placeholder decoder. Replace with real PSK decoder binary. +REM Usage: psk_decoder --iq --sample-rate +echo PSK decoder placeholder. IQ=%2 SR=%4 +exit /b 0 diff --git a/tools/wspr/wspr_decoder.bat b/tools/wspr/wspr_decoder.bat new file mode 100644 index 0000000..3a785d6 --- /dev/null +++ b/tools/wspr/wspr_decoder.bat @@ -0,0 +1,5 @@ +@echo off +REM Placeholder decoder. Replace with real WSPR decoder binary. +REM Usage: wspr_decoder --iq --sample-rate +echo WSPR decoder placeholder. IQ=%2 SR=%4 +exit /b 0