From fb064a22fb33a85c434b40f14dcbca3b083c2b5e Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 27 Feb 2026 14:44:17 +0000 Subject: [PATCH] fix: add delay after probe to prevent USB claim race with dump1090 rtl_test opens the USB device during probing. After killing the process, the kernel may not release the USB interface immediately. dump1090 then fails with usb_claim_interface error -6. Add a 0.5s delay after probe cleanup to allow the kernel to fully release the device before the actual decoder opens it. Co-Authored-By: Claude Opus 4.6 --- utils/sdr/detection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/sdr/detection.py b/utils/sdr/detection.py index f00eb7d..2f90d3f 100644 --- a/utils/sdr/detection.py +++ b/utils/sdr/detection.py @@ -465,6 +465,10 @@ def probe_rtlsdr_device(device_index: int) -> str | None: except OSError: pass proc.wait() + if device_found: + # Allow the kernel to fully release the USB interface + # before the caller opens the device with dump1090/rtl_fm/etc. + time.sleep(0.5) if error_found: logger.warning(