Repository navigation
Start both RSPduo tuners at the less sensitive gain reduction - #74
Merged
Merged
Conversation
sdrplay_api_Init() starts streaming with rxChannelB overwritten by rxChannelA's values, and process() only puts B's own value back with an Update afterwards. Staging each tuner at its configured gain before Init therefore starts surveillance at the reference tuner's gain reduction. With the reference set more sensitive than surveillance (A=20 / B=59), B starts ~39 dB hotter than configured, at a gain a calibration run may just have proved overloads it. That can take the SDRplay service down on a cold start, while the same tuning applied by live retune (which changes each tuner separately) runs cleanly (ClickUp 123zgec4dua). Both tuners now start at max(gain_a, gain_b), and the existing post-Init Updates move each one to its configured value, so neither tuner is ever more sensitive than configured during startup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a cold start,
sdrplay_api_Init()begins streaming withrxChannelBoverwritten byrxChannelA's values.process()already puts B's own value back with anUpdateafterwards, but until that lands, tuner B runs at tuner A's gain reduction.That is harmless when A is the less sensitive tuner. When A is the more sensitive one, B briefly runs hotter than configured. With a tuning like A=20 / B=59, it is about 39 dB hotter, at a gain a calibration run may just have proved overloads it. A hard enough overload there takes the SDRplay service to
ServiceNotResponding, and the radio stays down (NumDevs=0) until the service is restarted.Live retunes never do this, because they change each tuner separately while streaming. So a node can run a tuning cleanly during Auto-Calibrate, then fail to come back up on the same tuning after the restart that persists it. That is the failure reported in ClickUp 123zgec4dua:
Change
Before Init, both tuners are staged at
max(gain_a, gain_b). The post-InitUpdates that already exist then move each tuner to its configured value. During startup, neither tuner is ever more sensitive than configured. A starts a little quieter until itsUpdatelands, which is harmless. LNA state is shared by both tuners, so the copy cannot make it worse.One file, +19/-3, no behaviour change for configs where A is already the less sensitive tuner.
Evidence
rxChannelBfield reads back as A's value after Init), and the comment inprocess()documents it. It was seen again today on jonathan-node-1: a cold start of v0.6.1 configured at 20/59/LNA 3 loggedGain change, tuner=sdrplay_api_Tuner_B gRdB=20.Failed to update Tuner A gain: sdrplay_api_ServiceNotRespondingexited blah2. The radio stayed atNumDevs=0until the cron watchdog restartedsdrplay.service.That test did not exercise this fix. On jonathan-node-1 the overload was tuner A at its own configured value, which this change does not touch. That node's reference antenna hears the tower more strongly than its surveillance antenna (its proven tuning is A=45 / B=28), so the copy can only ever make B quieter there. The failure depends on the site: it needs a node where surveillance hears the tower more strongly than reference. The customer's 20/59 split is exactly that arrangement, which may also mean their antennas are swapped.
Verification
Test plan
ServiceNotResponding🤖 Generated with Claude Code