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 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-27 14:44:17 +00:00
parent 7af6d45ca1
commit fb064a22fb

View File

@@ -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(