ToadKing / wii-u-gc-adapter

Tool for using the Wii U GameCube Adapter on Linux
MIT License
241 stars 44 forks source link

libusb_interrupt_transfer error (fixes itself after restart) #39

Open tonyrh opened 5 years ago

tonyrh commented 5 years ago

I have a cheap clone of the adapter attached to a raspberry pi 2. I've enabled a systemd service to start wii-gc-adapter when booting retropie. Everything is fine, but I first have to restart wii-gc-adapter once, otherwise it won't work. Logs show the adapter connected and a libusb_interrupt_transfer error immediately thereafter:

$ journalctl -u gamecube.service 
Oct 14 21:39:19 retropie systemd[1]: Started Wii U Gamecube Adapter.
Oct 14 21:39:19 retropie wii-u-gc-adapter[353]: Detaching kernel driver
Oct 14 21:39:19 retropie wii-u-gc-adapter[353]: adapter 0x0x7d1f70 connected
Oct 14 21:39:19 retropie wii-u-gc-adapter[353]: libusb_interrupt_transfer error -8
Oct 14 21:40:55 retropie wii-u-gc-adapter[353]: adapter 0x0x7d1f70 disconnected
Oct 14 21:40:55 retropie systemd[1]: Stopping Wii U Gamecube Adapter...
Oct 14 21:40:55 retropie systemd[1]: Stopped Wii U Gamecube Adapter.
Oct 14 21:40:55 retropie systemd[1]: Started Wii U Gamecube Adapter.
Oct 14 21:40:55 retropie wii-u-gc-adapter[620]: adapter 0x0x17bd3b0 connected
Oct 14 21:40:55 retropie wii-u-gc-adapter[620]: connecting on port 0

At 21:40:55 I restart the service. Doing so changes the adapter "id" (address? I don't know what that is...) without physically disconnecting the controller or the adapter from the pi. Everything works fine after this point.

I also get this in the logs on starting and restarting wii-gc-adapter, don't know if it's relevant:

Oct 14 21:39:19 retropie kernel: [    6.515853] usb 1-1.4: usbfs: process 360 (wii-u-gc-adapte) did not claim interface 0 before use
Oct 14 21:40:55 retropie kernel: [   86.257971] usb 1-1.4: usbfs: process 625 (wii-u-gc-adapte) did not claim interface 0 before use

Portion of kernel log relevant to the adapter:

Oct 15 09:45:09 retropie kernel: [    2.712549] usb 1-1.4: new full-speed USB device number 5 using dwc_otg
Oct 15 09:45:09 retropie kernel: [    2.848730] usb 1-1.4: New USB device found, idVendor=057e, idProduct=0337
Oct 15 09:45:09 retropie kernel: [    2.848783] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 15 09:45:09 retropie kernel: [    2.848803] usb 1-1.4: Product: WUP-028
Oct 15 09:45:09 retropie kernel: [    2.848813] usb 1-1.4: Manufacturer: Nintendo Co., Ltd.
Oct 15 09:45:09 retropie kernel: [    2.848824] usb 1-1.4: SerialNumber: 15/07/2014
Oct 15 09:45:09 retropie kernel: [    2.866044] hid-generic 0003:057E:0337.0004: hiddev97,hidraw3: USB HID v1.10 Device [Nintendo Co., Ltd. WUP-028] on usb-3f980000.usb-1.4/input0

Anyway, I've mitigated the issue by scheduling a restart of wii-u-gc-adapter on every boot after a 30 seconds delay. I'm still curious about this, so if anyone have any insight on how to fix it I'd like to hear it.