From df84c42b8ba31868d4ea0970e1f886405c0613af Mon Sep 17 00:00:00 2001 From: Smittix Date: Thu, 26 Feb 2026 08:56:46 +0000 Subject: [PATCH] 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 --- utils/sdr/rtlsdr.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/sdr/rtlsdr.py b/utils/sdr/rtlsdr.py index 36f27d3..3cede61 100644 --- a/utils/sdr/rtlsdr.py +++ b/utils/sdr/rtlsdr.py @@ -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'])