Mismatch between different devices' timestamps
Hi everyone, I'm recording data from multiple sources (EEG (256Hz), eye tracker (150Hz), and event markers) for an experiment using LabRecorder. In the first two recording sessions, the data streams were correctly aligned based on their timestamps. However, in recent recordings, I noticed a serious misalignment: the EEG data appears right at the beginning of the file, followed by a massive gap (sometimes up to 700,000 seconds), after which all the other streams (eye tracker, markers, etc.) appear. Has anyone experienced something similar? Could this be due to a change in setup or a specific configuration that I might have unknowingly altered? Any ideas or suggestions would be greatly appreciated!
Thanks in advance.
LSL's push_sample and push_chunk methods have an optional timestamp argument. Developers implementing LSL integrations may be tempted to use this argument if they think they have more accurate timestamps directly from the device rather than using the "right now" timestamp that LSL provides automatically. However, the problem is they don't realize that the timestamps must be in LSL's clock, not whichever clock the device uses.
LabRecorder uses a background thread to collect clock offsets between the sending computer and the local computer running LabRecorder. This background thread uses LSL's clock on both computers and that cannot be changed.
When you open an XDF file using pyxdf or xdf-Matlab, the default behaviour is to use these clock offsets to adjust the saved timestamps from the origin computer's clock to the local clock. i.e., it assumes the data stream's timestamps were in the same clock as the clock offsets, which is the LSL clock.
I've seen this problem in some early versions of LSL applications for Muse and OpenBCI, but it has been corrected since several years. If you have a device with this problem and you're using the 'latest' software provided by the manufacturer or a reputable third party, then they should be alerted and this should be fixed ASAP. There might be other users out there collecting data that is ultimately unusable and they don't know it yet. Also, please let us know so we can look out for it when answering future questions on this issue.