Fix direct sampling flag to use portable -E direct2 syntax

The -D flag is only available in newer rtl_fm builds. Docker and distro
packages use the older -E direct / -E direct2 flags instead, which are
universally supported.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-26 08:56:46 +00:00
parent 0bf8341b6c
commit df84c42b8b

View File

@@ -118,7 +118,12 @@ class RTLSDRCommandBuilder(CommandBuilder):
cmd.extend(['-l', str(squelch)])
if direct_sampling is not None:
cmd.extend(['-D', str(direct_sampling)])
# Older rtl_fm builds (common in Docker/distro packages) don't
# support -D; they use -E direct / -E direct2 instead.
if direct_sampling == 1:
cmd.extend(['-E', 'direct'])
elif direct_sampling == 2:
cmd.extend(['-E', 'direct2'])
if bias_t:
cmd.extend(['-T'])