-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HackRF one not working on some USB ports (Linux) #783
Comments
Does |
Yes, after taking a look at
I don't really know what that means, I'll try to get more info to understand the issue. |
@ktemkin any ideas on this? you usually know about weird xhci errors :) |
I can confirm, exact same issue here. uname -a Tried with fw version 2017.02.1 and 2018.01.1 There's an issue regarding Ubuntu kernel 4.20+, I don't know if it's related https://bugzilla.kernel.org/show_bug.cgi?id=202541 Edit: |
I usually see this error when a device suddenly changes connected/disconnected state in a way the host doesn't expect. Usually, it's because of EMI (e.g. from a bad cable), but here it looks like there might actually be a chipset bug that might need a kernel quirk. Either way, it's possible this is related to high-throughput USB devices; but doesn't seem likely to be something that's an issue on the HackRF side. |
Interestingly, killing This's what happens when you
Subsequent attempts to run it will now give the following:
|
I think I found the issue., or at least a workaround I don't know why though, my guess is it's really in the kernel, since HackRF behavior is the same on a system that cause no issue. This is caused because when the program is stopped, you have the following event:
On a system which does not cause issue, that call to libusb_submit_transfer() when the transfer thread is terminated does not seem to bother. Here I show when is logged with 3 callback, following libusb_submit_transfer() when the transfer thread is terminated (I put some sleep to help be debug in the callback): First callback: [46873.599396] xhci_hcd 0000:00:14.0: Transfer error for slot 12 ep 2 on endpoint 2nd callback [46875.600001] xhci_hcd 0000:00:14.0: Transfer error for slot 12 ep 2 on endpoint 3rd callback [46877.600571] xhci_hcd 0000:00:14.0: Transfer error for slot 12 ep 2 on endpoint Then closing libusb does not cause any further log. On a system which cause issue, that call seem to make the kernel go in a strange state. First callback: [68492.952815] xhci_hcd 0000:02:00.0: Transfer error for slot 79 ep 2 on endpoint 2nd callback: 3rd callback: hackrf_close(): [68498.956918] xhci_hcd 0000:02:00.0: Cancel URB 00000000fc8857f7, dev 10, ep 0x81, starting at offset 0xfff1f8c0 hackrf_exit(): [68498.957057] xhci_hcd 0000:02:00.0: Finding endpoint context Then the device is unusable until reset. As a workaround, make sure that the transfer callback thread does not call libusb_submit_transfer() if in the process if terminating. In hackrf_libusb_transfer_callback(), do not submit transfer if transfer thread is not started:
Eric |
To add... Alternatively, to be in line with other place in the code, the check should probably be if( device->do_exit != false ) Edit:
|
Added more info on kernel thread https://bugzilla.kernel.org/show_bug.cgi?id=202541#c137 |
Hi,
In my case it was ASUS B550, so it may be related to this family of chipsets, or to the manufacturer itself. |
I have a mistake too, connection drops at all USB-ports
but if I use VirtualBox with OS LINUX(pentoo-full-amd64-hardened-2021.0_p20210402) or Windows 7 and pass the USB with hackrfOne the error does not occur. The HarkFR one device works stably
|
libhackrf.so.0.6.0 -- fix my problem
|
@koparebu are you still experiencing this issue? |
I'm going to close this as there hasn't been a response in a while, but please re-open this issue or open a new one if you still need assistance. |
Hi,
I've been using HackRF in a new Linux computer, and I found out that it doesn't work correctly when it is plugged to certain USB ports (the most "modern" USB ports in the motherboard). I don't have other different SDR devices to test these ports, but at least for USB mass storage and HID they seem to work OK.
While HackRF works at first (eg:
hackrf_transfer
, or running a GRC flowchart), if I stop it and try to launch the same command/flowchart again, it doesn't work anymore. I have to disconnect HackRF and plug it in again. If I plug it into the other USB ports, it works without issues any number of times without having to disconnect it.If there is something else that I could provide to diagnose the problem and know if its related to the HackRF drivers itself, or to the operating system, I'd be glad to do it. Thanks a lot!
Steps to reproduce
hackrf_transfer
and stop it after a whilehackrf_transfer
againExpected behaviour
Behaviour from (3) should be the the same as (2)
Actual behaviour
The program doesn't transmit anything. It exits. Here's the output:
Version information
Operating system: Ubuntu 20.04.1, kernel 5.4
hackrf package: 2018.01.1-2 (everything SDR related has been installed from the official Ubuntu repositories)
hackrf_info output:
The text was updated successfully, but these errors were encountered: