Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pluto_advanced_rx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
# RTL-SDR (gr-soapy) USB transfer size: ~14 ms of samples per transfer at 2.4 MS/s instead of
# librtlsdr's ~55 ms, so the waterfall gets evenly spaced rows (see devices/rtlsdr.py).
RTL_SOAPY_BUFFLEN_BYTES = 65536
FFT_COMPUTE_RATE_HZ = 30 # fft_probe's own compute throttle, independent of poll rate/sample rate
FFT_COMPUTE_RATE_HZ = 15 # fft_probe's own compute throttle, independent of poll rate/sample rate
WATERFALL_WINDOW = window.WIN_BLACKMAN_hARRIS # matches GNU Radio's own qtgui.waterfall_sink_c default window
WATERFALL_COLORMAP = "viridis"
# Start-up color/Y-axis levels (no per-frame autoscale), replaced ~1 s after every connect by the
Expand Down
14 changes: 14 additions & 0 deletions pluto_advanced_rx/devices/rtlsdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,20 @@ def probe_with_timeout(connection, timeout_s=5.0):
return e
if tcp is not None:
return rtl_tcp.probe(*tcp, timeout_s=timeout_s)
# Use enumerate (does NOT open the device) instead of soapy.source: librtlsdr holds
# exclusive USB access, so a probe-open blocks the immediately-following build_source.
try:
import SoapySDR
results = SoapySDR.Device.enumerate("driver=rtlsdr")
if not results:
return RuntimeError("No RTL-SDR devices found!")
if connection:
serials = [r.asdict().get("serial", "") for r in results]
if connection not in serials:
return RuntimeError(f"RTL-SDR with serial {connection!r} not found (found: {serials})")
return None
except ImportError:
pass # python3-soapysdr not installed: fall back to the open-and-close probe below
try:
device_arg = f"driver=rtlsdr,serial={connection}" if connection else "driver=rtlsdr"
soapy.source(device_arg, "fc32", 1, "", "", [""], [""])
Expand Down
2 changes: 1 addition & 1 deletion web-trx/backend/web_trx/radio_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

logger = logging.getLogger("web_trx.radio_backend")

SPECTRUM_POLL_HZ = 25.0
SPECTRUM_POLL_HZ = 15.0
RIG_FOLLOW_PERIOD_S = 0.5
PROBE_TIMEOUT_S = 5.0
SCAN_TIMEOUT_S = 5.0
Expand Down
Loading