Simulator FIT file playback issues

When I replay FIT files that I recorded, the values (speed and altitude specifically) are way off.  I used https://www.fitfileviewer.com/ to check the values. In "user" mode the viewer shows the values I expect.

What am I missing to get FIT file playback to work as expected?

 "user" and what I expect on the left and sim on the right:

  • In short, there's nothing wrong with your FIT file.

    Certain fields in the FIT file are encoded using a scale and offset to allow non-integer values to be written as integers. What you see in the user mode is the decoded value [i.e. the actual meaning of the value], and what you see in the developer mode is the encoded value [i.e. how the value is written to the file]. It's not like there's 2 sets of values in the file itself, where it would be possible for 1 set [raw] to be incorrect but the other set [user] to be correct. They are just 2 different views of the same data.

    It's the same concept where raw mode shows the integer value of an enum [like the activity sport and subsport], but user mode shows the name of the enum. When you record a running activity, the file contains a raw value of 1 for the activity sport, but user mode will decode this value as "running", for convenience.

    The formula for determining a decoded value from a value encoded with scale and offset is:

    decoded_value = encoded_value / scale - offset

    If you look at profile.xlsx from the FIT SDK, you will see that:

    - for enhanced_speed: scale = 1000, offset = 0

    - for enhanced_altitude: scale = 5, offset = 500 

    Therefore:

    - for enhanced speed, an encoded [raw] value of 1418 translates to a decoded [user] value of 1418 / 1000 = 1.418

    - for enhanced altitude, an encoded [raw] value of 3029 translates to a decoded [user] value of 3029 / 5 - 500 = 105.8

    Some discussion about this: https://www.thisisant.com/forum/viewthread/4561

  • When I replay FIT files that I recorded, the values (speed and altitude specifically) are way off. 

    I'm not sure about this part tho. I don't know if it's a bug in the sim or not.

  • How are you loading the FIT file and playing it back?

    What works for me: If I select Data Source = "FIT/GPX Playable File", load a saved FIT file from a real activity recorded on my FR955, and press the play icon, the data seen by my app (simple data field) roughly matches what's in the FIT file. Based on fitfileviewer, ActivityInfo.currentSpeed roughly matches enhanced_speed in the Records table (although currentSpeed somehow has additional decimals of precision), and ActivityInfo.altitude roughly matches enhanced_altitude in the Records table (except it's offset by about -18 m). Not sure what's going on with the altitude. [*]

    What doesn't work for me: If I select Data Source = "Workout FIT File", and load the same FIT file from a saved activity, the data doesn't match what's in the FIT file. It seems that in this case, I just get simulated data. I think this makes sense, as in this context, "Workout" means a programmed structured workout, not a recorded activity. I do think it would be better if the sim displayed an error if you select a FIT file type which is different than the actual type of the file you load.

    [*] EDIT: others have noticed the sim starts off with altitude of -18 m instead of the starting altitude in the FIT file. Not exactly the same thing (absolute value of -18 as opposed to relative offset of -18), but it can't be a coincidence that -18 shows up in both cases.

    forums.garmin.com/.../1927421

  • OMG - I saw GPX and just ignored that option.  My brain ignored the "FIT" part.  THANK YOU!  I've spent so much time f'ing with this.

    Not it works Slight smileSlight smile

  • Nice!

    No worries, this exact situation has happened to others in the past, so I'd say that it's more of a UI/UX issue on Garmin's part. (Especially since in some contexts, people use "workout" synonymously with "activity".)

    I think:

    - if there's a mismatch between the selected FIT file type in the dropdown and the FIT file that's loaded, the sim should give a warning or error

    - the sim UI should somehow make it clear that data is still being simulated if you select "Workout FIT File"

    - "FIT/GPX Playable File" should probably be changed to something like "Activity (FIT/GPX)" or something like that. I don't think "playable" means anything to most people, although I kinda get why it was used. I'm not sure, but the current wording might have something to do with the possibility that a GPX file may not always represent an activity (I think)

    - "Workout FIT File" could be changed to something like "Structured Workout (FIT)"

    Honestly the activity data dialog has had UI issues from the start, causing various misunderstandings that come up in the forums regularly (meaning that they're not isolated issues). Garmin has made changes over the years, but I think there's still room for improvement.

    At least they finally fixed the problem where you could save a FIT file without pressing Save in the timer controls, which led to a corrupted FIT file.