1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AMS2 Shared Memory Corruption

Discussion in 'Automobilista 2 - General Discussion' started by LuisB, Nov 15, 2021.

  1. LuisB

    LuisB New Member

    Joined:
    Dec 15, 2020
    Messages:
    22
    Likes Received:
    9
    Let me start by saying that AMS2 is the best sim out there, and my main sim for sure.

    I am posting this because there is a pernicious bug that is plaguing a number of us AMS2 fans. It has to do with the connectivity between AMS2 and SRS (SimracingStudio).

    At times, but very very often, it appears as if SRS is not receiving any telemetry from AMS2. Thus, fans don't work, motion doesn't work, etc.

    I thought this was an SRS problem, so I have been bothering the people at SimracingStudio. Today, Marcelo did an extensive debugging session using my PC. He created specially instrumented versions of SRS where he logged every little bit of data.

    The conclusion? It appears that the shared memory is not being initialized/used properly by AMS2 sometimes. For example, get_mversion returns a 0, and the car names are all blank. There's more, but I am not an expert on any of this.

    The crazy thing is that usually, in order to prevent this problem, somewhat reliably, you have to:
    1) Reboot
    2) Start PC2, without starting any other game
    3) Get to the car, about to drive
    4) Exit PC2
    5) Immediately start AMS2
    6) Play. It works 90% of the time. When it doesn't, swear a bit, go back to step 1, and try again.

    I have been able to confirm that this issue happens both on AMS2 as well as on PC2. However, for some reason, it seems to only happen on PC2 if AMS2 has somehow mucked the shared memory beforehand. I do not recall it happening with PC2 after a fresh reboot, for instance, but I just had it happen in PC2 right after it'd happened in AMS2.

    I am hoping you are able to look into this.

    Thank you,
    Luis
    PS: in case you are interested, the log file from SRS in debug mode is chock-full of these entries:
    11-14 20:11:54 SimRacingStudioApp.automobilista2Listener.checkStatus DEBUG there is a mismatch with the shared memory file
    11-14 20:11:54 SimRacingStudioApp.automobilista2Listener.checkStatus DEBUG get_mversion 0
    11-14 20:11:54 SimRacingStudioApp.automobilista2Listener.checkStatus DEBUG carname b''


    PPS: when AMS2 is in this state, Simhub would not work either.
     
  2. Gagaryn

    Gagaryn Out To Lunch AMS2 Club Member

    Joined:
    Dec 26, 2019
    Messages:
    590
    Likes Received:
    252
    I suspect that despite their protestations to the contrary that the fault may lie on SRS side. If AMS2 shared telemetry really was broken all of the users of Crew Chief, SimHub, Fanatec Fanalab etc etc would also be having issues. I suspect the vast majority of users use one or more of these regularly. None have reported issues.
     
  3. morpwr

    morpwr Active Member AMS2 Club Member

    Joined:
    Dec 10, 2016
    Messages:
    482
    Likes Received:
    217
    No issues here with SRS or Crew Chief. But i have had to put the Pcars start command back in for steam a few times for AMS2 or SRS doesnt work which we shouldnt have to do. I just figured its from the huge amount of updates we have had on the beta version.
     
  4. Dean Ogurek

    Dean Ogurek "Love the Simulation You're Dreaming In." AMS2 Club Member

    Joined:
    Mar 9, 2016
    Messages:
    1,412
    Likes Received:
    650
    One issue I've had with AMS2 is related to D-box although, that does not guaranty it's telemetry related as they have other means for motion effects.

    D-box recently stopped working normally with the latest Beta. The suppressed motion effects are now persistent. I tested using the Main Public Branch of AMS2 and D-box works normally there.
     
    Last edited: Nov 17, 2021
  5. LuisB

    LuisB New Member

    Joined:
    Dec 15, 2020
    Messages:
    22
    Likes Received:
    9
    UPDATE: SRS did some modifications to bypass this issue, and it is now starting up. Currently testing it, but so far it is holding up well, so perhaps this problem is bypassed, irrespective of its root cause. Later versions of SRS will have this fix.
     
  6. Gagaryn

    Gagaryn Out To Lunch AMS2 Club Member

    Joined:
    Dec 26, 2019
    Messages:
    590
    Likes Received:
    252
    Told you :whistle:
     
  7. LuisB

    LuisB New Member

    Joined:
    Dec 15, 2020
    Messages:
    22
    Likes Received:
    9
    Far from daring to contradict you, of course, but when the problem used to happen, we could not get simhub (not srs) to work, when it normally does. That lent some credence to the possibility that the shared mem is indeed in some corrupt state.

    The fact that SRS overcame that issue does not mean they generated it :)
     
  8. mr_belowski

    mr_belowski Well-Known Member

    Joined:
    Jun 19, 2016
    Messages:
    213
    Likes Received:
    262
    there's no shortage of bugs in the shared memory but these are generally data bugs (driver name character set issues mangling Strings, incorrect data, stale entries in fixed length arrays etc etc). But I've never once see a complete "corruption" of the shared memory.

    If I remember correctly AMS2 uses the same name for the memory-mapped-file as pCars2 does. I imagine that it's possible that running pCars2 and then immediately after running AMS2 could have some issues where the MMF isn't released by pCars2 before AMS2 attempts to create or modify it
     
    • Useful Useful x 1

Share This Page