Re: uinput: ioctls for UI_BEGIN_FF_UPLOAD fails (returns -1). How to debug?
flat view
From: Manuel Reimer <hidden>
Date: 2016-03-29 16:48:23
On 03/29/2016 12:21 PM, Clément VUCHENER wrote:
This looks fine to me (maybe you should make sure upload.retval is correctly set before calling UI_END_FF_UPLOAD, but that is not related to your problem).
Thanks for the hint. I guess I should do that in the erase handler, too.
I am using uinput with multiple threads without problems (one in a reading loop like yours, others writing events). You must be doing something wrong with that file descriptor in that other thread.
I also think so, but I don't see the mistake... As the idea was to publish this under GPL3 anyway, I've uploaded my early development state: https://github.com/M-Reimer/pspaddrv To give a short overview: The relevant ones are: device-handler.c ---------------- contains the actual handling thread functions > DeviceHandlerThreadUSB is called from main.c. Contains the "Sending main loop" and starts a second thread in > DeviceHandlerThreadRumble which actually does the rumble stuff and contains the "Receiving main loop" uinput.c -------- contains the uinput init function and the sending function which sends one block of xbox button data at once without any prefiltering. The code files, probably not relevant for this problem are: main.c ------ starts the device handling threads (probably not relevant for my problems) ps[34]-device.c --------------- contain the gamepad interaction usb.c ----- some libusb helper functions Would be great if someone could have a look at this and maybe give me a hint about what could be the problem. To test the code, an PS3 or PS4 gamepad is needed and the rumble stuff actually needs to be commented out. If done so, this driver can be used to emulate an XBox 360 gamepad with an PS3 or PS4 gamepad. Thanks in advance Manuel -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html