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

OSError: [Errno 5] Input/output error #205

Open
Zeker2908 opened this issue Mar 6, 2023 · 3 comments
Open

OSError: [Errno 5] Input/output error #205

Zeker2908 opened this issue Mar 6, 2023 · 3 comments

Comments

@Zeker2908
Copy link

ds4drv --hidraw
[info][controller 1] Created devices /dev/input/js1 (joystick) /dev/input/event25 (evdev)
Traceback (most recent call last):
File "/usr/bin/ds4drv", line 8, in
sys.exit(main())
File "/usr/lib/python3.10/site-packages/ds4drv/main.py", line 154, in main
for device in backend.devices:
File "/usr/lib/python3.10/site-packages/ds4drv/backends/hidraw.py", line 173, in devices
yield cls(name=device_name,
File "/usr/lib/python3.10/site-packages/ds4drv/backends/hidraw.py", line 34, in init
super(HidrawDS4Device, self).init(name, addr, type)
File "/usr/lib/python3.10/site-packages/ds4drv/device.py", line 84, in init
self.set_operational()
File "/usr/lib/python3.10/site-packages/ds4drv/backends/hidraw.py", line 89, in set_operational
self.read_feature_report(0x02, 37)
File "/usr/lib/python3.10/site-packages/ds4drv/backends/hidraw.py", line 63, in read_feature_report
return fcntl.ioctl(self.fd, op, bytes(buf))
OSError: [Errno 5] Input/output error

@xabylr
Copy link

xabylr commented May 23, 2023

I have a chines DS4 clone and I was having the same issue. It seems that the feature 0x02 is not supported by it or something like that.

I don't know if this is required for something, but I have just commented out the function call from the penultimate line from the stack trace ( and added a pass in its place for function be valid in python) and it just works!

class HidrawBluetoothDS4Device(HidrawDS4Device):
    __type__ = "bluetooth"

    report_size = 78
    valid_report_id = 0x11

    def set_operational(self):
        #self.read_feature_report(0x02, 37)
        pass

@Mordius
Copy link

Mordius commented Jan 28, 2024

Sorry I'm a noob in this, how do I make it work?

@xabylr
Copy link

xabylr commented Jan 28, 2024

Hello, if you have exactly the same error, look for where the file hidraw.py is located in your error trace. Then, open it with a text editor (you may need to use sudo to be able to save it) and look for self.read_feature_report(0x02, 37). Comment out this line by putting a hash # symbol before the text. Finally, insert a line below with the text pass. Save the file, execute the program again and this error should be gone.

What we are doing here is disabling reading a characteristic not implemented in a chinese DS4 remote. The program will try to call the function but it will not do anything.

Keep in mind that this is Python, so in for the above to work, the pass word must have more indentation than def set_operational(self):

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

3 participants