possible fix of broken tci module

This commit is contained in:
DJ2LS 2023-12-21 19:42:35 +01:00
parent a2ee95e53a
commit 23c60e80e8

View file

@ -108,32 +108,23 @@ class RF:
self.tci_module.push_audio(audio_48k) self.tci_module.push_audio(audio_48k)
def start_modem(self): def start_modem(self):
# testmode: We need to call the modem without audio parts for running protocol tests if TESTMODE:
return True
if self.radiocontrol not in ["tci"]: elif self.radiocontrol.lower() == "tci":
result = self.init_audio() if not TESTMODE else True if not self.init_tci():
if not result: return False
else:
if not self.init_audio():
raise RuntimeError("Unable to init audio devices") raise RuntimeError("Unable to init audio devices")
if not TESTMODE: self.demodulator.start(self.sd_input_stream)
self.demodulator.start(self.sd_input_stream) atexit.register(self.sd_input_stream.stop)
else: # Initialize codec2, rig control, and data threads
result = self.init_tci() self.init_codec2()
self.init_rig_control()
self.init_data_threads()
if result not in [False]: return True
# init codec2 instances
self.init_codec2()
# init rig control
self.init_rig_control()
# init data thread
self.init_data_threads()
if not TESTMODE:
atexit.register(self.sd_input_stream.stop)
else:
return False
def stop_modem(self): def stop_modem(self):
try: try: