As explained in status 1, GIMX has to convert the FFB report stream so that it can be transmitted to a wheel that cannot handle reports as fast as a G29 (my Momo racing wheel can handle one report each 8ms, and the G29 one report each 4ms). I wrote some code that handles this task the following way:
- on reception, decode the report according to the protocol specification (published by Logitech here), and only handle “download and play” and “stop” commands
- store the status of the effect into a slot (there are up to 4 effects), and push the effect id into a fifo
- if no write is pending:
- if multiple effects have to be stopped, build a report to stop them, and remove the effects from the fifo
- otherwise, get the next effect to update from the fifo (if any), and build a report
- finally, if a report has to be written, write it (this is non-blocking)
- when writing is complete (this is notified asynchronously), execute step 3
And that’s it, I made my Momo Racing wheel work with my PS4, including force-feedback!
My last task will be to make the code more generic so that other Logitech wheels can be used.