Commit Graph
11296 Commits
Author SHA1 Message Date
Carles Fernandez 0507d312de Fix defects detected by Coverity Scan 2026-11-01 13:56:58 +01:00
Carles Fernandez 36ce582f1c Merge branch 'gps-l1c' into next 2026-11-01 10:39:41 +01:00
Carles Fernandez 8f0b310ef9 Add L1C signals to utility scripts 2026-11-01 10:12:05 +01:00
Carles Fernandez 724a17c429 Add a guard at GPS L1C TMBOC tracking against off-peak DLL locks
Add a configuration file for the FGI-GSRx GPS L1C dataset (Skydel simulation at 25 Msps)
2026-11-01 09:08:13 +01:00
Carles Fernandez 1c7c52d5ab Fix L1C+L2C ionosphere-free positioning 2026-11-01 07:39:12 +01:00
Carles Fernandez 999a64ec56 Add the GPS L1C receiver chain with signal identifier 1S
Deterministic mode now accepts Galileo E6 channels together with E1, E5a or E5b
Fix CNAV MT33 UTC fields reading
2026-10-31 15:31:44 +01:00
Carles Fernandez aa08924514 Fix uninitialized scalar fields 2026-10-30 13:40:34 +01:00
Carles Fernandez af9d2972c2 Detect libiio v1.x and pin the build instructions to libiio v0.x
GNSS-SDR uses the libiio v0.x API. FindLIBIIO.cmake now compiles and
links a v0.x program before setting LIBIIO_FOUND, and reports a libiio
v1.x installation instead of saying that libiio was not found.
ENABLE_AD936X_SDR now also requires libiio at configure time. The
README and the CMake hints now point to the libiio-v0 and
libad9361-iio-v0 branches, since the default branches of both libraries
now target libiio v1.x
2026-10-27 15:43:35 +01:00
Carles Fernandez 85e5df0b9f Merge branch 'joebre-fix/pvt-combined-flag-ionoopt' into next 2026-10-27 14:08:05 +01:00
Carles Fernandez dcc5821af5 Fix monitor used/combined flags outside single-point and for shared slots
Pick the band rule from the estimator that produced the fix:
prange() pairing for single-point fixes, vsat[] for DGPS/RTK.
Check that each signal's slot holds its own obs code, via the new
rtklib_obs_code() helper shared with insert_obs_to_rtklib(), so
B1I next to B1C and excluded E5/E6 signals are not reported as used.
Move prange_band_pair() to rtklib_pntpos and document the per-signal
semantics in monitor_pvt.proto.
2026-10-27 14:07:42 +01:00
Carles Fernandez 135a6f48e6 Merge branch 'fix/pvt-combined-flag-ionoopt' of https://github.com/joebre/gnss-sdr into joebre-fix/pvt-combined-flag-ionoopt 2026-10-27 13:24:33 +01:00
Carles Fernandez a6978da3d9 Merge branch 'timothyanderson096-ocdealcheck-docs/1066-rtlsdr-calibration-comments' into next 2026-10-27 13:12:59 +01:00
Carles Fernandez b33fe4ceb1 Merge branch 'docs/1066-rtlsdr-calibration-comments' of https://github.com/timothyanderson096-ocdealcheck/gnss-sdr into timothyanderson096-ocdealcheck-docs/1066-rtlsdr-calibration-comments 2026-10-27 13:12:36 +01:00
Carles Fernandez 4d4ae83d41 Merge branch 'vladisslav2011-beidou_b2a_pilot' into next 2026-10-27 13:04:04 +01:00
Carles Fernandez 4b9d66e813 Fix B2a pilot tracking output during pull-in 2026-10-27 13:00:32 +01:00
Carles Fernandez 497c2a4492 Merge branch 'beidou_b2a_pilot' of https://github.com/vladisslav2011/gnss-sdr into vladisslav2011-beidou_b2a_pilot 2026-10-27 12:43:59 +01:00
Carles Fernandez ed46d1f9ad Merge branch 'joebre-evk1029-shm-pr-v2' into next 2026-10-27 12:28:25 +01:00
Carles Fernandez 36fbc0e4cc Add forgotten fix 2026-10-27 12:28:06 +01:00
Carles Fernandez 5ce2f5ad2f Merge branch 'next' into joebre-evk1029-shm-pr-v2
Resolve the CHANGELOG conflict, and fix the EVK1029 shared-memory input
on top of the merge:

- In shared-memory mode, Evk1029SignalSource is real-time and cannot
  wait, so the deterministic mode refuses it and the Signal Conditioner
  no longer plans it as an unthrottled replay. Read
  shm_stop_on_buffer_overflow only on Linux, avoiding an unused variable
  warning elsewhere.
- Stopping the receiver no longer hangs when EVK1029_CtrlApp is idle,
  has crashed or has been restarted. ReadBlock() waits at most 100 ms at
  a time, RawStreamReader::read() then returns to its caller (see
  end_of_stream()), and Evk1029Source releases a decode worker waiting
  for data when GNU Radio stops the flowgraph. The stream ends if the
  producer publishes nothing for SignalSource.shm_stall_timeout_s
  seconds (default 5, 0 waits forever).
- request_stop() bumps data_event before waking the reader, and
  ReadBlock() takes its snapshot of data_event before checking the stop
  flag, the ring and the stream state, so that no wake-up is lost.
- Count overflows and producer silence from the first sample read, not
  from the attach: nothing reads the ring while the flowgraph is built,
  so shm_stop_on_buffer_overflow=true stopped the receiver at startup.

Update the CHANGELOG entry with the actual parameter names and the new
shm_stall_timeout_s parameter.
2026-10-27 12:27:16 +01:00
Carles Fernandez bdbe5e803b Merge branch 'ObvMamut-tracking-dump-carrier-phase-double' into next 2026-10-27 09:57:36 +01:00
Carles Fernandez 96cf62225f Fix Matlab script 2026-10-27 09:55:49 +01:00
TIM ANDERSON e1371c6a32 docs: clarify nominal and calibrated RTL-SDR sample rates
Distinguish the hardware sample-rate request from the calibrated
processing rate and RF center from the baseband IF offset.
Keep every active configuration assignment unchanged.

Refs: #1066

Prepared with AI assistance; submitted under Timothy Anderson's
review and task-specific authorization.

Signed-off-by: Timothy Anderson <timothyanderson096@gmail.com>
2026-10-27 18:38:37 +10:00
Carles Fernandez 53b877a4dc Fixes for GNU Radio 3.7 2026-10-27 09:35:38 +01:00
Carles Fernandez 28ee074f75 Fix for GNU Radio 3.7 2026-10-27 09:32:38 +01:00
Carles Fernandez 4baba9d479 Fix tracking blocks 2026-10-27 08:49:26 +01:00
Carles Fernandez 6564d6148f Write the accumulated carrier phase as double in all tracking dumps
Extend the change of the previous merge to the remaining tracking
blocks: kf_tracking and gps_l1_ca_gaussian_tracking_cc (binary dump and
.mat file; records grow from 96 to 100 bytes), and the GPS L1 C/A and
Galileo E1 TCP connector and GPS L1 C/A GPU blocks (records grow from 88
to 92 bytes). The Galileo E1 TCP connector block accumulated the carrier
phase in a float, which is now a double.

Update the KF readers in utils/matlab and utils/python accordingly.

Tracking_Dump_Reader now takes the record layout, since the FPGA and
Gaussian tests read dumps that lack the TOW and WN fields (and, for the
Gaussian block, have the carrier noise variance in place of the code
frequency rate) with the dll_pll_veml_tracking layout.

Add a CHANGELOG entry.
2026-10-26 16:56:47 +01:00
Carles FernandezandClaude Opus 5.5 459653dfda Merge branch 'tracking-dump-carrier-phase-double' of https://github.com/ObvMamut/gnss-sdr into ObvMamut-tracking-dump-carrier-phase-double
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 16:54:35 +01:00
Carles Fernandez ffde5f91d2 Merge branch 'ObvMamut-fix-tracking-forced-loss-of-lock' into next 2026-10-26 16:08:44 +01:00
Carles Fernandez 2ff7d73bf8 Merge branch 'fix-tracking-forced-loss-of-lock' of https://github.com/ObvMamut/gnss-sdr into ObvMamut-fix-tracking-forced-loss-of-lock
Resolve the conflicts with the deterministic processing mode: keep the
deterministic loss-of-lock dispatch together with the "forced" suffix in
the loss-of-lock log line, and convert the two deterministic telemetry
fault paths in dll_pll_veml_tracking and kf_tracking, which still forced
the loss of lock by writing 200000 into the carrier lock fail counter,
to d_force_loss_of_lock.

Remove the conflict markers left in docs/CHANGELOG.md by the merge of
the deterministic branch, and add a CHANGELOG entry for this fix.
2026-10-26 15:39:59 +01:00
Carles Fernandez 422b2a6c36 Merge branch 'deterministic' into next 2026-10-26 14:46:42 +01:00
Carles Fernandez e01ce536bf Delete move operations in StreamBatcherDeadline and its Impl 2026-10-26 12:43:24 +01:00
Carles Fernandez e873769aa4 Fix CI failures 2026-10-26 11:25:51 +01:00
Carles Fernandez 7d4f65d863 Add a deterministic processing mode for recorded signals
Add a deterministic processing mode for recorded signals
Processing the same file twice was not repeatable, even with
Acquisition_XX.blocking=true: the control thread started searches,
assigned satellites and applied channel events at whatever sample
each block had reached, and the PVT and observables applied each
other's messages whenever they arrived.

With GNSS-SDR.deterministic=true (default: false), events and
messages carry the sample at which they happened, the control
thread handles channel events in sample order, and their effects
take place a fixed lookahead later (deterministic_lookahead_ms,
default 100 ms). A gate at the Signal Conditioner output keeps the
stream within that horizon, blocks take their stamped messages at
the start of each work call, maintenance runs on signal time
(deterministic_tick_ms), and the receiver stops once the whole
input has reached the PVT. Dumps, RINEX, NMEA, KML, GPX and GeoJSON
outputs are then bit-identical from run to run on the same machine
(same FFTW wisdom and VOLK configuration), whatever the CPU load.

Supported: all file sources (throttled or not, including LabSat,
EVK1029 and ION), all acquisitions except assisted and FPGA, and
the DLL/PLL VEML, KF and Gaussian trackers. Live front ends, HAS
and NTRIP corrections, strict OSNMA, Galileo E6 with the TOW map,
GNSS assistance and visibility-aware search are refused.
2026-10-26 08:21:51 +01:00
Carles Fernandez 002b41804e The SUPL client now verifies the server certificate and DNS name or IP address 2026-10-25 13:37:34 +01:00
Vladislav P 0d628166ef BeiDou B2a: Pilot tracking/acquisition
Implemented B2a pilot secondary code generation.
Added B2a pilot secondary code generation test.
Renamed beidou_b2a_code_gen_* to beidou_b2a_data_code_gen_*.
Updated DLL/PLL VEML tracking and PCPS acquisition blocks/adapters.

Signed-off-by: Vladislav P <vladisslav2011@gmail.com>
2026-10-25 05:20:25 +03:00
joebre b44795de69 Fix CHANGELOG.md line wrapping for prettier-markdown CI check
Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 13:52:49 +02:00
joebre 7c01385b9d Address review on EVK1029 SHM input: build, correctness, backpressure
carlesfernandez's review of this PR (gnss-sdr/gnss-sdr#1154) raised several
issues. This addresses all but the DCO/signing requirement (handled
separately via rebase) and the GPL licensing question on shm_ring.h (his
call, not mine to answer in code):

- Build: shared_memory_stream_reader.cc/shm_ring.h are now gated to Linux
  only (CMAKE_SYSTEM_NAME), matching the EVK1029_SHM_INPUT compile
  definition the adapter checks before including/constructing
  SharedMemoryStreamReader; an unavailable shared_memory input now throws
  std::invalid_argument instead of failing to build.
- librt is linked on glibc < 2.34, same as core_receiver already does for
  its own shm_open use.
- ReadBlock() now treats StreamState::Error as terminal (it previously
  blocked forever), and rejects a length prefix larger than the block can
  hold instead of reading past it (reproduced his reported 64 MiB ASan
  overread).
- An unrecognized SignalSource.input value now throws instead of silently
  falling back to file mode; enable_throttle_control is ignored with a
  warning in shared_memory mode.
