From 05096c2a16a6275803970d57f7a910e49298d1a4 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 10 Dec 2020 18:28:10 +0100 Subject: [PATCH] fully initialize sdr devices * makes always-on work as expected * prevents race conditions when multiple clients connect at the same time --- owrx/__main__.py | 3 ++- owrx/sdr.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/owrx/__main__.py b/owrx/__main__.py index 452de85..a0e83dc 100644 --- a/owrx/__main__.py +++ b/owrx/__main__.py @@ -56,7 +56,8 @@ Support and info: https://groups.io/g/openwebrx return # Get error messages about unknown / unavailable features as soon as possible - SdrService.loadProps() + # start up "always-on" sources right away + SdrService.getSources() Services.start() diff --git a/owrx/sdr.py b/owrx/sdr.py index c52406f..039e914 100644 --- a/owrx/sdr.py +++ b/owrx/sdr.py @@ -13,7 +13,7 @@ class SdrService(object): lastPort = None @staticmethod - def loadProps(): + def _loadProps(): if SdrService.sdrProps is None: pm = Config.get() featureDetector = FeatureDetector() @@ -60,7 +60,6 @@ class SdrService(object): @staticmethod def getSource(id): - SdrService.loadProps() sources = SdrService.getSources() if not sources: return None @@ -70,7 +69,7 @@ class SdrService(object): @staticmethod def getSources(): - SdrService.loadProps() + SdrService._loadProps() for id in SdrService.sdrProps.keys(): if not id in SdrService.sources: props = SdrService.sdrProps[id]