developersu / ns-usbloader

Awoo Installer and GoldLeaf uploader of the NSPs (and other files), RCM payload injector, application for split/merge files.
GNU General Public License v3.0
1.87k stars 127 forks source link

Failing to claim interface on OSX #2

Closed JKcompute closed 5 years ago

JKcompute commented 5 years ago

Setup : MacOS High Sierra 10.12.4 Switch Version 6.2.0 Atmosphere 0.8.3 NS-USBLoader: 0.2.2 java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

I am able to launch the app, select files, tether my switch (tinfoil says "USB is ready, waiting for header..."). I am only attempting to install one NSP for now, when i hit "upload", i get a failed report. accessing the log i get the following output:

[ INFO ]    Start chain
[ PASS ] libusb initialization
[ PASS ] Get device list
[ PASS ] Read file descriptors for USB devices
[ PASS ] NS in connected USB devices found
[ PASS ] Open NS USB device
[ INFO ] Free device list
[ WARN ] libusb doesn't supports function 'CAP_SUPPORTS_DETACH_KERNEL_DRIVER'. Proceeding.
[ PASS ] Set active configuration to device.
[ FAIL ] Claim interface
  Returned: -99
[ WARN ] Release interface
  Returned: -5 (sometimes it's not an issue)
[ INFO ] Requested handler close
[ INFO ] Requested context close

I have other USB libraries installed from other USB install attempts, from tinfoil, and GoldTreePy. Not sure if that matters.

Any suggestions?
Thanks!

JKcompute commented 5 years ago

i have done some investigation, seems like i really need that CAP_SUPPORTS_DETACH_KERNEL_DRIVER, so that usb4java could detach the USB from some other kernel process. Only thing i could find in the docs is that windows does not support this. Any insight in how to get support for detach? Or what I might do to manually detach before attempting an install?

developersu commented 5 years ago

Oops, sorry for delay. No.. I also always see the message regarding 'CAP_SUPPORTS_DETACH_KERNEL_DRIVER' everywhere. It's different.. and strange. You see that libusb report ERROR_OTHER while trying to claim interface. Will investigate it, but for now no ideas at all.

developersu commented 5 years ago

I have other USB libraries installed from other USB install attempts, from tinfoil, and GoldTreePy. Not sure if that matters.

No, application uses own copy of libusb that stored inside JAR. So you should be good, but:

As I see, if there is a kernel extension installed, it could cause an issue.. Here is what I found And to check it command should be like $ kextstat | grep -i usb. I don't have mac so I'm not an expert at all, but as I understand if when you plugged NS to you mac and new record in this list appeared, then this new records stands for kext configured to be autoloaded. If it's fair, then it may cause an issues inside libusb (oh, libusb is library inside application responsible for USB interactions).

developersu commented 5 years ago

Temporary solution: https://github.com/developersu/ns-usbloader/releases/tag/v0.2.3-DEV Why I can't fix it: https://github.com/usb4java/usb4java/issues/68

developersu commented 5 years ago

Fixed by workaround: switching to lower usb4java version since v0.2.3