Skip to content

Navigation Menu

Sign in
Sign up

Feat/airspy stream owner diagnostics - #687

Open
VA7DBI wants to merge 2 commits into
MattCheramie:main from
VA7DBI:feat/airspy-stream-owner-diagnostics
Open

Feat/airspy stream owner diagnostics #687
VA7DBI wants to merge 2 commits into
MattCheramie:main from
VA7DBI:feat/airspy-stream-owner-diagnostics

Conversation

@VA7DBI

@VA7DBI VA7DBI commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The conventional scanner was opening and immediately cancelling a new
StreamIQ session on every channel hop (~100 ms dwell). The Airspy driver
needs a brief teardown window before a new transfer can start, so rapid
close/reopen produced 'airspy: stream already active' on every other
channel advance.

Fix: open one IQ stream at Run() startup and keep it alive for the
lifetime of the scanner. SetCenterFreq retunes the hardware; the
running stream delivers samples at the new frequency within a few ms.
The stream is only reopened if the device disconnects (stream channel
closes), providing natural recovery without close/open churn.

Changes

  • cmd/gophertrunk/daemon.go: iqPrimaryOwner map + owner labels on all
    openSingleChannelIQ call sites and on cc/wideband primary claims

  • diagnosticIQSource wrapper on the conventional scanner IQ path logs
    every direct StreamIQ open attempt/result at DEBUG level (WARN on
    failure) so stream contention is identifiable from logs with
    log.level: debug

Test plan

  • make vet test is green locally
  • make integration is green locally (if the change touches the
    daemon)
  • Added or updated tests where appropriate
  • Smoke-tested against real hardware (if SDR / USB / vocoder code
    changed) — describe the dongle / capture used

Breaking changes

N/A

Docs / CHANGELOG

  • Updated install-windows.md troubleshooting table

Linked issues

Addresses #686

dBitech and others added 2 commits June 13, 2026 11:46
The conventional scanner was opening and immediately cancelling a new
StreamIQ session on every channel hop (~100 ms dwell). The Airspy driver
needs a brief teardown window before a new transfer can start, so rapid
close/reopen produced 'airspy: stream already active' on every other
channel advance.
Fix: open one IQ stream at Run() startup and keep it alive for the
lifetime of the scanner. SetCenterFreq retunes the hardware; the
running stream delivers samples at the new frequency within a few ms.
The stream is only reopened if the device disconnects (stream channel
closes), providing natural recovery without close/open churn.
Internal changes:
- Scanner.Run: open one persistent stream; reopen only on stream-died
- Scanner.scanWindow: return (broken, streamDied bool) so Run can
 distinguish device disconnect from normal dwell expiry
- Scanner.beginDwell: take ctx instead of streamCtx/cancel; return
 streamDied bool; no longer cancels/owns the stream lifetime
Broker-side diagnostics added in this branch:
- cmd/gophertrunk/daemon.go: iqPrimaryOwner map + owner labels on all
 openSingleChannelIQ call sites and on cc/wideband primary claims
- diagnosticIQSource wrapper on the conventional scanner IQ path logs
 every direct StreamIQ open attempt/result at DEBUG level (WARN on
 failure) so stream contention is identifiable from logs with
 log.level: debug
Docs: install-windows.md troubleshooting table now covers
'conv: StreamIQ failed / airspy: stream already active' with guidance
on reading the new diagnostic log fields (primary_owner, owner).
Validated on host DBI-NUC-01 (Airspy R2, Windows 10.0 build 26300):
- Before: continuous WARN 'conv: StreamIQ failed' loop at ~3 Hz
- After: single 'conv: opening IQ stream' at startup; 18 min stable
 runtime with zero StreamIQ errors; goroutine count stable
 at 36-37; heap steady at 2-3 MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /