mirror of
https://github.com/smittix/intercept.git
synced 2026-06-08 06:01:56 -07:00
Prefer no-squelch rtl_fm startup profile for Morse
This commit is contained in:
+5
-4
@@ -306,17 +306,18 @@ def start_morse() -> Response:
|
||||
|
||||
can_try_direct_sampling = bool(sdr_device.sdr_type == SDRType.RTL_SDR and freq < 24.0)
|
||||
if can_try_direct_sampling:
|
||||
# Prefer direct2 with explicit squelch-off, then retry with safer variants
|
||||
# if the command starts but never emits PCM.
|
||||
# Cross-platform note: some rtl_fm builds treat "-l 0" as hard squelch and
|
||||
# emit no PCM. Try the no-"-l" form first, then legacy variants.
|
||||
command_attempts = [
|
||||
{'use_direct_sampling': True, 'force_squelch_off': True},
|
||||
{'use_direct_sampling': True, 'force_squelch_off': False},
|
||||
{'use_direct_sampling': True, 'force_squelch_off': True},
|
||||
{'use_direct_sampling': False, 'force_squelch_off': False},
|
||||
{'use_direct_sampling': False, 'force_squelch_off': True},
|
||||
]
|
||||
else:
|
||||
command_attempts = [
|
||||
{'use_direct_sampling': False, 'force_squelch_off': True},
|
||||
{'use_direct_sampling': False, 'force_squelch_off': False},
|
||||
{'use_direct_sampling': False, 'force_squelch_off': True},
|
||||
]
|
||||
|
||||
rtl_process: subprocess.Popen | None = None
|
||||
|
||||
+2
-2
@@ -379,9 +379,9 @@ class TestMorseLifecycleRoutes:
|
||||
assert start_resp.get_json()['status'] == 'started'
|
||||
assert len(popen_cmds) >= 2
|
||||
assert '-E' in popen_cmds[0] and 'direct2' in popen_cmds[0]
|
||||
assert '-l' in popen_cmds[0]
|
||||
assert '-l' not in popen_cmds[0]
|
||||
assert '-E' in popen_cmds[1] and 'direct2' in popen_cmds[1]
|
||||
assert '-l' not in popen_cmds[1]
|
||||
assert '-l' in popen_cmds[1]
|
||||
|
||||
stop_resp = client.post('/morse/stop')
|
||||
assert stop_resp.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user