Skip to content

set_vibration lock after 16 uses giving "no space left on device" #109

@Krayfighter

Description

@Krayfighter

the following code works

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions