xow icon indicating copy to clipboard operation
xow copied to clipboard

xow.service does not alway launch properly at boot, LIBUSB_ERROR_ACCESS

Open StefanLobbenmeier opened this issue 3 years ago • 15 comments

I use the xow.service so that I do not have to worry about having to launch xow in the terminal everytime before I start a game.

Anyway, once or twice a week the xow service does not boot up. I checked the logs and I found this:

-- Boot 44fb83db6cd84e0cbc8ca6983ee735d0 --
Jan 16 07:40:06 stefan-manjaro systemd[1]: Started Xbox One Wireless Dongle Driver.
Jan 16 07:40:07 stefan-manjaro xow[421]: 2021-01-16 07:40:07 INFO  - xow  ©Severin v. W.
Jan 16 07:40:07 stefan-manjaro xow[421]: 2021-01-16 07:40:07 INFO  - Waiting for device...
Jan 16 07:40:07 stefan-manjaro xow[421]: terminate called after throwing an instance of 'UsbException'
Jan 16 07:40:07 stefan-manjaro xow[421]:   what():  Error opening device: LIBUSB_ERROR_ACCESS
Jan 16 07:40:07 stefan-manjaro systemd[1]: xow.service: Main process exited, code=dumped, status=6/ABRT
Jan 16 07:40:07 stefan-manjaro systemd[1]: xow.service: Failed with result 'core-dump'.

StefanLobbenmeier avatar Jan 16 '21 17:01 StefanLobbenmeier

Is there a way to get further logs than this? I used journalctl -u xow.service to get those logs

StefanLobbenmeier avatar Jan 16 '21 17:01 StefanLobbenmeier

Is there a way to get further logs than this? I used journalctl -u xow.service to get those logs

@StefanLobbenmeier Probably not. That error code is coming directly from libusb. I wonder if this problem could be avoided by starting the service after the dongle is plugged in (there are two PRs for that).

medusalix avatar Jan 22 '21 18:01 medusalix

I see, do you mean physically plugged in or „plugged in“ by the kernel~

Because it would be really nice if I could always leave the adapter plugged in. I am doing that at the moment.

StefanLobbenmeier avatar Jan 22 '21 20:01 StefanLobbenmeier

I noticed this issue too, I have to unplug and then plug the dongle to make it work

Hedronmx avatar Mar 13 '21 03:03 Hedronmx

@Hedronmx you have to plug out and plugin the dongle in addition to restarting the service?

StefanLobbenmeier avatar Mar 13 '21 23:03 StefanLobbenmeier

Nevermind!! I had some issues with usb hub bandwidth! Seems to be working fine just now

Hedronmx avatar Mar 14 '21 03:03 Hedronmx

Happening for me with latest source on Linux 5.11.7-arch1-1 x86_64.

With dongle already inserted in PC, service fails to start at boot on a regular basis. Manually starting service after failure is always successful. Same log output as OP.

I have tried the dongle on various USB buses and the issue still occurs. libusb version 1.0.24-21

mundifex avatar Mar 23 '21 03:03 mundifex

@mundifex Could you try if https://github.com/medusalix/xow/pull/156 solves the problem for you? If it does, one of the PRs should be merged that activate the xow service on udev event.

kakra avatar Mar 23 '21 12:03 kakra

@mundifex Could you try if #156 solves the problem for you? If it does, one of the PRs should be merged that activate the xow service on udev event.

Your PR has resolved the issue for me. I performed 10 reboots and the xow service started automatically and successfully each and every time. The controller was in varying states of off, connecting, and connected. I verified connection with sdl2-jstest a few times and everything works like I'd expect.

Thanks so much for your PR and your advice!

mundifex avatar Mar 24 '21 04:03 mundifex

Thanks! I cannot reproduce for some time so I will close it and try #156 in a few weeks, since the issue of @mundifex match my issue.

StefanLobbenmeier avatar Mar 24 '21 11:03 StefanLobbenmeier

Is closing this issue the best decision? Until https://github.com/medusalix/xow/pull/156 gets merged, the error persists and I'd rather close this issue only if and when the PR gets merged.

mundifex avatar Mar 24 '21 17:03 mundifex

No it's not. It's better if the commit that fixes it has a "Closes" github tag.

kakra avatar Mar 24 '21 18:03 kakra

Oh Sorry, will wait for the merge

StefanLobbenmeier avatar Mar 24 '21 19:03 StefanLobbenmeier

I am also experiencing the same error on kernel 5.11.16. #156 doesn't appear to fix this issue in my case although I only modified my current install with the udev and service file changes.

EDIT: Looks like the patch does work. I forgot to run systemctl disable xow to prevent the service from starting at boot up and failing.

alkazar avatar May 01 '21 13:05 alkazar

Today I had a different issue:

Jun 13 21:01:22 stefan-manjaro systemd[1]: Started Xbox One Wireless Dongle Driver.
Jun 13 21:01:28 stefan-manjaro xow[488]: 2021-06-13 21:01:28 INFO  - xow  ©Severin v. W.
Jun 13 21:01:28 stefan-manjaro xow[488]: 2021-06-13 21:01:28 INFO  - Waiting for device...
Jun 13 21:01:29 stefan-manjaro xow[488]: 2021-06-13 21:01:29 ERROR - Error in control transfer: LIBUSB_ERROR_TIMEOUT
Jun 13 21:01:29 stefan-manjaro xow[488]: 2021-06-13 21:01:29 ERROR - Firmware part loading timed out
Jun 13 21:01:29 stefan-manjaro xow[488]: 2021-06-13 21:01:29 ERROR - Failed to write ILM
Jun 13 21:01:29 stefan-manjaro xow[488]: terminate called after throwing an instance of 'Mt76Exception'
Jun 13 21:01:29 stefan-manjaro xow[488]:   what():  Failed to load firmware
Jun 13 21:01:29 stefan-manjaro systemd[1]: xow.service: Main process exited, code=dumped, status=6/ABRT

Is it related or should I open a new issue?

StefanLobbenmeier avatar Jun 13 '21 20:06 StefanLobbenmeier