sccn / lsl_archived

Multi-modal time-synched data transmission over local network
242 stars 134 forks source link

lsl streams timestamps do not match - openvibe #333

Open fd301 opened 5 years ago

fd301 commented 5 years ago

I use pylsl to receive one lsl stream generated from openvibe and another lsl stream generated via python. The timestamps I receive are not synched. In particular the opevibe timestamps are not related to the time created_at.

Do you have any idea how to resolve this issue?

Many thanks

jfrey-xx commented 5 years ago

Hello,

I stumbled on a similar issue, actually OpenViBE forces timestamps when it pushes value, using some local clock. See the second parameter passed to "push_sample" in https://gitlab.inria.fr/openvibe/extras/blob/master/plugins/server-extensions/lsl-output/ovasCPluginLSLOutput.cpp (if you are using the acquisition server to stream LSL) or in https://gitlab.inria.fr/openvibe/extras/blob/master/plugins/processing/network-io/src/box-algorithms/ovpCBoxAlgorithmLSLExport.cpp (if you are using the LSL box in the designer).

My own fix: just remove this timestamp, then the default LSL clock will be used, and the synchronization works as expected afterward, e.g. when an XDF file is loaded. Not that practical since you need to compile OpenViBE from the source, but might be the only / best way to get accurate timing.

I probably should have reported to upstream months ago...

jfrey-xx commented 5 years ago

(I submitted a bug report related to this issue on http://openvibe.inria.fr/tracker/view.php?id=197 )

dmedine commented 5 years ago

There is another work around for this, but it is a little complex. There is a way to force LSL to override clients' requests for attaching their own timestamps. Adding the lines: [tuning] ForceDefaultTimestamps = 1

to ~/lsl_api/lsl_api.cfg will activate this option. However, the version of liblsl.dll that ships with the latest version OpenViBE (as far as I know) isn't up to date with this feature. This means you have to replace the version of liblsl.dll in the guts of OpenViBE with the latest version of the library. I will try to make sure that the next release of OpenViBE is up to date with this feature so that it doesn't require any manual file swapping in order to fix this issue.

On 8/13/2018 8:48 PM, Jérémy Frey wrote:

Hello,

I stumbled on a similar issue, actually OpenViBE forces timestamps when it pushes value, using some local clock. See the second parameter passed to "push_sample" in https://gitlab.inria.fr/openvibe/extras/blob/master/plugins/server-extensions/lsl-output/ovasCPluginLSLOutput.cpp (if you are using the acquisition server to stream LSL) or in https://gitlab.inria.fr/openvibe/extras/blob/master/plugins/processing/network-io/src/box-algorithms/ovpCBoxAlgorithmLSLExport.cpp (if you are using the LSL box in the designer).

My own fix: just remove this timestamp, then the default LSL clock will be used, and the synchronization works as expected afterward, e.g. when an XDF file is loaded. Not that practical since you need to compile OpenViBE from the source, but might be the only / best way to get accurate timing.

I probably should have reported to upstream months ago...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/333#issuecomment-412623821, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7pzZCFuGVuj1eRBm157MZqC8qMquks5uQcn8gaJpZM4V6_Rx.

fd301 commented 5 years ago

I build openvibe from source and I replaced the lsl library with: ftp://sccn.ucsd.edu/pub/software/LSL/SDK/liblsl-C-C++-1.12.zip The lsl_api.cfg is located at the openvibe dependencies folder (not sure that this is the right place).

Nevertheless, if I enable LSL _EnableLSLOutput openvibe acquisition server crashes on 'Play'. I understand this issue most probably should go to the openvibe emailing list.

dmedine commented 5 years ago

Yes, it should (go on the OpenViBE list). The reason that this doesn't work, as far as I can tell, is that OpenViBE is using an older version of liblsl that does not contain the patch that allows that forces native timestamping.

On 10/31/2018 12:27 PM, fd301 wrote:

I build openvibe from source and I replaced the lsl library with: ftp://sccn.ucsd.edu/pub/software/LSL/SDK/liblsl-C-C++-1.12.zip The lsl_api.cfg is located at the openvibe dependencies folder (not sure that this is the right place).

Nevertheless, if I enable LSL _EnableLSLOutput openvibe acquisition server crashes on 'Play'. I understand this issue most probably should go to the openvibe emailing list.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/333#issuecomment-434652035, or mute the thread https://github.com/notifications/unsubscribe-auth/ADch7gPqum4LEya5ViMNPSd9tjRmjW1jks5uqYkHgaJpZM4V6_Rx.