- Dangling references to the (not-in-repo) spec doc removed; diagnostics
  moved from std::cout to LOG(INFO)/LOG(WARNING); added the missing
  gnss_sdr_make_unique.h include; fixed the clang-tidy violations he listed
  (brace-less ifs, long -> int64_t).

Backpressure and loss detection redesigned per further discussion: the SHM
ring's WriteBlock() blocks (not drops) a full ring, so a stalled GNSS-SDR
consumer backs up through EVK1029_CtrlApp's own buffering instead of ever
reaching the USB/target side -- the target must never see an overflow
condition from this path. Real, unrecoverable loss is instead detected on
EVK1029_CtrlApp's side via the existing IF_TO_AXIS hardware overflow flag
(now also polled during SHM streaming, not just recording) and surfaced
through the ring's Header as overflow_event_count (protocol bumped to v3).
It's a count of occurrences, not bytes -- the hardware only latches a
sticky bit -- so SharedMemoryStreamReader can't zero-fill a known gap; it
either stops the stream (new SignalSource.shm_stop_on_buffer_overflow,
default false) or logs and continues, leaving the sample count to jump in
place.

Also fixes request_stop() not waking a blocked read(): setting the stop
flag alone doesn't wake a ReadBlock() already asleep in FUTEX_WAIT on
data_event, so Evk1029Source's join() of the decode-ahead thread could hang
on shutdown with an idle producer -- the same class of bug his review
caught elsewhere, found while re-checking this change for others like it.

Verified with standalone tests (plain and under AddressSanitizer), not
just a clean build: round-trip, terminal Error, corrupted-length
rejection, WriteBlock's blocking-plus-abortFlag-wake behavior, overflow
detection (both log-and-continue and stop-on-overflow), and request_stop()
unblocking a waiting read(). Full gnss-sdr build (including install/)
clean throughout.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 08:54:39 +02:00
joebre 254b2e6c7d Update EVK1029 reference conf: real-time SHM input and in-source CUDA DDC
Replaces the existing dual-band Galileo E1+E5a / GPS L1+L5 reference
conf, which only demonstrated the traditional SignalConditioner-based
decode/filter/decimate chain, with one that documents and exercises
EVK1029_Signal_Source's current full capability:

- Two input modes: batch (a recorded capture file, as before) or real
  time via EVK1029_CtrlApp's shared-memory stream
  (SignalSource0.input/.shm_name).
- In-source downconversion/decimation (enable_freq_xlating), on CPU or
  GPU (bandN_cuda) -- the recommended configuration, since it removes
  that work from the CPU entirely. SignalConditioner0/1 are set to
  Bypass accordingly. The traditional SignalConditioner chain is still
  fully supported and documented as the fallback when CUDA isn't
  available.

Verified end-to-end against this exact file: file-mode parses and
initializes cleanly (fails only on the placeholder capture path, as
expected), and shared-memory mode reaches a full attach/read/decode/
CUDA-DDC/EOF/shutdown cycle against a synthetic producer with no
errors.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 08:54:38 +02:00
joebre d02b573a87 Add RawStreamReader abstraction: file playback or live SHM input
First step of EVK1029_shared_memory_input_spec(2).md on the GNSS-SDR side:
Evk1029Source now reads raw bytes through a RawStreamReader interface
instead of owning an ifstream directly, so the exact same OBA-decode/FIR/
CUDA pipeline can run against either a recorded capture file or a live
shared-memory stream from EVK1029_CtrlApp.

- raw_stream_reader.h: the interface (read(), request_stop()).
- file_stream_reader.{h,cc}: wraps the original file-reading behavior
  (open, optional word-aligned seek, buffered read) verbatim.
- shm_ring.h: verbatim copy of EVK1029_CtrlApp's evk1029/shm_ring.hpp wire
  protocol -- the two repos build completely separately; only the struct
  layout and kMagic/kVersion need to match, since both sides mmap the same
  region. Keep both copies in sync if the format ever changes.
- shared_memory_stream_reader.{h,cc}: attaches to the ring (retrying up to
  30s if the producer hasn't started yet -- a late producer is recoverable,
  not a hard failure like a missing file), bridges SHM block granularity
  into read()'s byte-stream semantics, EOF on Stopped/EndOfStream with the
  ring drained. Wakes a producer that might be stuck waiting for space on
  destruction.
