Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LabRecorder assigns 1 to latency and duration for every sample #46

Open
harelasaf opened this issue Oct 25, 2020 · 4 comments
Open

LabRecorder assigns 1 to latency and duration for every sample #46

harelasaf opened this issue Oct 25, 2020 · 4 comments

Comments

@harelasaf
Copy link

Labrecorder is synchronizing 2 streams: Matlab marker stream and OpenBCI EEG stream into this file
When opening the file in EEGLAB XDF importer - latency and duration for each event is saved as "1".
Perhaps an issue with outletStream.push_sample clock sync?

@cboulay
Copy link
Contributor

cboulay commented Oct 25, 2020

Hi @harelasaf , in anticipation of what is likely to be the first follow-up question, can you please post the section of your Matlab script that creates the marker stream outlet and the section that pushes samples?

@agricolab
Copy link
Contributor

Hey @harelasaf , your xdf file appears to actually contain three streams, apparently the MarkerStream was created twice, or an older Outlet with the same name was not properly killed and lived on as a zombie process.

XDFStream(name=MarkerStream, type=Markers, hostname=CogniAsaf, created_at=9268.7976244, chan_count=1, ),
XDFStream(name=MarkerStream, type=Markers, hostname=CogniAsaf, created_at=10633.4657311, chan_count=1, )
XDFStream(name=obci_eeg1, type=EEG, hostname=CogniAsaf, created_at=10773.5276496, chan_count=4, )

The first was empty, but the second Markerstream (created at 10633) contained 13 events:

111.0000000000000 at 10819.815980095114
1111.000000000000 at 10823.860194678258
2.000000000000000 at 10823.860306078257
17.00000000000000 at 10823.860397278255
1111.000000000000 at 10832.863870940726
1.000000000000000 at 10832.864163740727
7.000000000000000 at 10832.864400440725
1111.000000000000 at 10841.871113703182
2.000000000000000 at 10841.871325903181
17.00000000000000 at 10841.87151330318
1111.000000000000 at 10850.865821565689
2.000000000000000 at 10850.865992565688
17.00000000000000 at 10850.866077265688

also, the eeg data looked normal when i plotted it.

Could it be that the bug you reported was caused by the EEGlab importer being confused by two streams with the same properties?

@harelasaf
Copy link
Author

harelasaf commented Oct 25, 2020 via email

@agricolab
Copy link
Contributor

agricolab commented Oct 26, 2020

LSL does not support remote killing of a zombie outlet. Depending on how the app for the outlet is set up, there might be additional protocols supporting this. Impossible to say in general.

You can kill all processes with a specific name from your OS terminal (e.g. taskkill on windows or kill on linux), and you can also script this via Matlab. This only works though if the outlet runs on the same machine as the inlet.

In general, i would consider it best practice that each outlet has a unique name. Even if they are virtually identical, they are recorded in the xdf with different ids. Yet, as there is no fixed order in which the streams are being recorded, there is no control over which one is being read from the xdf first. Depending on the reader, e.g. if there is an overwrite, there might be subtle and hard to reproduce bugs if names are identical. This is my guess, but I do not know enough about the eeglab importer to say more. I inspected the file with python, and it looked fine. What you can do is give the regular matlab loader a try and see whether that works and the file is valid to your expectations. That could help pinpoint the bug to the eeglab importer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants