New channel Tx plugin modchirpmodem, built on libchirpmodem (format v1),
modelled on modpacket: plugin, settings, baseband, source, GUI, web API
adapter, readme.
- A transmission is the message's frames, separated by a gap, then a CW ID
with the source callsign. It is generated in full on a one-thread
generator pool, never on the DSP thread, and posted back to the baseband;
the source plays it out at the channel rate. A result made for an old
channel rate or offset is generated again; one on air when the rate or
offset changes is cut off and reported.
- Policy is libchirpmodem's: a licensed frame without a source callsign is
refused (EPOLICY) and CW ID above 20 WPM is rejected; no encryption
option. CW ID can be turned off in the licensed profile, with a warning in
the GUI and the report. The unlicensed profile is shown in red.
- Settings: SF, BW, payload mode, profile, src, dst, message, repeat, gap,
amplitude, CW ID and its speed. The GUI shows airtime per frame and the
largest body that fits (chirpmodem_frame_seconds, chirpmodem_max_body).
- Web API / MCP: ChirpModemMod.yaml (settings, report, actions), SWG
classes, ChannelSettings/Report/Actions and model factory entries cloned
from PacketMod (plain setters, safe in the request mapper's reset lists),
webapiutils, webapirequestmapper, webapi.qrc. Action {"tx": 1} with
optional src, dst and message for one transmission.
- Channelizer asked for 4 x BW, as chirpmodem_tx_new needs fs >= 2.2 x
(BW/2 + |IF|) and the channelizer leaves a residual offset.
Verified: FileOutput -> cm_rx 3/3 frames, +17.4 dB, 0.0 Hz; FileOutput ->
FileInput -> demodchirpmodem 3/3 in get_packets; over the air (Pluto at
-30 dB through 40 dB to an RTL-SDR, 223.58 MHz) 15/15 frames received by
demodchirpmodem, matching cm_rx on SDRangel's recording of the same signal
(+17.0 dB, -2713 Hz).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a DSPSignalNotification the GUI narrows the Δf dial to ±rate/2. With
the first notification at a device's default rate (48 kS/s), an offset set
afterwards was clamped in the display only (signals blocked), and nothing
put the real value back when the range widened: the dial showed +24,000
while the channel was at +250,000. setValueRange was also not signal
blocked, so a clamp there could have sent the clamped offset to the channel.
Block the dial's signals around the range change and show the offset from
the settings again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New channel Rx plugin demodchirpmodem, built on libchirpmodem (format v1),
modelled on demodselcal: plugin, settings, baseband, sink, GUI, web API
adapter, readme. Rx only.
- The channel is decimated to at least 2 x BW; the library is given the
delivered rate and the signal's residual offset in it (if_offset).
- The chirpmodem_rx handle lives in the sink and is used only on the
baseband thread under the baseband mutex. Settings changes mark it stale;
it is rebuilt once per message, never during chirpmodem_rx_push().
- Frames are copied in the callback and posted to the channel, which
forwards them to the GUI and publishes OK frames (whole MAC frame) on the
"packets" pipe.
- GUI: SF, BW, effort, auto effort, report failures, max bytes; frames table
(UTC, status, profile, src, dst, SNR, offset Hz/ppm, mode, length, text,
hex) with licensed-profile policy flag; channel spectrum.
- libchirpmodem found with find_package(chirpmodem 0.1 REQUIRED), hint
CHIRPMODEM_DIR or ~/.local; linked statically. Builds in SERVER_MODE.
Web API / MCP support:
- ChirpModemDemod.yaml (settings and report), SWG model classes, entries
in SWGChannelSettings/SWGChannelReport/SWGModelFactory, webapiutils,
webapirequestmapper and webapi.qrc.
- MCP data feed: listen to sdrangel.channel.chirpmodemdemod and decode the
MAC frame (flags, base-40 callsigns, body) for get_packets.
Verified on the 2026-10-23 OTA capture (ota.cu8 -> .sdriq, FileInput):
49/49 frames, identical to cm_rx in order, source and body; last-frame SNR
and offset match (-10.1 dB, -2651.5 Hz, -11.86 ppm).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After adding the SFO drift (4.25 * sfo_hat) to the fractional STO, the
value was wrapped back into [-0.5, 0.5] but the removed whole chip was
discarded, misaligning subsequent symbols by m_osFactor samples. This
mostly bites at high SF with clock drift, where the drift term can
reach ~0.3+ chips.
- Fold the wrapped chip(s) into the returned FIFO advance (-chips * os).
- Wrap via loRaRound() (half away from zero), so |sto_frac| >= 0.5 now
wraps; previously exactly 0.5 did not. Equivalent timing either way.
- Reset non-finite STO before rounding (float->int cast of NaN/inf is UB).
- Log when the FIFO advance is clamped to 1.
writeData() runs on the audio input thread and iterates m_audioFifos
without a lock, while addFifo()/removeFifo() are called from other
threads. A modulator with audio input (e.g. SSB Mod) removes and re-adds
its FIFO each time it starts, so starting a Tx device while audio is
flowing could crash in AudioFifo::write() (SIGSEGV in
QBasicMutex::lockInternal) when the list changed under the iteration.
Keying the transmitter often (e.g. FT8 via WSJT-X) hit it within hours.
Protect the list with its own mutex, held only for the list operations.
m_mutex is left alone, so this does not bring back the lockups the
commented out lock in writeData() was removed for.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exporting opened the file ReadWrite without truncation, so exporting over
a longer earlier export left its tail in the file and the import then
failed with "Cannot deserialize configuration from file".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Other applications (e.g. SoapyPlutoSDR, used by gqrx) leave the RX LO
powered down when they close, so SDRangel only received the AD9361's
own noise. In FDD mode the Tx LO also stays up while no stream runs,
radiating LO leakage when the Tx device is merely opened.
Set the LO powerdown attribute explicitly: power the LO up when a
stream starts, down when it stops or fails, and power the Tx LO down
when the Tx device is opened. Applies to the input, output and MIMO
plugins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All existing jobs use libiio 0.x (distribution package or external/),
so the libiio 1.x code path was never compiled in CI. Add a server-only
Ubuntu job that configures with ENABLE_LIBIIO_V1, lets external/ build
libiio 1.0.0, checks that the 1.x API was selected and builds the
PlutoSDR device library and plugins. It only runs when PlutoSDR or
libiio related files change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With ENABLE_LIBIIO_V1, the Linux external build now fetches libiio
v1.0.0 instead of v0.26, points LIBIIO_INCLUDE_DIR at its include/
directory (for iio/iio.h) and sets LIBIIO_V1. The 0.x compatibility
library, utilities, iiod, examples and tests are not built. libiio 1.x
additionally needs libzstd and libavahi-client.
Building libiio 1.x from source is not set up for Windows and macOS yet:
there ENABLE_LIBIIO_V1 prints a warning and the 0.x build is used.
Nothing changes when ENABLE_LIBIIO_V1 is off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RTTY, NAVTEX and ILS demods read logFilename/logEnabled from
getAdsbDemodSettings(), which is null for those channels, so a PATCH of
either key crashes SDRangel. Also fix M17 Mod reverseAPIChannelIndex
(read from NFM Mod settings), Audio CAT SISO settings get and XTRX MIMO
reverse API settings and report (Input instead of MIMO types), and
BladeRF2 Output title (BladeRF1 settings).
libiio 1.0 is new and not yet packaged by distributions, so keep the
0.x API as the default and add ENABLE_LIBIIO_V1 (default OFF) to build
against 1.x explicitly.
The finder used to look for the 1.x header in IIO_DIR and in the system
paths before falling back to 0.x, independently of where it found the
library. With 1.x installed system-wide and IIO_DIR pointing at 0.26,
it combined 1.x headers with the 0.26 library and the link failed. Now
each candidate install (IIO_DIR, then the one pkg-config reports, then
the system paths) must provide both the header and the library for the
requested API; an install with the other API is skipped with a message.
Changing ENABLE_LIBIIO_V1 triggers detection again in an existing build
directory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace strncmp()/strlen() in withBackendPrefix() with
std::string::rfind(prefix, 0), as done elsewhere in this file. The
inputs were always null-terminated, but static analysis (Flawfinder,
CWE-126) flags any strlen() use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Pluto reachable both on its USB gadget network (192.168.2.1) and on a
LAN address is reported as two "ip" contexts. Both got the same key
(<serial>_ip), so m_serialMap kept one of them arbitrarily and selecting
"PlutoSDR0 (ip)" could open the wrong address.
When keys collide, append the address to the backend part of the key,
e.g. <serial>_ip:192.168.50.20, which also shows in the device name. A
device with a single address keeps its usual key, so saved device
references still match. Exact duplicate URIs are skipped, and the
serial and URI maps are now cleared on each scan instead of keeping
entries from previous scans.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With LIBIIO_V1, Tx channels are enabled in an iio_channels_mask and
samples are sent through an iio_stream with 4 blocks. createTxBuffer()
takes the first empty block without queueing anything; txBufferPush()
queues the filled block and waits for the next free one, so
txBufferFirst()/End() always point at the block being filled. Cyclic
buffers are not available through iio_stream and SDRangel never
requests them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With LIBIIO_V1, Rx channels are enabled in an iio_channels_mask and
samples are streamed through an iio_stream with 4 blocks in flight.
rxBufferRefill() fetches the next filled block, which hands the previous
one back to the hardware, and rxBufferFirst()/End()/Step() read from
that block. The box API is unchanged, so the Rx threads need no changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With LIBIIO_V1, create contexts with iio_create_context() and check for
pointer-encoded errors. Attribute access goes through struct iio_attr:
iio_device_identify_filename() is gone, so a small helper resolves the
sysfs file name to a channel, device or debug attribute in the same
order 0.x used. Values are read with iio_attr_read_raw() and written
with iio_attr_write_string() / iio_attr_write_raw().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iio_create_scan_context() and the iio_context_info list were removed in
libiio 1.x. Use iio_scan() and the iio_scan_get_*() accessors when
LIBIIO_V1 is set. Also release the 0.x scan context when listing fails.
libiio 1.x reports network contexts as a bare mDNS host name with no
"ip:" prefix, so the probe failed and the hostname-to-IP rewrite and
backend labels never applied. Add the prefix when no backend is given,
and probe the rewritten URI: the .local name can resolve to another
interface (e.g. the USB gadget network) than the one that was scanned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libiio 1.x installs its header as include/iio/iio.h instead of
include/iio.h. Look for the 1.x layout first and fall back to the 0.x
one, and set LIBIIO_V1 so plutosdrdevice can select the API at compile
time. The bundled external build (v0.26) keeps the 0.x path.
The input and output plugin headers only need the iio_buffer type, so
forward-declare it instead of including iio.h.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>