- Evk1029Source's destructor now calls reader_->request_stop() before
  joining the decode-ahead thread -- that thread's read() can block
  indefinitely on a live stream, so without this the join could hang
  forever on shutdown (a no-op for FileStreamReader, which never blocks).
- evk1029_signal_source.cc: new SignalSource.input=file|shared_memory
  (default file, every existing config keeps working untouched) and
  .shm_name config keys.

Verified: file-mode regression (same capture file, full GPS+Galileo
tracking lock, unchanged from before this refactor) and a synthetic
SHM-mode smoke test (sustained attach/read/EOF/shutdown with no real
hardware). Confirmed on real hardware: EVK1029_CtrlApp's live SHM stream
reaches a real position fix through this path.

Signed-off-by: joebre <joel.brenner@saphyrion.ch>
2026-10-22 08:54:38 +02:00
Carles Fernandez 9480760215 Make Galileo E6 and SBAS channels reach the Monitor. Fixes #1145
The Monitor is fed from the Observables, which since ed5a75e31 fill
channels without a valid time reference with their latest tracking
data. That never worked in Galileo E6-only configurations: the GPS L1
C/A, GPS L5, Galileo, BeiDou D1/D2 and BeiDou B1C telemetry decoders
produced no output until they decoded the time of week, so the
Observables never received E6 tracking data. The GLONASS, GPS L2C,
BeiDou B2a and SBAS decoders already forwarded every symbol with
Flag_valid_word unset; now all telemetry decoders do. Dumps,
telemetry_to_trk and nav-data monitor messages are still issued only
with a valid time of week.

The tracking-only entries also had fs set to 0, which gnss-sdr-monitor
takes as an empty channel, hiding SBAS channels. fs is now kept, with
the validity flags still unset; the PVT only uses observations with
Flag_valid_pseudorange.

As a side effect, the secondary-band acquisition assistance can use a
primary-band channel as soon as its tracking locks, instead of after
its time of week is decoded. The Galileo F/NAV test sink now records
the first item with a valid word.

Alternative to PR #1122, without new options or changes to tracking
and to the PVT time-of-week reset handling. Related to #1018.
2026-10-20 16:25:56 +02:00
ObvMamut a81888f2ae Write the accumulated carrier phase as double in tracking dumps
log_data() in dll_pll_veml_tracking and dll_pll_veml_tracking_fpga casts
d_acc_carrier_phase_rad, a double, to float before writing it to the
binary dump, and save_matfile() reads it back as a float. The
accumulated phase grows by 2*pi times the Doppler shift every second
(about 31400 rad/s at 5 kHz), so it reaches 1e6 rad after about 30 s of
tracking at 5 kHz, or under 3 minutes at 1 kHz. The float spacing is
0.0625 rad at 1e6 rad, 0.25 rad at 3e6 rad and 1 rad at 1e7 rad. At
3e6 rad, for instance, the phase difference between two 1 ms epochs of
the dump is only known to within +/-0.25 rad, about 40 Hz in frequency
terms. The phase used by the receiver (Gnss_Synchro::Carrier_phase_rads)
is a double and is not affected; only the dump is.

Write the field as a double, and read it back as a double in
save_matfile(), so that the .mat file also holds a double.

This changes the dump record layout. The field keeps its position but
grows from 4 to 8 bytes, so a record is now 112 bytes long in
dll_pll_veml_tracking (it was 108) and 100 bytes long in
dll_pll_veml_tracking_fpga (it was 96). The readers of this format are
updated accordingly: Tracking_Dump_Reader, used by the unit tests, and
dll_pll_veml_read_tracking_dump in utils/matlab and utils/python.

Signed-off-by: ObvMamut <obvmamut@proton.me>
2026-10-20 14:17:46 +02:00
ObvMamut 323d1ab8fe Force tracking loss of lock regardless of max_carrier_lock_fail
Two fail-safes in the tracking blocks force a loss of lock: the bit or
secondary code synchronization time limit
(bit_synchronization_time_limit_s), and the telemetry fault message sent
by the telemetry decoders. Both did it by writing a large value into
d_carrier_lock_fail_counter (300000 and 200000, respectively) and
relying on the lock check to find it above max_carrier_lock_fail. When
max_carrier_lock_fail is configured above those values, neither
fail-safe drops the channel: unless the lock detectors drop it for
other reasons, a channel that never achieves bit synchronization keeps
tracking past the time limit, and a channel whose telemetry decoder
reports a fault keeps tracking.

Replace the magic counter values with a d_force_loss_of_lock flag. Both
fail-safes set it, cn0_and_tracking_lock_status() declares the loss of
lock when it is set, whatever the lock fail counters, and it is cleared
when the loss of lock is declared and when a new tracking attempt
starts. The loss-of-lock log line now says when the loss was forced,
since the counter values no longer show it.

The same change is applied to dll_pll_veml_tracking,
dll_pll_veml_tracking_fpga and kf_tracking, the three blocks that used
this pattern.

Add two tests to trk_test that set max_carrier_lock_fail = 1000000 and
check that a telemetry fault and the synchronization time limit still
drop the channel.

Signed-off-by: ObvMamut <obvmamut@proton.me>
2026-10-20 14:17:46 +02:00
Carles Fernandez 5cd2346215 Fix data race in acquisition tests 2026-10-20 13:51:42 +02:00
Carles Fernandez d1f9171ed5 Fix flaky test 2026-10-20 09:15:54 +02:00
Carles Fernandez 644d4b4edc Make clang-tidy happy 2026-10-20 09:15:24 +02:00
Carles Fernandez e328ebda0a Use the CL-zeroed replica for GPS L2C acquisition 2026-10-20 00:47:02 +02:00
Carles Fernandez 22f8a9ef20 Remove sign-flip Doppler bias in PCPS acquisition
A one-code-period PCPS window starts at an arbitrary code phase, so a
secondary-code or data sign transition at the code epoch inside it
splits the correlation peak up to +-0.74/T away from the true Doppler.
For GPS L5 (the I5 NH10 code changes sign at 6 of every 10 epochs),
about 40 % of the acquisitions started tracking 250-900 Hz off. The
1 ms Costas loop then either held a false lock at exactly +-500 Hz
(lock test 0.97, C/N0 3.9 dB low, secondary-code sync impossible)
until bit_synchronization_time_limit_s, or never locked and lost lock
a few seconds after pull-in.

After a positive decision, refine_doppler() despreads the dwells with
the replica aligned to the detected code epoch, scores the two sides
of the epoch under both sign hypotheses (summed non-coherently over
dwells), and re-estimates the Doppler over +-1/T around the grid peak.
It only runs on positive acquisitions, so its cost is negligible, also
with the CUDA grid. It applies to every pcps_acquisition search over
one code period without bit_transition_flag. The new
Acquisition_XX.refine_doppler parameter (default true) disables it.
2026-10-19 22:33:36 +02:00
Carles Fernandez d60ddcbef8 Fix XB wrap-around in GPS L5 I5/Q5 code replicas. Fixes #1151 2026-10-19 18:06:37 +02:00
Carles Fernandez 856f8ad0b3 Merge branch 'joebre-evk1029-source-draft' into next 2026-10-19 17:35:48 +02:00
Carles Fernandez 39f735f946 Add optional CUDA filtering for EVK1029_Signal_Source bands
With -DENABLE_CUDA=ON, band<n>_cuda=true computes that band's
frequency-translating FIR (complex composite taps applied to the real
capture) on an NVIDIA GPU through the new CudaDdcEngine, instead of on
a CPU worker thread. As with the CUDA acquisition engine, the public
interface has no CUDA types and hides the implementation behind a
PIMPL. Each band falls back to the CPU, with a warning in the log, if
its engine cannot be created or a GPU call fails. Builds without CUDA,
and bands without the flag, are unchanged.

Taken from PR #1144, plus:
- Report the CUDA status per band with LOG instead of std::cout/cerr
- Check cudaGetLastError() after the kernel launch, so a failed launch
  is not mistaken for valid output
- Select the engine's device in set_taps(), compute() and the
  destructor, since compute() runs on the band worker threads
- Build the engine only with both ENABLE_CUDA and ENABLE_EVK1029
2026-10-19 15:44:04 +02:00