improve sdr failure detection

This commit is contained in:
Jakob Ketterl 2019-12-21 23:29:56 +01:00
parent b5c5bcb9f1
commit 4d0d316fdd
3 changed files with 8 additions and 4 deletions

View File

@ -158,7 +158,7 @@ class OpenWebRxReceiverClient(Client):
next = SdrService.getSource(id)
if next is None:
self.handleSdrFailure("sdr device failed")
self.handleSdrFailure("sdr device unavailable")
return
if next == self.sdr:
@ -207,7 +207,7 @@ class OpenWebRxReceiverClient(Client):
self.write_sdr_error(message)
def startDsp(self):
if self.dsp is None:
if self.dsp is None and self.sdr is not None:
self.dsp = DspManager(self, self.sdr)
self.dsp.start()

View File

@ -110,9 +110,9 @@ class Schedule(object):
class ServiceScheduler(object):
def __init__(self, source, schedule):
self.source = source
self.selectionTimer = None
self.schedule = Schedule.parse(schedule)
self.source.addClient(self)
self.selectionTimer = None
self.source.getProps().collect("center_freq", "samp_rate").wire(self.onFrequencyChange)
self.scheduleSelection()

View File

@ -190,7 +190,11 @@ class SdrSource(object):
if not available:
self.failed = True
try:
self.postStart()
except Exception:
logger.exception("Exception during postStart()")
self.failed = True
self.modificationLock.release()