From c1dd615e1144055f5dee76fdeb84ee4bd789a738 Mon Sep 17 00:00:00 2001 From: Smittix Date: Thu, 26 Feb 2026 11:59:07 +0000 Subject: [PATCH] Force explicit rtl_fm squelch-off and log first PCM chunk --- routes/morse.py | 8 ++++++++ utils/morse.py | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/routes/morse.py b/routes/morse.py index 6d4d639..2fe823e 100644 --- a/routes/morse.py +++ b/routes/morse.py @@ -296,6 +296,14 @@ def start_morse() -> Response: **fm_kwargs, ) + # Some rtl_fm builds behave as if squelch is enabled unless -l is explicit. + # Force continuous audio for CW analysis. + if sdr_device.sdr_type == SDRType.RTL_SDR and '-l' not in rtl_cmd: + if rtl_cmd and rtl_cmd[-1] == '-': + rtl_cmd[-1:-1] = ['-l', '0'] + else: + rtl_cmd.extend(['-l', '0']) + full_cmd = ' '.join(rtl_cmd) logger.info(f'Morse decoder running: {full_cmd}') diff --git a/utils/morse.py b/utils/morse.py index 22db88f..497187a 100644 --- a/utils/morse.py +++ b/utils/morse.py @@ -767,6 +767,7 @@ def morse_decoder_thread( last_pcm_at: float | None = None pcm_bytes = 0 pcm_report_at = time.monotonic() + first_pcm_logged = False reader_done = threading.Event() reader_thread: threading.Thread | None = None @@ -853,6 +854,14 @@ def morse_decoder_thread( last_pcm_at = time.monotonic() pcm_bytes += len(data) + if not first_pcm_logged: + first_pcm_logged = True + with contextlib.suppress(queue.Full): + output_queue.put_nowait({ + 'type': 'info', + 'text': f'[pcm] first chunk: {len(data)} bytes', + }) + events = decoder.process_block(data) for event in events: if event.get('type') == 'scope':