LSL + Ganglion: Negative Timestamp Differences / Out Of Order Samples

edited February 2018 in Ganglion
Hi all,

I've been running some tests on my LSL stream from the
Ganglion in order to check its consistency. If I compare the timestamps
of two consecutive samples, every 8th sample seems to have an abnormal
timestamp difference - everything else is exactly 0.005 seconds, which
corresponds to its set sample rate of 200hz. Sometimes this difference
is negative, which would imply that samples are being sent out of order.
Nonetheless, if I average the # of samples received over a period, I
get a 200hz average sample rate.

I'm not sure if this is a quirk of LSL, the Ganglion, or my system. I could give up on LSL and go with UDP streaming with faked timestamps based on a given sample rate, but
that introduces problems that LSL is supposed to help resolve.
Alternatively I could sort chunks of incoming samples based on provided
timestamps, but since I'm not sure if this is normal behavior for LSL,
I'm wary of screwing up the sample order.

Does anyone have any ideas about how I should treat this issue? I can also
provide sample code and its output that reproduces this issue on my

I'm running:
processing 3.3.6 + latest openBCI GUI and HUB to stream LSL from Ganglion
python 3.6.4
Windows 10

Here's example output from my program:
#: 248 timestamp: 2643.265437071001 timestamp difference: 0.005000000000109139
#: 249 timestamp: 2643.2646547030004 timestamp difference: -0.0007823680007277289
        NEGATIVE timestamp difference detected!
#: 250 timestamp: 2643.2696547030005 timestamp difference: 0.005000000000109139
and a rough distribution of abnormal timestamps for 1000 samples:
total negative timestamp differences: 98
total high timestamp differences: 26
total normal 200hz timestamps: 875
Sign In or Register to comment.