From 67fa196a2832df036ca8554a42d41dccc6710100 Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 6 Feb 2026 15:44:31 +0000 Subject: [PATCH] Fix DSD voice decoder detection for dsd-fme and PulseAudio error Check for dsd-fme binary (common fork) before falling back to dsd. Disable audio output with -o /dev/null to prevent PulseAudio connection failures when running under sudo. Co-Authored-By: Claude Opus 4.6 --- routes/dmr.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/routes/dmr.py b/routes/dmr.py index c8b177e..fe42f6b 100644 --- a/routes/dmr.py +++ b/routes/dmr.py @@ -55,8 +55,11 @@ PROTOCOL_FLAGS = { def find_dsd() -> str | None: - """Find DSD (Digital Speech Decoder) binary.""" - return shutil.which('dsd') + """Find DSD (Digital Speech Decoder) binary. + + Checks for dsd-fme first (common fork), then falls back to dsd. + """ + return shutil.which('dsd-fme') or shutil.which('dsd') def find_rtl_fm() -> str | None: @@ -241,8 +244,8 @@ def start_dmr() -> Response: '-l', '1', # squelch level ] - # Build DSD command - dsd_cmd = [dsd_path, '-i', '-'] + # Build DSD command (-o /dev/null to avoid PulseAudio dependency) + dsd_cmd = [dsd_path, '-i', '-', '-o', '/dev/null'] dsd_cmd.extend(PROTOCOL_FLAGS.get(protocol, [])) try: