1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-26 12:04:13 -04:00
Commit Graph

11195 Commits

Author SHA1 Message Date
Edouard Griffiths 9306940671 Merge pull request #2840 from rgetz/rgetz-reduce-vla-leansdr
step 1 : reduce vla usage
2026-07-26 06:47:44 +02:00
Robin Getz fef5c27425 demoddatv: Replace spectrum VLA with std::vector
Replace the runtime-sized stack array in the spectrum processing path
with std::vector to avoid compiler VLA extensions.

Although the spectrum template is not instantiated as part of the
current SDRangel build, GCC still emits -Wvla warnings while parsing
the template definition. This change removes those warnings and keeps
the template valid for future use.

Use std::copy() and vector::data() when accessing the underlying
storage.

Part of #2830

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 15:44:41 -04:00
Robin Getz bd0ad31f77 demoddatv: Fix spectrum compilation against current cfft_engine API
The spectrum template was not being instantiated by the current build,
so stale accesses to cfft_engine::n went unnoticed.

Replace direct accesses to the private cfft_engine member with the
public size() accessor. This restores spectrum compilation and allows
the upcoming VLA cleanup to be built and tested.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-25 15:28:57 -04:00
Edouard Griffiths b5f216f049 Merge pull request #2836 from rgetz/rgetz-fix-pluto-close-device
PlutoSDR: keep device open state consistent after close
2026-07-25 13:27:12 +02:00
Edouard Griffiths 7af5f037ed Merge pull request #2832 from srcejon/fix_2831
Fix -DWITH_STACK_PROTECTOR=PFF typo.
2026-07-25 12:42:09 +02:00
Edouard Griffiths 6cbb612db0 Merge pull request #2829 from rgetz/rgetz-fix-wdsp-sphp
WDSP: Fix invalid iterator ranges in SPHP flush
2026-07-25 12:04:20 +02:00
Edouard Griffiths 0a9b2114bc Merge pull request #2828 from rgetz/rgetz-fix-radioastronomygui.cpp
Improve RadioAstronomyGUI robustnes
2026-07-25 11:42:51 +02:00
Robin Getz e46f204796 PlutoSDR: keep device open state consistent after close
Clear the m_open flag when closing PlutoSDR input and output
devices. Previously closeDevice() released m_deviceParams but left
m_open set, leaving the object in an inconsistent state where code
could treat a closed device as still valid.

This was exposed when reloading a running PlutoSDR device, where GUI
updates could access the partially torn-down device state.

Hopefully fixes #2833 (I don't have a windows machine to test).

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-23 21:31:43 -04:00
Jon Beniston 2d3f39bdf8 Fix typo. #2831 2026-07-23 10:37:02 +01:00
Robin Getz 95548a92aa WDSP: Fix invalid iterator ranges in SPHP flush
Correct std::fill() calls in SPHP::flush() that used x0.end() as the
end iterator when clearing x1, y0, and y1.

The incorrect ranges were likely introduced by a copy/paste error and
resulted in iterator pairs from different containers being used
together, causing undefined behavior.

Use each buffer's own end iterator when clearing its contents.

Detected by cppcheck's mismatchingContainer check.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:44:45 -04:00
Robin Getz 68aea9c16f RadioAstronomy: Apply channel settings only after dialog acceptance
Only apply channel settings after BasicChannelSettingsDialog returns an
accepted result. Previously, the return value from dialog.exec() was ignored
and settings were copied from the dialog regardless of whether the dialog was
accepted or rejected.

This could cause changes made in the channel settings dialog to be applied
even when the user discarded them. Check the dialog result before updating
the channel title, color, Reverse API configuration, and stream index to keep
the GUI state synchronized with the user's action.

This also fixes the Coverity CHECKED_RETURN warning for the unchecked
QDialog::exec() return value.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:37:16 -04:00
Robin Getz 10d9d503c7 RadioAstronomy: Initialize FFT measurement fields
Initialize previously unset FFTMeasurement members with defined default
values so newly constructed measurement objects start in a known state.

Although these fields are populated during normal measurement processing,
constructors should establish a complete and deterministic object state
rather than leaving scalar members with indeterminate values. This also
makes the class safer if the initialization sequence changes in the future.

This fixes a Coverity UNINIT_CTOR warning caused by uninitialized scalar
members in the constructor.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:20:30 -04:00
Robin Getz a637a20447 RadioAstronomy: Initialize sensor measurement range values
Initialize m_min and m_max in the SensorMeasurements constructor to ensure
the object has a valid state immediately after construction, before init()
is called.

Although init() sets these values before normal use, constructors should
fully initialize all class members to avoid leaving objects with undefined
state and to make the class safe to use regardless of initialization order.

This fixes a Coverity UNINIT_CTOR warning caused by uninitialized scalar
members in the constructor.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 20:05:01 -04:00
Robin Getz b44ff3ee00 RadioAstronomy: Guard aganst null FFT measurement
RadioAstronomyGUI::spectrumSeries_clicked() called
calcVrAndDistanceToPeak() without verifying that currentFFT() returned a
valid FFTMeasurement. Since currentFFT() can return nullptr and
calcVrAndDistanceToPeak() immediately dereferences the pointer, this could
result in a null pointer dereference.

Guard the calls so they are only made when a valid FFT measurement is
available, matching the existing pattern used elsewhere in the class.

Reported by Coverity (CID 649213).

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-22 19:52:58 -04:00
Edouard Griffiths 2d8182bef2 Merge pull request #2825 from rgetz/rgetz-remove-mallocfail
ft8: replace temporary malloc buffer with std::vector
2026-07-22 17:08:44 +02:00
Edouard Griffiths ff3838d412 Merge pull request #2824 from rgetz/rgetz-paperbag-bug
Fix built-in device selection regression
2026-07-22 14:41:08 +02:00
Edouard Griffiths ce4f6b1a25 Merge pull request #2823 from gretel/yaml-actions-fix
Fix missing YAML-to-SWG mappings for MeshCore plugins
2026-07-22 10:55:55 +02:00
Edouard Griffiths 31580ca25a Merge pull request #2821 from srcejon/fix_2819
APRS: Fix memory leak.
2026-07-22 05:18:09 +02:00
Edouard Griffiths def2eb68a5 Merge pull request #2820 from rgetz/rgetz-remove-check-meshcoredemodgui
Remove redundant ui null check in MeshcoreDemodGUI
2026-07-22 04:30:14 +02:00
Edouard Griffiths a6ad52716e Merge pull request #2818 from rgetz/rgetz-fix-uninitialized-1
Fix Coverity UNINIT warnings in RadioAstronomy and VOR Localizer
2026-07-22 02:12:35 +02:00
Robin Getz 55e13063ea ft8: replace temporary malloc buffer with std::vector
Replace the temporary CRC working buffer in `LDPC::ft8_crc()` with a
`std::vector<int>`.

The vector is value-initialized, preserving the existing zero-padding
behavior, while `std::memcpy()` copies the input message into the front
of the buffer. This removes the manual `malloc()`/`free()` pair, simplifies
the implementation, and uses RAII for temporary storage.

This change also addresses a cppcheck warning about a possible null pointer
dereference following malloc() failure. If memory allocation now fails,
std::vector will throw std::bad_alloc rather than returning a null pointer
that would be dereferenced. The algorithm and behavior are otherwise
unchanged.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-21 20:01:53 -04:00
Robin Getz f0f19d1d37 Fix built-in device selection regression
Built-in devices were previously always selectable regardless of
their claimed state. The "show devices in use" change
https://github.com/f4exb/sdrangel/commit/964bc0994d1e5c54ef8b08eb9102e0ee4f7d744e
inadvertently disabled all claimed devices in the selection dialog,
preventing multiple instances of FileInput, RemoteTCPInput, AudioInput,
TestSource and other built-in sources from being opened. :(

Only claimed physical devices are now disabled and marked
"[in use]". Built-in devices remain selectable as before.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-21 19:42:51 -04:00
Edouard Griffiths 01a23e6f22 Merge pull request #2817 from srcejon/fix_2815
AM Demod: Snap to nearest centre frequency.
2026-07-21 20:46:37 +02:00
Tom Hensel 583ba39829 Fix missing YAML-to-SWG mappings for MeshCore plugins
The MeshCore mod plugin references SWGMeshcoreModActions in
meshcoremod.cpp, but MeshcoreMod.yaml had no MeshcoreModActions
section. When swagger files are regenerated, the auto-generated
SWGChannelActions.h/cpp lose the meshcore_mod_actions member and
accessors, which would break compilation of meshcoremod.cpp.

Changes across five files:

- MeshcoreMod.yaml: add MeshcoreModActions definition (sendNow
  field, matching existing hand-authored SWGMeshcoreModActions)
- ChannelActions.yaml: add MeshcoreModActions  pointing to
  the new section
- SWGModelFactory.h: add #include and create() registration
  block for SWGMeshcoreModActions (was missing despite
  SWGMeshcoreModSettings/MeshcoreDemod* being registered)
- webapirequestmapper.cpp: add channelActionsKey routing branch
  for MeshcoreModActions (was completely absent)
- webapiutils.cpp: add m_channelURIToSettingsKey and
  m_channelTypeToSettingsKey entries for both MeshcoreDemod and
  MeshcoreMod (were missing, unlike ChirpChat and Meshtastic
  which have entries for their channel types)
2026-07-21 12:25:51 +02:00
Jon Beniston 08ed42bf73 APRS: Fix memory leak. 2026-07-21 10:32:00 +01:00
Edouard Griffiths 41d5d57ad1 Merge pull request #2816 from rgetz/rgetz-fix-coverity-int-handling-issues
Fix coverity int handling issues
2026-07-21 08:55:59 +02:00
Robin Getz 409e1f1a00 Remove redundant ui null check in MeshcoreDemodGUI & MeshtasticDemodGUI
The ui object is created during MeshcoreDemodGUI and MeshtasticDemodGUI
construction and remains valid for the lifetime of the widget. Remove
the unnecessary null check to avoid misleading static analysis tools
into assuming ui can be null.

This resolves a Coverity false positive where the later call to
updateDechirpModeUI() was reported as a possible null dereference
in both places.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-20 23:33:44 -04:00
f4exb 4bf6c79bce Changed commit tag of AirspyHF before the bogous one 2026-07-21 03:34:22 +02:00
Edouard Griffiths fcb7dbf8ba Merge pull request #2814 from rgetz/rgetz-pluto-gain-updates
plutosdr: Update RX gain limits dynamically from hardware
2026-07-21 03:13:47 +02:00
Robin Getz 382d541eae RadioAstronomy: Validate sweep configuration before starting
Fix Coverity CID 649243 (DIVIDE_BY_ZERO) by validating sweep step
values before calculating 2D sweep dimensions.

Move sweep step validation to on_startStop_clicked() so invalid sweep
configurations are reported to the user before a sweep begins. Display
an error message when either sweep step is zero and prevent the sweep
from starting.

Retain defensive validation when updating 2D sweep settings to guard
against invalid configurations received from saved settings or other
code paths.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-20 18:35:16 -04:00
Robin Getz 0659f264aa VOR Localizer: initialize intersection variables
Initialize the coordinate and bearing variables used by
VORModel::findIntersection() and declare the validity flags as bool.

Coverity reported that lat1, lon1, bearing1, lat2, lon2, and bearing2
could be passed uninitialized to calcIntersectionPoint(). While the
current control flow is intended to assign these values before the
corresponding validity flag is set, they were not initialized at
declaration, leaving undefined behavior if that invariant were ever
broken.

Initializing the variables removes the possibility of using
indeterminate values, satisfies static analysis, and makes the code
more robust against future modifications. The validity flags are also
changed from float to bool to match their intended use.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-20 17:25:57 -04:00
Robin Getz 1270f27ebf RadioAstronomy: Initialize intensity for unexpected power units
Fix a Coverity UNINIT warning in RadioAstronomyGUI::update2DImage()
where the intensity variable could be used uninitialized if
m_powerYUnits contained an unexpected value and followed the default path.

Handle the default switch case by logging a warning and falling back
to fft->m_totalPowerdBFS, ensuring intensity is always initialized
before being used while providing diagnostics for invalid enum values.

Fixes Coverity CID 649242.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-20 17:24:18 -04:00
Edouard Griffiths 6e2938a372 Merge pull request #2813 from srcejon/fix_2608
WDSP: Fix distorted AM audio when AGC is disabled.
2026-07-20 20:25:12 +02:00
f4exb f6d5096833 Upgrade external dependencies to latest AirspyHF commit 2026-07-20 19:46:04 +02:00
Jon Beniston 7bc89a205c AM Demod: Snap to nearest centre frequency. #2815 2026-07-20 17:41:07 +01:00
Edouard Griffiths f3c1d648ee Merge pull request #2812 from rgetz/rgetz-fix-2779
PlutoSDR: Guard against null buddy shared pointers | Fix #2779
2026-07-20 05:21:49 +02:00
Robin Getz b7cd725c86 RadioAstronomy: Validate Y-factor calibration inputs
Fix Coverity CID 649221 (DIVIDE_BY_ZERO) by validating the cold
calibration power sum before calculating the Y-factor.

Refactor calcCalTrx() to use early returns for invalid calibration
states and avoid duplicated UI clearing logic. Also handle the
undefined Y-factor case when hot and cold measurements have equal power.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-19 19:42:07 -04:00
Robin Getz ea0f5fa790 NoiseFigure: Prevent divide by zero when plotting reference data
Fix Coverity CID 649238 (DIVIDE_BY_ZERO) by validating the reference
column count before using it as a divisor in plotChart().

The reference column count can be cleared when removing reference data,
in on_clearReference_clicked() so ensure chart rendering handles an empty
reference configuration safely.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-19 19:26:39 -04:00
Robin Getz 98f43dfd8c FT8: Fix potential integer overflow in band preset frequency calculation
Fix Coverity CID 649215 (OVERFLOW_BEFORE_WIDEN) by ensuring the band
preset frequency calculation is widened to 64-bit before converting
kHz to Hz.

This prevents a potential 32-bit intermediate overflow when applying
band presets (which is likely not a real issue, but it keeps the
analyzer happy).

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-19 19:21:25 -04:00
Robin Getz 8c3c93a09f ADSB: Fix BDS 4,1 waypoint character bit extraction
Fix Coverity CID 649088 (CONSTANT_EXPRESSION_RESULT) in the BDS 4,1
next waypoint decoding logic.

The high bit contribution to waypoint character c[5] was incorrectly
shifted right by 3, causing the expression to always evaluate to zero
and discard a valid bit from the decoded character. Change the shift
direction to correctly place the extracted bit into the character field.

This restores proper decoding of the BDS 4,1 waypoint string and removes
the Coverity warning.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-19 19:06:16 -04:00
Edouard Griffiths 8d5bdaee80 Merge pull request #2811 from srcejon/fix_2801
Fix kiwiSDRs on Map
2026-07-19 23:52:22 +02:00
Robin Getz 72d612d986 plutosdr: Update RX gain limits dynamically from hardware
Query the PlutoSDR hardware for the current RX gain range and use it
to configure the GUI gain control dynamically.

The AD936x gain limits vary with LO frequency. Previously the GUI used
a fixed gain range, allowing users to select values that the hardware
would reject after changing bands. The gain slider now refreshes its
minimum, maximum, and step size whenever the device center frequency is
updated.

Also change the gain setting serialization to use a signed integer so
negative gain values are preserved for operating modes that support
them.

Changes include:
- Add DevicePlutoSDRBox::getGainRange() to read
  in_voltage0_hardwaregain_available.
- Expose gain range through PlutoSDRInput.
- Refresh GUI gain limits when the device frequency changes.
- Avoid unnecessary widget updates when limits are unchanged.
- Store/restore gain as a signed value.
- Add default RX gain limit constants for fallback when the device
  cannot provide its range.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-19 17:48:53 -04:00
Edouard Griffiths 6d81b0ac3d Merge pull request #2810 from srcejon/fix_2806
AaroniaRTSAInput::webapiReportGet: getAaroniaRtsaReport rather than getAirspyHfReport.
2026-07-19 23:02:55 +02:00
Edouard Griffiths 04eedc5083 Merge pull request #2809 from srcejon/fix_2808
Update bladerf to 2025.10
2026-07-19 22:25:51 +02:00
Jon Beniston d716568973 WDSP: Fix distorted AM audio when AGC is disabled. Add audio clamping on 16-bit conversion. 2026-07-19 20:47:40 +01:00
Robin Getz af4c366cb7 PlutoSDR: Guard against null buddy shared pointers | Fix #2779
Add defensive null checks before dereferencing DeviceAPI::getBuddySharedPtr()
in the PlutoSDR input and output plugins.

DeviceAPI initializes the buddy shared pointer to nullptr, so a buddy may
exist before its shared state has been attached. This could result in null
pointer dereferences during device initialization, buddy thread
suspend/resume, or settings application.

Changes include:
- Validate buddy shared pointer in openDevice() and fail gracefully if absent.
- Guard suspendBuddies() and resumeBuddies() against null shared pointers.
- Skip buddies without shared state during applySettings() while logging a
  warning.
- Prevent dereferencing null buddy shared pointers when restarting buddy
  threads.

These changes improve robustness during PlutoSDR buddy initialization and
avoid crashes caused by partially initialized buddy relationships.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-07-19 12:59:17 -04:00
Jon Beniston 7d84040e77 Update kiwisdr list URL 2026-07-19 17:16:04 +01:00
Jon Beniston ad5ca070e8 Fix constant to be 32MHz instead of 320MHz. Fixes #2801 2026-07-19 17:09:30 +01:00
Jon Beniston 97cabdeb71 getAaroniaRtsaReport rather than airspy. 2026-07-19 16:35:58 +01:00
Jon Beniston ca8ad7e45b Update bladerf to 2025.10 for #2808 2026-07-19 16:23:31 +01:00