mirror of
https://github.com/smittix/intercept.git
synced 2026-07-24 00:48:11 -07:00
Fix dsd-fme audio output flag and add pipeline error diagnostics
Use -o - (stdout) instead of -o /dev/null for audio output, as dsd-fme expects specific output targets. Remove -N flag which may cause issues in headless mode. Add stderr capture on pipeline failure for better error messages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+15
-8
@@ -264,14 +264,12 @@ def start_dmr() -> Response:
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Build DSD command
|
# Build DSD command
|
||||||
dsd_cmd = [dsd_path]
|
# Use -o - to send decoded audio to stdout (piped to DEVNULL)
|
||||||
|
# instead of PulseAudio which may not be available under sudo
|
||||||
|
dsd_cmd = [dsd_path, '-i', '-', '-o', '-']
|
||||||
if is_fme:
|
if is_fme:
|
||||||
# dsd-fme: -N disables ncurses (required for stdin pipe),
|
|
||||||
# -o /dev/null suppresses PulseAudio audio output
|
|
||||||
dsd_cmd.extend(['-N', '-i', '-', '-o', '/dev/null'])
|
|
||||||
dsd_cmd.extend(_DSD_FME_PROTOCOL_FLAGS.get(protocol, []))
|
dsd_cmd.extend(_DSD_FME_PROTOCOL_FLAGS.get(protocol, []))
|
||||||
else:
|
else:
|
||||||
dsd_cmd.extend(['-i', '-', '-o', '/dev/null'])
|
|
||||||
dsd_cmd.extend(_DSD_PROTOCOL_FLAGS.get(protocol, []))
|
dsd_cmd.extend(_DSD_PROTOCOL_FLAGS.get(protocol, []))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -293,12 +291,21 @@ def start_dmr() -> Response:
|
|||||||
|
|
||||||
time.sleep(0.3)
|
time.sleep(0.3)
|
||||||
|
|
||||||
if dmr_rtl_process.poll() is not None or dmr_dsd_process.poll() is not None:
|
rtl_rc = dmr_rtl_process.poll()
|
||||||
# Process died
|
dsd_rc = dmr_dsd_process.poll()
|
||||||
|
if rtl_rc is not None or dsd_rc is not None:
|
||||||
|
# Process died — capture stderr for diagnostics
|
||||||
|
dsd_err = ''
|
||||||
|
if dmr_dsd_process.stderr:
|
||||||
|
dsd_err = dmr_dsd_process.stderr.read().decode('utf-8', errors='replace')[:500]
|
||||||
|
logger.error(f"DSD pipeline died: rtl_fm rc={rtl_rc}, dsd rc={dsd_rc}, dsd stderr={dsd_err!r}")
|
||||||
if dmr_active_device is not None:
|
if dmr_active_device is not None:
|
||||||
app_module.release_sdr_device(dmr_active_device)
|
app_module.release_sdr_device(dmr_active_device)
|
||||||
dmr_active_device = None
|
dmr_active_device = None
|
||||||
return jsonify({'status': 'error', 'message': 'Failed to start DSD pipeline'}), 500
|
msg = 'Failed to start DSD pipeline'
|
||||||
|
if dsd_err:
|
||||||
|
msg += f': {dsd_err.strip()}'
|
||||||
|
return jsonify({'status': 'error', 'message': msg}), 500
|
||||||
|
|
||||||
dmr_running = True
|
dmr_running = True
|
||||||
dmr_thread = threading.Thread(
|
dmr_thread = threading.Thread(
|
||||||
|
|||||||
Reference in New Issue
Block a user