It seems that Iāve found the mechanism that makes the bug happen.Happy days, as this could also be the cause for the F1 2017 crash (need to check out the logs I recorded of thatā¦)
Bad news is that this can prove to be difficult to fix right away.
Short explanation of what is happening, is that there are two pipelines in USB. When everything goes right:
ClearEffects (on report pipe)
CreateEffect (on control pipe, effect gets ID 1)
CreateEffect (on control pipe, effect gets ID 2)
For the creations, there is also commands that asks the ID from the device, but Iāve omitted them from here.
All reports on the report pipeline get into a report buffer, where they are being read as fast as possible. The control pipeline stuff is handled in an interrupt right away.
If SimuCUBE is handling something time consuming, such as forming the simplemotion command to the IONI and sending it, the clear effects command doesnāt get performed right away. If the commands via USB are being sent at fast enough speed, then execution order is this:
CreateEffect (on control pipe, effect gets ID 1)
ClearEffects (on report pipe)
CreateEffect (on control pipe, effect gets ID 1)
So, sometimes there are effects lackingā¦ Some games seem to actually check what effect idās they got, and reinit accordingly if needed. Some games just send-and-forget. It seems that ETS2 gracefully forgets IDs, but if the same happens with F1 2017 and if this is the cause of itās crash, there might be some exception / wrong indexing of a table, and game would crash/hang/etcā¦
Fix is not a one-day thing to do. Might need to perform the incoming report pipe parsing already in the interrupt service, at least for those commands that touch the effects table.