SHWotever / SimHub

Multi sim dashboard, bass shaker driver, ....
http://www.simhubdash.com/
793 stars 97 forks source link

Loss of steering and ffb when tabbing out of game #1361

Closed FullPace closed 1 year ago

FullPace commented 1 year ago

Hi, I'm trying to fix this bug for about 10 days and I found an entry Simhub Log wondering if this could cause the behaviour:

When playing AMS2 and it's losing focus the steering (SC2 Pro) is immediately dead (no more steering and calibration ingame possible) and ffb is dead as well. When I check the wheelbase driver the wheel is still connected and functional. I also don't hear any usb disconnect sounds etc.

I reinstalled the whole system 6 times, downgraded to win 10, back to win 11 ... I can't figure out whats causing it.

Now I checked simhub logfile again and I see "game disconnected" when I switche focus. Could this trigger some kind of hardware reset that kills the wheel ingame? I use control mapper with arduino pro micro.

It's a long shot but maybe you have an idea. thanks SimHub.txt

SHWotever commented 1 year ago

Hi ! The game connected/disconnected is only a logical indicator based on the telemetry state, it's not really an indicator, or at least I can't tell if there are behaviours in the game itself. Does it only happens when simhub is running ? On other games ? I use the SC2 Pro too, and I toggle swith so many times, I never had that issue (control mapper too, using arduino pro micro along a bunch of usb devices/screens/button boxes etc ...).

What I had once (not the same issue but it shows that it can be deep in the system) were big blue screens related to usb devices it took me a while to figure that is was the motherboard bios update I did a few weeks ahead, In this case it was a definitive crash, but I imagine this can be more subtil, like failing devices. I've also seen in the past overclocks corrupting memory and making games/telemetry and or devices crash (this can be a bios setting surviving the many reinstalls you did)

SHWotever commented 1 year ago

I also see that you are using the "no focus" option of simhub, it seems to show something else about focus : [2023-07-05 22:06:13,242] INFO - Game disconnected [2023-07-05 22:06:17,703] INFO - Game not focused : disabling 'no activate' mode for simhub window

The game disconnected was trigerred 5 seconds before the game lost focus (or et least 5seconds before simhub did see it) so there could be no relation here.

If the issue only occurs when simhub is running : Maybe some other things to check, I see lot of input devices : Button_Box_2, DC_Simracing_Pedals, VirtualAsphalt_ButtonBox, Arduino_Micro, GT3_Wheel, SG_Racing_Combo, Simucube_2_Pro, ClubSport_USB_Shifter, VirtualAsphalt_ButtonBox2 I don't know what they are but if some of them are using an arduino (showing serial ports) It would be worth making sure simhub does not scan them, the ffb loss in game could be side effect of another unstable device : https://github.com/SHWotever/SimHub/wiki/Troubleshoot-other-hardware-Serial-ports-conflicts (even if simhub is not the actual cause, it's still a good hygiene routine to make simhub do not scan third party devices.

FullPace commented 1 year ago

Thanks for the information. It's not only happening when Simhub is running but I thought it might give a hint of whats going on, since I tried everything else. I have blue screens, no error in windows event history and so on. Really hard to debug. I disabled some of the com ports now. Is Simhub remembering the names of the devices? Because com ports always change for me with every reboot. Or is there are way to dongle devices to com ports so they don't change?

SHWotever commented 1 year ago

Ah ok so it's not caused by simhub specifically, good to know, I was fearing a come back of the previous issues and I was already scratching my head "how is this possible ???" :D,

If it doesn't happen when simhub is not running serial ports are not the clue.

Lot of arduino uses ch340 which doesn't have an unique identifier and will randomly change, but most hid devices (those who should be left alone) should have a stable com port. In such case working in "blacklist" mode and excluding them is the best way. Changing ports are why simhub uses a scan process instead of explicit serial port choice, with the unavoidable interferences with "not simhub" devices.

I've read somewhere that "dead driver" protection of the wheel could trigger some issues (the option which disable ffb when you do not hold it), I've never seen that myself but I've lowered the sensitivity from the beginning (but it's still enabled) maybe it's a clue ? Overall my setup feels similar many devices, inputs, displays... SC2 pro, ams2 is my favourite and I play primarily this one so I'm used to it and I didn't had this issue.

So this make me think the answer is somewhat "not saved on the harddrive" (otherwise your reinstalls would have got rid of the issue). Bios, eeprom wheel settings, usb chips drivers (it's something we rarely install manufacturers drivers).

To cross test I would also check with another game, maybe pcars2 which uses the same engine but just in a older version. I would also try to remove some of the controllers devices and check if one of them is not guilty. Dichotomy is the way ... Remove stuffs from the equation until you can pin point the party breaker.

At the end it could be simply a game bug, but considering it's not triggered in my case despite a similar environment, it means that there are some specific conditions. Unfortunately ams2 doesn't have some log files at my knowledge which could be used to understand why it drops the wheel (because it dropped it completely, it's not just ffb as you can't map/calibrate ... anymore). Maybe the last chance is to contact reiza ... Log files... If only there were log files ...

SHWotever commented 1 year ago

One last thing ... If the wheel or another controller was "crashing" (usb issue etc ...) simhub would catch it too and reconnect controllers... but your log does not show such event, so for me the issue is not physical (cable, emi ...)

FullPace commented 1 year ago

Thank you so much for all the help. I can't really say what fixed it but it worked for the last 2 race nights. I manually selected com ports in device manager, disabled simhub port scanning and used joy2key to hard dongle usb controllers to joystick numbers.

Fingers crossed this is fixed

SHWotever commented 1 year ago

Since you said that it was also occuring when simhub is not running I guess the second action (joytokey) made the trick. I still feel this is an issue related to another controller, I don't know how AMS2 works internally but since you have a few duplicates controllers (VirtualAsphalt) I feel the game could mess up keeping them in case of reconnecct. I don't know if they are DIY controllers, if it's the case I would highly suggest reprogramming them with distinct names and PID/VID. This allows a much more fluent support accross games (F1XXX for instance does not like having twice the same controller)

I close this as I feel there it's not linked to simhub. But i'm interrested by the follow-up "for science" ;)

FullPace commented 1 year ago

Yes, it's not Simhub related. I reinstalled the PC again and didn't install Simhub and Joeytokey but it happened again. I thought I could nail it to the usb wheels but yesterday it happend also with my rally wheel (plain wheel without any buttons). So the search continues. The controllers actually have different numbers and names. There should not be a conflict. I ran the exact same setup for about a year without any issues.

It all started when I reinsalled windows.

But maybe it's just the load of usb devices (about 12) that is a problem. I'm thinking of getting a new dedicated pci-express usb card to take away some load of the motherboards usb controller.

At this point I don't know what else to do... I keep you posted :)