lsl_archived icon indicating copy to clipboard operation
lsl_archived copied to clipboard

lsl streams timestamps do not match - openvibe

Open fd301 opened this issue 7 years ago • 5 comments

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

fd301 avatar Aug 13 '18 18:08 fd301

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 avatar Aug 13 '18 18:08 jfrey-xx

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

jfrey-xx avatar Aug 13 '18 21:08 jfrey-xx

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.

dmedine avatar Aug 20 '18 07:08 dmedine

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.

fd301 avatar Oct 31 '18 11:10 fd301

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.

dmedine avatar Oct 31 '18 12:10 dmedine