Skip to content

Antenna setting resets after stream activation #99

@TobiasWooldridge

Description

@TobiasWooldridge

Problem

The antenna setting configured via setAntenna() is reset to a default value after calling activateStream() on some configurations. This forces applications to re-apply the antenna setting after stream activation and verify it was applied correctly.

Observed Behavior

  1. Call setAntenna(SOAPY_SDR_RX, 0, "Tuner 1 50 ohm")
  2. Verify with getAntenna() - returns correct value
  3. Call setupStream() and activateStream()
  4. Call getAntenna() again - returns different value (e.g., "Tuner 2 Hi-Z")

Workaround

Applications must:

  1. Query antenna after stream activation
  2. Re-apply antenna if it changed
  3. Verify again

Example workaround code:

# After activateStream()
actual_antenna = sdr.getAntenna(SOAPY_SDR_RX, 0)
if actual_antenna != requested_antenna:
    sdr.setAntenna(SOAPY_SDR_RX, 0, requested_antenna)
    # Verify it stuck
    final = sdr.getAntenna(SOAPY_SDR_RX, 0)
    if final != requested_antenna:
        logger.warning(f"Antenna mismatch: wanted {requested_antenna}, got {final}")

Expected Behavior

Antenna setting should persist through stream activation, or the driver should automatically re-apply the configured antenna after internal resets.

Environment

  • macOS (Apple Silicon)
  • SDRplay RSPduo
  • SoapySDRPlay3 driver

Suggested Fix

In the driver's activateStream() implementation, after any internal API calls that might reset state, re-apply the cached antenna setting:

int SoapySDRPlay::activateStream(...) {
    // ... existing activation code ...
    
    // Re-apply antenna setting if it was explicitly set
    if (_antennaConfigured[channel]) {
        // Re-apply the cached antenna value
        setAntenna(direction, channel, _configuredAntenna[channel]);
    }
    
    return 0;
}

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions