mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Force explicit rtl_fm squelch-off and log first PCM chunk
This commit is contained in:
@@ -296,6 +296,14 @@ def start_morse() -> Response:
|
|||||||
**fm_kwargs,
|
**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)
|
full_cmd = ' '.join(rtl_cmd)
|
||||||
logger.info(f'Morse decoder running: {full_cmd}')
|
logger.info(f'Morse decoder running: {full_cmd}')
|
||||||
|
|
||||||
|
|||||||
@@ -767,6 +767,7 @@ def morse_decoder_thread(
|
|||||||
last_pcm_at: float | None = None
|
last_pcm_at: float | None = None
|
||||||
pcm_bytes = 0
|
pcm_bytes = 0
|
||||||
pcm_report_at = time.monotonic()
|
pcm_report_at = time.monotonic()
|
||||||
|
first_pcm_logged = False
|
||||||
reader_done = threading.Event()
|
reader_done = threading.Event()
|
||||||
reader_thread: threading.Thread | None = None
|
reader_thread: threading.Thread | None = None
|
||||||
|
|
||||||
@@ -853,6 +854,14 @@ def morse_decoder_thread(
|
|||||||
last_pcm_at = time.monotonic()
|
last_pcm_at = time.monotonic()
|
||||||
pcm_bytes += len(data)
|
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)
|
events = decoder.process_block(data)
|
||||||
for event in events:
|
for event in events:
|
||||||
if event.get('type') == 'scope':
|
if event.get('type') == 'scope':
|
||||||
|
|||||||
Reference in New Issue
Block a user