Skip to content

20260930 - Derive the RSPduo notch filters from the capture frequency - #46

Merged
Purple10101 merged 1 commit into
mainfrom
20260930-notches-from-fc
Sep 30, 2026
Merged

Purple10101 merged 1 commit into
mainfrom
20260930-notches-from-fc

Conversation

@Purple10101

Copy link
Copy Markdown
Collaborator

What

The RSPduo's DAB and RF notch filters (capture.device.dabNotch, rfNotch) are now derived by config-merger from the final capture.fc and capture.fs on every merge, instead of being user settings.

Why

default.yml shipped both notches on, and the first-boot copy put that true/true into every node's user.yml. A node tuned inside a notch's stopband has been filtering out its own illuminator. The notches are a function of the frequency, so they should follow it.

Change

  • derive_notches() runs on the merged config after forced.yml. A notch is on unless [fc - fs/2, fc + fs/2] overlaps its stopband: RF (FM) 77-115 MHz, DAB 155-235 MHz. The result always overwrites the merged value, so the persisted true/true needs no LEGACY_* migration.
  • A missing or non-numeric fc/fs leaves the merged values alone.
  • default.yml keeps both keys, commented as derived. Standalone (cp default.yml config.yml) and staging/merge-config.sh don't run the merger, and blah2 aborts on a missing key.
  • At the shipped 503 MHz both notches stay on, so UHF nodes see no change.

Rollout note

A node whose fc is inside a stopband (for example VHF-high DTV inside the DAB band) has that notch turned off, so its illuminator arrives 20-30 dB stronger. Gain set with the notch on may overload the front end. That node's gain needs lowering, or Auto-Calibrate run again, after this lands.

Known limitation: blah2 applies the notches only at sdrplay_api_Init(). A live retune (POST /capture/retune, used by Auto-Calibrate to probe candidate towers) changes fc but not the notches. The applied result is correct because /calibrate/apply re-runs the merger and restarts blah2.

Testing

  • 8 new tests in config-merger/test/test_merge_config.py: UHF, FM band, DAB band, band edges using fs, user.yml overwritten, forced.yml fc, missing and non-numeric fc, no capture section. pytest config-merger/test/ scripts/test/: 85 passed. ruff check . and the vulture pre-commit hook pass.
  • On a test node tuned inside the DAB band: a merger image with this script, run through retina-gui's Apply, derived rfNotch=true, dabNotch=false. The value reached config.yml and blah2 (its startup log printed dab_notch_fg: false). tar1090.env and user.yml were unchanged. That node's gain was set for the notched signal, and it overloaded as described above. It was restored afterwards.
  • Not verified: SNR on a node tuned inside a notch band after recalibrating with the notch off.

Docs

README.md (new "RF notch filters" section, including the overload note and the live-retune limitation), STANDALONE.md, staging/README.md, the staging/merge-config.sh header, default.yml comments and the merge_config.py docstrings.

After this

The retina-gui PR removes the two checkboxes from the Config page. The blah2-arm PR corrects the rspduo README.

🤖 Generated with Claude Code

config-merger now sets capture.device.rfNotch and dabNotch from the final
capture.fc and fs, after forced.yml. A notch is on unless the capture band
overlaps its stopband (RF 77-115 MHz, DAB 155-235 MHz). The derived value
overwrites every overlay, so the true/true each node persisted in its
first-boot user.yml needs no migration. At the shipped 503 MHz both stay on.

default.yml keeps both keys: blah2 aborts on a missing key, and standalone
and staging build config.yml from default.yml without config-merger.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Purple10101
Purple10101 merged commit 9fde22c into main Sep 30, 2026
1 check passed
@Purple10101
Purple10101 deleted the 20260930-notches-from-fc branch September 30, 2026 14:04
Purple10101 added a commit that referenced this pull request Oct 5, 2026
blah2 v0.6.2 -> v0.6.3             matches detections against where each
                                   aircraft is rather than its last
                                   reported position, which had collapsed
                                   tagged tracks from about 230 a day to
                                   almost none; plus the notch doc revert
config-merger v0.4.7.1 -> v0.4.7.2   self-referential, always the tag being
                                   cut. Carries the revert of #46.

This is the corrective release for v0.4.7.1, which never went fleet-wide:
staged-first was rolled back to v0.4.7.0 on 2026-10-04 after nodes wedged
on NumDevs=0. Deriving the notches from fc turned dabNotch off at 213 MHz,
inside the DAB notch band, and a node that overloads at start-up trips a
deadlock in blah2's RspDuo path that leaves the SDRplay service hung
holding the device.

Worth being plain about: this removes the trigger, not the defect. The
deadlock has been present since blah2 v0.6.0 and is unfixed here, so a
node that overloads at start-up for any other reason can still wedge. It
is being addressed separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant