akbl icon indicating copy to clipboard operation
akbl copied to clipboard

[Ubuntu] usb connection error, Resource busy, Entity not found

Open rsm-gh opened this issue 9 years ago • 5 comments

(originally posted by razvan)

Version: alienware-kbl 1.4.8~4 linux: ubuntu 16.04

I'm not sure if it's after an update of this software or an update of drivers or other related libraries, but after I restarted today I started getting this error:

13:44:razvan@alienware:~$
🙰  alienware-kbl
If the daemon is off ignore the following error:
cannot connect: [Errno 111] Connection refused
Runing without daemon.
Fixing bug 84!!
profile added Default
profile added Răzvan
Exception in thread Thread-2:
Traceback (most recent call last):
 File "/usr/share/alienware-kbl/Engine.py", line 130, in Take_over
   self.dev.set_configuration()
 File "/usr/share/alienware-kbl/usb/core.py", line 799, in set_configuration
   self._ctx.managed_set_configuration(self, configuration)
 File "/usr/share/alienware-kbl/usb/core.py", line 128, in managed_set_configuration
   self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
 File "/usr/share/alienware-kbl/usb/backend/libusb1.py", line 730, in set_configuration
   _check(self.lib.libusb_set_configuration(dev_handle.handle, config_value))
 File "/usr/share/alienware-kbl/usb/backend/libusb1.py", line 552, in _check
   raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 16] Resource busy

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
   self.run()
 File "/usr/lib/python3.5/threading.py", line 862, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/share/alienware-kbl/AlienwareKBLGUI", line 732, in ILUMINATE_keyboard
   self.controller.Write_Conf()
 File "/usr/share/alienware-kbl/Engine.py", line 182, in Write_Conf
   self.WaitForOk()
 File "/usr/share/alienware-kbl/Engine.py", line 262, in WaitForOk
   while not self.Get_State():
 File "/usr/share/alienware-kbl/Engine.py", line 270, in Get_State
   self.driver.Take_over()
 File "/usr/share/alienware-kbl/Engine.py", line 132, in Take_over
   self.dev.detach_kernel_driver(0)
 File "/usr/share/alienware-kbl/usb/core.py", line 1005, in detach_kernel_driver
   interface)
 File "/usr/share/alienware-kbl/usb/backend/libusb1.py", line 838, in detach_kernel_driver
   _check(self.lib.libusb_detach_kernel_driver(dev_handle.handle, intf))
 File "/usr/share/alienware-kbl/usb/backend/libusb1.py", line 552, in _check
   raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 2] Entity not found

I don't have any steps to reproduce the bug... it jus started happening. Thanks!

rsm-gh avatar Nov 02 '16 02:11 rsm-gh

Hello razvan,

Thanks for reporting the bug. Sadly I'm going to stop giving support to other distributions (beside Debian) since it is too much time/effort consuming for me.

I hope that someone take the package and adapt it for other distributions, but in case that no one do it I'm going to give you some clues that may help you!

Since pyAlienFx there is a problem when using the python3-usb library and the software needs to be patched by exporting a library before using the software.

If you take a look to /usr/bin/alienware-kbl you will notice that it preloads libusb-1.0.so.0 by using export LD_PRELOAD=/usr/share/alienware-kbl/libusb_patch/libusb-1.0.so.0

That library was taken from Ubuntu a long time ago, and maybe it needs to be updated!

Also since the version 1.4.8~4 I shipped python3-usb with the package. This may cause problems under more recent distributions. Maybe updating the package will help you.

*In case that you think that the problem comes from an update of alienware-kbl you can install an older version from here

I hope it helps you! And sorry again for drooping the "official support"

rsm-gh avatar Nov 02 '16 02:11 rsm-gh

(originally posted by razvan)

Thanks for the answer. Really enjoy your product. I'll see what I can do at my end, but I suppose without a new patched libusb-1.0.so.0 things might be hard :D. This is a bit beyond my understanding, anyway, thanks.

rsm-gh avatar Nov 02 '16 02:11 rsm-gh

I just checked under Ubuntu 16.04 and the software is working good. I'm gonna close this!

rsm-gh avatar Nov 02 '16 03:11 rsm-gh

I'm going to open this as documentation. Also I wonder if we should remove the patch and use the native libusb-1.0.so.0 libraries.

rsm-gh avatar Oct 06 '21 15:10 rsm-gh

This may provide additional help for this problem: https://github.com/rsm-gh/akbl/issues/38#issuecomment-507382411

rsm-gh avatar Oct 06 '21 15:10 rsm-gh