Accelerometer data synchronisation with activity

Hey All,

I have a swimming Watch App which records the watches accelerometer data during Lap Swimming activity, this then allows our users to visualise and edit their swims using a swim editor tool in our app (called SWIMTAG if you're interested). This works well for our own devices and we are now trying to integrate with Garmin devices.

The issue I am seeing is that sometimes the Length records from the FIT file are not synchronised with the actual Accelerometer data, their position seems to drift as the recording goes on. Each length message has a StartTime so I can see that it's not our plotting that is the issue but the start position of the Length. Interestingly this issue seems to be worst in the Forerunner devices (and to a lesser extent Fenix). I have attached an example from the FR255 below, as you can see by the 7th length it is already offset by about 15sec.

This drift seems to get worse as the recording goes on, but then at the end of the swim it seems to snap back into the correct position, or it just adds a very large length that covers the last two.

I guess that Garmin never designed it to be displayed in this way, but I'd be interested to know if anyone has any theories on what might cause this or why it seems to be the Forerunners that do this mostly, I could try adding in a device-specific offset but it doesnt seem to be consistent on all recordings.

Anyone else noticed this or have any ideas what causes it?