Skip to content
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

[Bug] USB exception: [Errno 16] Resource busy #284

Closed
DreamDevourer opened this issue Jan 31, 2021 · 15 comments
Closed

[Bug] USB exception: [Errno 16] Resource busy #284

DreamDevourer opened this issue Jan 31, 2021 · 15 comments
Assignees
Labels
bug Something isn't working cannot reproduce linux

Comments

@DreamDevourer
Copy link

When connecting the USB-C with tinfoil opened in the Switch error 16 shows up:

USB Connected
usb exception: [Errno 16] Resource busy

To Reproduce

Steps to reproduce the behaviour:

  1. Open Tinfoil in the gallery or using "R" in a game with full Horizon memory use
  2. Connect USB-C to the PC (in this case Debian-based distro Linux)
  3. Open NUT_GUI.py
  4. Observe the error happening in the terminal and Tinfoil crashing.

Expected behaviour

Switch should connect without problems in NUT.

Screenshots

https://ibb.co/c8j239x

NUT version (or git hash):

  • Nut: [e.g. v3.0]
@DreamDevourer DreamDevourer added the bug Something isn't working label Jan 31, 2021
@introkun
Copy link
Collaborator

introkun commented Feb 1, 2021

@DreamDevourer have you tried this (from the Readme):

(Linux only) Add the following code snippet to /etc/udev/rules.d/99-switch.rules using your favorite editor.

SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="27e2", GROUP="plugdev"

@introkun introkun added the linux label Feb 1, 2021
@DreamDevourer
Copy link
Author

Yes, it's there. Also I tried to install the requirements_dev with pip3, but did not work for some reason.

@DreamDevourer
Copy link
Author

All the dependencies are already installed.

@introkun introkun self-assigned this Feb 1, 2021
@introkun
Copy link
Collaborator

introkun commented Feb 1, 2021

@DreamDevourer what's switch OS version? tinfoil version?

@introkun
Copy link
Collaborator

introkun commented Feb 1, 2021

Have you tried rebooting Switch? Have you tried to unplug/plug the cable?

@introkun introkun linked a pull request Feb 1, 2021 that will close this issue
@introkun
Copy link
Collaborator

introkun commented Feb 1, 2021

@DreamDevourer could you please try my code from the PR #288 ?

@DreamDevourer
Copy link
Author

I did not disconnected the USB cable, also I tried using Quark from Goldleaf project and that worked pretty well... But I want to use Nut it's much better for what I want.

Switch Horizon version: 10.0.4
Using atmosphere 17.0|S
Tinfoil (LITHIUM) from this repo Blawar Version 11.00

@introkun
Copy link
Collaborator

introkun commented Feb 1, 2021

@DreamDevourer any luck with my PR?

@blawar
Copy link
Owner

blawar commented Feb 1, 2021

@DreamDevourer can you try disabling MTP in tinfoil options, then restarting Tinfoil and try.

@gabrielmocan
Copy link

gabrielmocan commented Apr 19, 2021

I'm having the same issue here. It's happening after upgrading Switch firmware from 10.0.3 to 11.0.0 and Tinfoil from release 8 to release 12. Running Ubuntu 20.04 LTS, Switch firmware 11.0.0 with SXOS 3.1.0 and NUT 3.1, all python3 dependencies updated.

@gabrielmocan
Copy link

Also, on Windows machine, using NUT 3.1, I'm able to connect to the Switch but NSP files shows as "0.0 B" and when I try to install them, an error message pops up saying that there's an error when trying to open the NSP file, although the files are OK.

@blawar
Copy link
Owner

blawar commented Apr 19, 2021

Also, on Windows machine, using NUT 3.1, I'm able to connect to the Switch but NSP files shows as "0.0 B" and when I try to install them, an error message pops up saying that there's an error when trying to open the NSP file, although the files are OK.

Can you try installing it via usbfs instead of usb, and see if that works?

@cosmosis14
Copy link

I am having this same problem. I tried using the code from PR #288 as suggested by @introkun... It didn't help. However, disabling MTP has stopped the crash, but I still could not access the files on the computer (errno 13 access denied insufficient permissions). After running nut as sudo in a python virtual environment, I was able to get it to work. I hope this can help someone else.

I'm running the latest version of nut and tinfoil, ubuntu 20.04, 12.0.2 switch firmware, and atmosphere 0.19.3.

@emfrost
Copy link

emfrost commented Jun 22, 2021

I actually got around this issue. I'm using Lithium instead of Tinfoil, but it looks like the Switch changes device IDs during the connection process. I had to duplicate the udev rule for 057e:2000 and 16c0:27e2. Also, Arch (and Arch-based) distros do not have a plugdev group, so I changed the group to wheel instead, but you can use any arbitrary group your user is a member of.

So /etc/udev/rules.d/99-switch.conf file looks like this.

SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", GROUP="wheel"
SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2000", GROUP="wheel"
SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="27e2", GROUP="wheel"

Don't forget to reload the rules (udevadm control --reload) to make them take effect. It works fine with MTP disabled.

@ghost
Copy link

ghost commented Aug 9, 2021

Consolidating issues, follow #314 if still a problem

@ghost ghost closed this as completed Aug 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cannot reproduce linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants