From 766300bdfffa0d473222bd3335731e544ab6f470 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 4 Aug 2019 17:31:50 +0200 Subject: [PATCH] use latest improvementes for fft, too --- owrx/source.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/owrx/source.py b/owrx/source.py index ca82270..488ff47 100644 --- a/owrx/source.py +++ b/owrx/source.py @@ -376,25 +376,15 @@ class SpectrumThread(csdr.output): if self.sdrSource.isAvailable(): self.dsp.start() - def receive_output(self, type, read_fn): - if type != "audio": - logger.error("unsupported output type received by FFT: %s", type) - return + def supports_type(self, t): + return t == 'audio' + def receive_output(self, type, read_fn): if self.props["csdr_dynamic_bufsize"]: read_fn(8) # dummy read to skip bufsize & preamble logger.debug("Note: CSDR_DYNAMIC_BUFSIZE_ON = 1") - def pipe(): - run = True - while run: - data = read_fn() - if len(data) == 0: - run = False - else: - self.sdrSource.writeSpectrumData(data) - - threading.Thread(target=pipe).start() + threading.Thread(target=self.pump(read_fn, self.sdrSource.writeSpectrumData)).start() def stop(self): self.dsp.stop()