You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import inputs
from time import sleep
controller = inputs.devices.gamepads[0]
for i in range(16):
controller.set_vibration(0, 1, 100)
sleep(.1)
so long as the range is less than 17
otherwise, is will give the following stack trace
Traceback (most recent call last):
File "", line 1, in
File "/home/aidenk/.local/lib/python3.10/site-packages/inputs.py", line 2983, in set_vibration
self._set_vibration_nix(left_motor, right_motor, duration)
File "/home/aidenk/.local/lib/python3.10/site-packages/inputs.py", line 2969, in _set_vibration_nix
code = self.__get_vibration_code(left_motor, right_motor, duration)
File "/home/aidenk/.local/lib/python3.10/site-packages/inputs.py", line 2963, in __get_vibration_code
buf_conts = ioctl(self._write_device, 1076905344, inner_event)
OSError: [Errno 28] No space left on device
this work inside and outside of a loop, and for the duration of the process' lifetime, limiting the number of calls to this function to 16 for the entire program runtime
I also noticed that if I had 2 python instances open, I could use all the the 16 function calls in the first, and the second would be unable to call the function, giving the same stack trace.
my system:
Operating System: Fedora Linux 35
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.2
Kernel Version: 5.19.6-100.fc35.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Framework
Product Name: Laptop
System Version: A3
Python 3.10.6
inputs 0.5
The text was updated successfully, but these errors were encountered:
The reason why this is happening is because the set_vibration method actually writes the effect to the gamepad when called. Your gamepad probably has 16 slots for effects. After calling it 16 times, there is no more space to store another effect. This library is unmaintained, but you can address it for yourself by splitting out the writing of the effect into its own method that is called only once.
the following code works
so long as the range is less than 17
otherwise, is will give the following stack trace
this work inside and outside of a loop, and for the duration of the process' lifetime, limiting the number of calls to this function to 16 for the entire program runtime
I also noticed that if I had 2 python instances open, I could use all the the 16 function calls in the first, and the second would be unable to call the function, giving the same stack trace.
my system:
Operating System: Fedora Linux 35
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.2
Kernel Version: 5.19.6-100.fc35.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: Framework
Product Name: Laptop
System Version: A3
Python 3.10.6
inputs 0.5
The text was updated successfully, but these errors were encountered: