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

libhidapi-hidraw0 disturbing connection.... #17

Open
okushogg opened this issue Apr 24, 2022 · 10 comments
Open

libhidapi-hidraw0 disturbing connection.... #17

okushogg opened this issue Apr 24, 2022 · 10 comments

Comments

@okushogg
Copy link

Traceback (most recent call last):
File "/usr/local/bin/joycontrol-pluginloader", line 5, in
from JoycontrolPlugin.loader import main
File "/usr/local/lib/python3.8/dist-packages/JoycontrolPlugin/init.py", line 1, in
from JoycontrolPlugin.commands import JoycontrolCommands
File "/usr/local/lib/python3.8/dist-packages/JoycontrolPlugin/commands.py", line 5, in
from joycontrol.controller_state import button_push, button_press, button_release
File "/usr/local/lib/python3.8/dist-packages/joycontrol/controller_state.py", line 3, in
from joycontrol import utils
File "/usr/local/lib/python3.8/dist-packages/joycontrol/utils.py", line 5, in
import hid
File "/usr/local/lib/python3.8/dist-packages/hid/init.py", line 83, in
hidapi.hid_get_input_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t]
File "/usr/lib/python3.8/ctypes/init.py", line 386, in getattr
func = self.getitem(name)
File "/usr/lib/python3.8/ctypes/init.py", line 391, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib/x86_64-linux-gnu/libhidapi-hidraw.so.0: undefined symbol: hid_get_input_report

Can anyone solve this problem plz??

@EggEngineer
Copy link

Having the same, if not, very similar issue with libhidapi-hidraw.so.0; reinstalling the shared library did not help nor rebooting the PC. Seems it's something either in the setup that went funky or somewhere along the lines there's a corrupt file. Maybe try the no-pair (changes are different in the ExecStart) mode. It is experimental however, so do be warned.

Here's my crash log:

File "run_controller_cli.py", line 11, in <module> from joycontrol import logging_default as log, utils File "/home/b567/jctrl/joycontrol/utils.py", line 5, in <module> import hid File "/usr/local/lib/python3.8/dist-packages/hid/__init__.py", line 83, in <module> hidapi.hid_get_input_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t] File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /lib/x86_64-linux-gnu/libhidapi-hidraw.so.0: undefined symbol: hid_get_input_report

Wonder what could be the issue with this specific shared library file that we're both having...

@allenz92
Copy link

Traceback (most recent call last): File "/usr/local/bin/joycontrol-pluginloader", line 5, in from JoycontrolPlugin.loader import main File "/usr/local/lib/python3.8/dist-packages/JoycontrolPlugin/init.py", line 1, in from JoycontrolPlugin.commands import JoycontrolCommands File "/usr/local/lib/python3.8/dist-packages/JoycontrolPlugin/commands.py", line 5, in from joycontrol.controller_state import button_push, button_press, button_release File "/usr/local/lib/python3.8/dist-packages/joycontrol/controller_state.py", line 3, in from joycontrol import utils File "/usr/local/lib/python3.8/dist-packages/joycontrol/utils.py", line 5, in import hid File "/usr/local/lib/python3.8/dist-packages/hid/init.py", line 83, in hidapi.hid_get_input_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t] File "/usr/lib/python3.8/ctypes/init.py", line 386, in getattr func = self.getitem(name) File "/usr/lib/python3.8/ctypes/init.py", line 391, in getitem func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /lib/x86_64-linux-gnu/libhidapi-hidraw.so.0: undefined symbol: hid_get_input_report

Can anyone solve this problem plz??

Have you find out how to solve this? I have the same issue with Raspbian 4B.

@okushogg
Copy link
Author

okushogg commented Apr 27, 2022

Just for First Aid.
I did change the version of hid into "1.0.4" .

pip install hid==1.0.4

But it is not a fundamental solution...

@Larkas
Copy link

Larkas commented May 2, 2022

It seems that this is a problem with libhidapi-hidraw0 specifically. When I try to import it in python, it throws this error:
>>> import hid Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.8/dist-packages/hid/__init__.py", line 83, in <module> hidapi.hid_get_input_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t] File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /lib/x86_64-linux-gnu/libhidapi-hidraw.so.0: undefined symbol: hid_get_input_report
@okushogg has a working workaround, it seems, but, as they said, it's not a real fix.

@darrenchang
Copy link

darrenchang commented May 28, 2022

Hi, it's possible that you have an old libhidapi-hidraw version installed. I think Ubuntu 20.04 has versoin 0.8.0..., while 22.04 has a newer libhidapi version that doesn't cause this issue with hid_get_input_report.

My solution to this problem is to compile my own libhidapi-hidraw.so.0 file from the source.

Here is how I did it:

  1. Install build tools if you don't already have them

    apt-get update; \
    apt-get install -y \
    build-essential \
    libudev-dev \
    libusb-1.0-0-dev;
  2. Compile the file libhidapi-hidraw.so.0 and install it (put it where it needs to be). If you are on a different architecture
    than ARMv6, make sure to change the part of the dir path arm-linux-gnueabihf to match your architecture.

    git clone --branch hidapi-0.11.2 https://github.com/libusb/hidapi.git; \
    (cd hidapi/linux/; \
    make -f Makefile-manual; \
    cp libhidapi-hidraw.so /usr/lib/arm-linux-gnueabihf/libhidapi-hidraw.so.0;); \
    rm -r hidapi;)

@mjlhcf
Copy link

mjlhcf commented Sep 11, 2022

Having the same, if not, very similar issue with libhidapi-hidraw.so.0; reinstalling the shared library did not help nor rebooting the PC. Seems it's something either in the setup that went funky or somewhere along the lines there's a corrupt file. Maybe try the no-pair (changes are different in the ExecStart) mode. It is experimental however, so do be warned.

Here's my crash log:

File "run_controller_cli.py", line 11, in <module> from joycontrol import logging_default as log, utils File "/home/b567/jctrl/joycontrol/utils.py", line 5, in <module> import hid File "/usr/local/lib/python3.8/dist-packages/hid/__init__.py", line 83, in <module> hidapi.hid_get_input_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t] File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /lib/x86_64-linux-gnu/libhidapi-hidraw.so.0: undefined symbol: hid_get_input_report

Wonder what could be the issue with this specific shared library file that we're both having...

I have the same problem, the error code is exactly the same, how did you solve it, please?

@Cryspia
Copy link

Cryspia commented Sep 21, 2022

hid 1.0.5 introduced the new symbol that is not yet supported by the old dynamic library.
Try:

pip uninstall hid
pip install hid==1.0.4

@HunterBoy344
Copy link

@Cryspia This did not solve the problem and I am getting the same error

@yoyotam3
Copy link

yoyotam3 commented Oct 20, 2022

None of these solutions seem to work for me
EDIT: nevermind it worked after rebooting

@themarpe
Copy link

Might make sense relying on hidapi package from trezor instead - it packages the hidapi library in the wheels, so there won't be any discrepancy between system and python libs.

(Just went through the whole hurdle with this as well, for another library. One issue is that both hid & hidapi packages have the same import hid)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants