disabled qam, changed threading to daemon=False

This commit is contained in:
DJ2LS 2024-04-21 14:18:45 +02:00
parent acb5b03d51
commit 3619f21e3c
7 changed files with 19 additions and 18 deletions

View file

@ -36,12 +36,12 @@ class ARQSession:
'duration_per_frame': 6.5,
'bandwidth': 2438,
},
4: {
'mode': codec2.FREEDV_MODE.qam16c2,
'min_snr': 11,
'duration_per_frame': 2.8,
'bandwidth': 2438,
},
#4: {
# 'mode': codec2.FREEDV_MODE.qam16c2,
# 'min_snr': 11,
# 'duration_per_frame': 2.8,
# 'bandwidth': 2438,
#},
}
def __init__(self, config: dict, modem, dxcall: str, state_manager):

View file

@ -37,7 +37,7 @@ class FREEDV_MODE(Enum):
data_ofdm_500 = 21500
data_ofdm_2438 = 2124381
#data_qam_2438 = 2124382
qam16c2 = 22
#qam16c2 = 22
class FREEDV_MODE_USED_SLOTS(Enum):
"""

View file

@ -119,7 +119,7 @@ class Demodulator():
for mode in self.MODE_DICT:
# Start decoder threads
self.MODE_DICT[mode]['decoding_thread'] = threading.Thread(
target=self.demodulate_audio,args=[mode], name=self.MODE_DICT[mode]['name'], daemon=True
target=self.demodulate_audio,args=[mode], name=self.MODE_DICT[mode]['name'], daemon=False
)
self.MODE_DICT[mode]['decoding_thread'].start()

View file

@ -26,7 +26,7 @@ class Modulator:
self.freedv_datac14_tx = codec2.open_instance(codec2.FREEDV_MODE.datac14.value)
self.data_ofdm_500_tx = codec2.open_instance(codec2.FREEDV_MODE.data_ofdm_500.value)
self.data_ofdm_2438_tx = codec2.open_instance(codec2.FREEDV_MODE.data_ofdm_2438.value)
self.freedv_qam16c2_tx = codec2.open_instance(codec2.FREEDV_MODE.qam16c2.value)
#self.freedv_qam16c2_tx = codec2.open_instance(codec2.FREEDV_MODE.qam16c2.value)
#self.data_qam_2438_tx = codec2.open_instance(codec2.FREEDV_MODE.data_qam_2438.value)
def transmit_add_preamble(self, buffer, freedv):

View file

@ -50,7 +50,7 @@ class ScheduleManager:
self.scheduler.enter(0, 1, self.schedule_event, (event_info['function'], event_info['interval']))
# Run the scheduler in a separate thread
self.scheduler_thread = threading.Thread(target=self.scheduler.run, daemon=True)
self.scheduler_thread = threading.Thread(target=self.scheduler.run, daemon=False)
self.scheduler_thread.start()
def stop(self):

View file

@ -380,7 +380,7 @@ def main():
if not modemport:
modemport = 5000
app.run(modemaddress, modemport)
app.run(modemaddress, modemport, debug=False)
if __name__ == "__main__":
main()

View file

@ -22,7 +22,7 @@ class SM:
self.socket_interface_manager = None
runner_thread = threading.Thread(
target=self.runner, name="runner thread", daemon=True
target=self.runner, name="runner thread", daemon=False
)
runner_thread.start()
@ -66,6 +66,9 @@ class SM:
else:
self.log.warning("[SVC] freedata_server command processing failed", cmd=cmd, state=self.state_manager.is_modem_running)
# finally clear processing commands
self.modem_service.queue.clear()
def start_modem(self):
if self.config['STATION']['mycall'] in ['XX1XXX']:
@ -76,10 +79,8 @@ class SM:
self.log.warning("freedata_server already running")
return False
# test audio devices
audio_test = self.test_audio()
if False in audio_test or None in audio_test or self.state_manager.is_modem_running:
self.log.warning("starting freedata_server failed", input_test=audio_test[0], output_test=audio_test[1])
self.state_manager.set("is_modem_running", False)
@ -104,13 +105,13 @@ class SM:
def stop_modem(self):
self.log.info("stopping freedata_server....")
self.modem.stop_modem()
del self.modem
self.modem = False
if self.modem:
self.modem.stop_modem()
del self.modem
self.modem = False
self.state_manager.set("is_modem_running", False)
self.schedule_manager.stop()
self.event_manager.modem_stopped()
def test_audio(self):
try:
audio_test = audio.test_audio_devices(self.config['AUDIO']['input_device'],