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

Failure on macOS, M1 #40

Open
UEFI-code opened this issue Jan 7, 2023 · 4 comments
Open

Failure on macOS, M1 #40

UEFI-code opened this issue Jan 7, 2023 · 4 comments

Comments

@UEFI-code
Copy link

UEFI-code commented Jan 7, 2023

I'm trying on my M1 Mac, and got error out of index. I guess some hid data were missing

Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydualsense
>>> obj = pydualsense.pydualsense()
>>> obj.init()
>>> Exception in thread Thread-1 (sendReport):
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/pydualsense/pydualsense.py", line 216, in sendReport
    self.readInput(inReport)
  File "/opt/homebrew/lib/python3.10/site-packages/pydualsense/pydualsense.py", line 262, in readInput
    misc2 = states[10]
IndexError: list index out of range

>>> obj.device.get_product_string()
'DualSense Wireless Controller'
>>> data = obj.device.read(64)
>>> data
b'\x01\x80~\x7f~\x08\x00\x08\x00\x00'
@flok
Copy link
Owner

flok commented Jan 10, 2023

I dont have an arm device to test. but it seems like the hidapi works diffrent in the m1.

how did you install the hidapi?

@UEFI-code
Copy link
Author

UEFI-code commented Jan 11, 2023 via email

@flok
Copy link
Owner

flok commented Jan 14, 2023

This is weird. Could you change the source and output the states list with a print ?

@UEFI-code
Copy link
Author

UEFI-code commented Jan 19, 2023

I think I set the verbose to True it will print something.

>>> import pydualsense
>>> obj = pydualsense.pydualsense(True)
>>> obj.init()
>>> 2023-01-19 11:00:42,754 b'\x01\x7f~\x80\x80\x08\x00\x00\x00\x00'
Exception in thread Thread-1 (sendReport):
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/pydualsense/pydualsense.py", line 216, in sendReport
    self.readInput(inReport)
  File "/opt/homebrew/lib/python3.10/site-packages/pydualsense/pydualsense.py", line 268, in readInput
    self.state.trackPadTouch0.ID = inReport[33] & 0x7F
IndexError: index out of range

Hidapi on m1 output data less then other platform

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

2 participants