fully initialize sdr devices

* makes always-on work as expected
* prevents race conditions when multiple clients connect at the same
  time
This commit is contained in:
Jakob Ketterl 2020-12-10 18:28:10 +01:00
parent 2c04d40c53
commit 05096c2a16
2 changed files with 4 additions and 4 deletions

View File

@ -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()

View File

@ -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]