avengerx / LeadershipTwinTurboWheelFFBDriver

Force Feedback driver for Leadership Gamer Twin Turbo Steering Wheel (model 1021)
GNU General Public License v3.0
2 stars 0 forks source link

Controller (and mouse) stops responding in ATS #15

Open avengerx opened 1 year ago

avengerx commented 1 year ago

In American Truck Simulator (ATS), when force feedback is enabled, the controller will work for around 15 minutes and briefly stop responding. The keyboard works, but the mouse also stops responding, until after some moments (around 2 seconds) it becomes responsive again.

The game logs (Documents/American Truck Simulator/game.log.txt) the following when this happens:

<WARNING> [di8] Input buffer overflow for device 'mouse' (error code: 0x1).

Which suggests some kind of BUS overusage happens, building up a long command queue in the game, which leads to crashes.

Some places suggested in the game, that r_buffer_page_size setting from config.cfg could be increased from 10 to 60 to improve the situation, but it didn't help at all (and seems to be unrelated to the issue in all cases).

From an scs forums post from an employee:

"buffer overflow" happens when active and known controller feeds game by inputs, but those are not processed for some reason (game does not answer). it is completely opposite. there might be some indirect link though (eg strange scenarios like that controllers fighting over the bus or so).

The second part of the sentence suggests the driver could be flooding the USB bus and the game becomes unable to transmit instructions to (or from) its HID peripherals (joystick, mouse but not the keyboard), through DirectInput, which then stop responding and the buffer gets wiped.

avengerx commented 1 year ago

Tried to reduce the delay between polls from the driver, only and only when the last run made alterations; to 1ms, while keeping it to 10ms when it didn't receive updates.

As expected, it didn't change the issue at all -- although it didn't really make it worse.

Switched it back, and then to a fixed 100ms and the issue was gone, but the effects perceived while playing the game became very strange, not necessarily laggy, but somewhat erratic.

Before deeming the issue as fixed, will try with lower values (in ms) of 20, 15, 25, etc. The "sweet spot" here could not necessarily apply for other games though and the driver can't really tell which game is commanding it to make game-specific fixes.

avengerx commented 1 year ago

After several attempts I don't see much can be done. The game floods the driver with different ffb intensities all the time, so even if, say, the engine is at a constant revolution/s, the game will be insistently sending and resetting the effect strength to approximate values close to each other, as if "brute forcing" the engine vibration, or something like it.

I believe the solution for this would be to completely disable force feedback in the game and write a plug in (using SCS SDK). The game effects as they are seem unsuitable for rumble controllers, anyway.