Shared Memory API

Discussion in 'Community Workshop' started by Mikael Hermansson, Jun 7, 2015.

  1. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    While your at it, could you please make this API compatible to what it was before the patch? i cant use my motion rig since the patch, obviously because some things were changed in that aspect.

    Is this possible Mikael?
     
  2. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    I don't think it is. The changes will make it possible to future updates to be done in a backwards compatible way, but the shared memory file has been renamed and its layout has changed. The only way to fix your issue is to appeal to your hardware manufacturer to rework their code so it works with the new data. Or you could write some software to read the new memory mapped file and write the data to another memory mapped file using the old name and format
     
  3. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    Thanks Mr Belowski but for my E69 Logykal actuators software there is no more support, i think they closed all.
    As for doing it myself, i am far to be able to do that i am afraid, so if you or someone would do it i would be willing to pay for this service, its that or this great sim is dead for me :(
     
  4. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    It's not technically difficult to do but converting the entire shared memory dataset might be a bit of a pain. What does the hardware actually do? This will help understand how complicated the work might be - if the hardware only needs to know, for example, you car's acceleration values, then it's a (relatively) simple matter of reading the new memory mapped file and writing a few bits of data at the appropriate offsets to another memory mapped file with the correct name
     
  5. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    Its only reading the values of accel, brake, lateral and longitudinal forces, thats all i need.
    In fact it should be as it was in the old API if thats easier.
     
    Last edited: Nov 17, 2016
  6. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    Of course the steering too, i forgot it sorry
    Alltough the steering induce the lateral forces so its kind of same as lateral forces, same goes with braking that induce longitudinal forces
     
    Last edited: Nov 17, 2016
  7. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    OK. I can't promise anything but i'll have a quick look later on to see if there's a simple way to dump some of the data in the current memory mapped file into another file which has the old name
     
  8. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    So to sum this out, i need reading values for:

    - Acceleration
    - Braking
    - Steering left
    - Steering right
    - Pitch
    - Roll

    That vould be great if its possible to do
     
    Last edited: Nov 17, 2016
  9. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    Ok, i really wish you can help me with that, i give you my email so we can communicate easier:

    silvanobazan@gmail.com

    i am hopping hard you can find time to help me keep this great sim

    Regards,
    Silvano
     
  10. Vojvoda

    Vojvoda Well-Known Member

    Joined:
    Jan 31, 2015
    Ratings:
    +145 / 0 / -0
  11. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    Last edited: Nov 17, 2016
  12. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
  13. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    Hey Pixel,
    i went there and saw the sample scripts but for me its chinese lol
    i even dont know where to put the script in the prog or how etc
    maybe with a good tuto but i doubt it.
     
  14. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    @pixeljetstream,
    i saw your page with the analysis but there are many folder and dll. what am i suppose to do, i woulndt know where to start and what to do.
    thats why i stated i am willing to donate if someone does this for me.
     
  15. Gopher04

    Gopher04 Well-Known Member

    Joined:
    Mar 6, 2015
    Ratings:
    +237 / 0 / -0
    Be lucky if the Siminstruments dash will work again, seeings as Siminstruments guys have vanished and don't reply to anyone anymore..Yeh i know Fanaleds software works with it as well, but just isn't as good.
     
  16. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Righty... I've constructed a grotty C# console application that copies some of the new data into the old data file and layout. I can't really test this much - I've verified that it creates the file and I can read a few things from it (position, speed, world position & acceleration and gear data). It's incomplete but does contain the player position / acceleration data and a few other bits and bobs.

    Anyone wanna test it? It's dead simple - just a .exe file that runs in the background as a console window app.

    I need to tidy up and stuff - add some options and stuff (it's currently a hard-coded subset of the data being copied, at a hard-coded 100Hz). I also need to check the code into Github and (maybe...) make a build script. It's here if anyone's brave enough to try it:

    http://crewchief.isnais.de/R3EMemoryTranslator.zip

    [edit]

    It currently copies this data:

    EngineRps, NumberOfLaps, RacePosition, ControlType, CarSpeed, MaxEngineRps, Gear, CarCgLocation, CarOrientation, LocalAcceleration, FuelLeft, FuelCapacity, FuelPressure, EngineOilPressure, ThrottlePedal, BrakePedal, ClutchPedal, BrakeTemp, TireTemp

    Along with all the high-precision PlayerData (world position, acceleration, orientation etc).

    Adding more is fairly simple, but things like opponent data & track name would be a ballache
     
    • Winner Winner x 4
    • Like Like x 2
    Last edited: Nov 20, 2016
  17. Sascha Reynders

    Sascha Reynders Well-Known Member

    Joined:
    Feb 18, 2016
    Ratings:
    +109 / 0 / -0
    Nice job Mr. B ! Just tested it and my SRD-9C is working again: rev lights, speedometer, fuel :) Even if it's not copying all available data (yet?) I'm more than happy with your app until Renovatio update their software.
    Thanks a lot, cheers !
     
  18. silvanob2

    silvanob2 Active Member

    Joined:
    Nov 2, 2015
    Ratings:
    +25 / 0 / -0
    I just tryed it and guess what......it works !!!!!!
    Thank you so much Mr. B your the man :)
    everything is working perfectly as it was prior the patch, even the gear selector. i feel so good now !
    going to the track right now ;)
     
  19. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    He shoots, he scores :D

    It's a bit of a relief - I was worried I'd map the data incorrectly and motion rigs would see huge acceleration and throw you out of the window or something :)

    If anyone uses this little hack and need specific extra data adding give me a yell.

    The app adds about 10ms of latency to the data. I can improve this if needed by increasing the sample rate
     
    • Like Like x 2
    • Winner Winner x 1
  20. M4IRC1IE

    M4IRC1IE Well-Known Member

    Joined:
    Aug 23, 2015
    Ratings:
    +68 / 0 / -0
    thx Mr Belowski, was very frustrated after the patch SimHub get´s no data from r3e. I hope this will get it working. Need to test it later... But thx anyway