Ryochan7 / sc-controller

User-mode driver and GTK3 based GUI for Steam Controller
GNU General Public License v2.0
177 stars 23 forks source link

Fix Evdev and HID driver crash after bd758c0 #55

Closed Alastor27 closed 2 years ago

Alastor27 commented 2 years ago

Since bd758c0 the evdev driver crashes and it's flooding the console with the error seen below, which prevents the proper mapping of the DualShock 4 controller with a bluetooth connection. The HID driver crashes for a similar reason too, when the controller is plugged in via USB, so I've made some changes there too. These are fixed the issue for me, everything works as expected, but I could only test it with a DualShock 4 v2 controller.

E Mapper        Error while processing controller event
E Mapper        Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/scc/mapper.py", line 398, in input
    self.profile.gyro.gyro(self, state.gpitch, state.gyaw, state.groll, state.q1, state.q2, state.q3, state.q4)
  File "/usr/lib/python3.10/site-packages/scc/modifiers.py", line 1082, in gyro
    return sel.gyro(mapper, pitch, yaw, roll, *q)
  File "/usr/lib/python3.10/site-packages/scc/special_actions.py", line 764, in gyro
    -mapper.state.accel_x / CemuHookAction.ACC_RES_PER_G, # AccelX
AttributeError: 'EvdevControllerInput' object has no attribute 'accel_x'
Ryochan7 commented 2 years ago

Catching up on the pull requests. Thank you for the fixes. The initial change was made with only the Steam Controller in mind.