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 freezers when trying to save a stream with markers #77

Open
IngeLeu opened this issue Mar 4, 2022 · 10 comments
Open

Labrecorder freezers when trying to save a stream with markers #77

IngeLeu opened this issue Mar 4, 2022 · 10 comments

Comments

@IngeLeu
Copy link

IngeLeu commented Mar 4, 2022

Dear all,
We are working on Windows PC with x64 processor and Windows 10 installed. For timing testing purposes we are sending out a marker stream and brainamp eeg stream. The recording starts as normal but when saving the lab recorder freezes and the markers are not saved in the data file. We tried all 4 releases of labrecorder. Any idea what could be the problem?
Best
Inge (Maastricht University)

@cboulay
Copy link
Contributor

cboulay commented Mar 4, 2022

Are you able to pull the markers in real-time using a simple Matlab or Python script?

@IngeLeu
Copy link
Author

IngeLeu commented Mar 7, 2022 via email

@cboulay
Copy link
Contributor

cboulay commented Mar 7, 2022

LabRecorder can record from many streams.
If I recall correctly, the BrainAmp software has its own marker stream. Is that correct?
And am I assuming correctly that you are sending out a custom marker stream from your own software?

Make sure that each stream has its own unique name and unique_id.

@Fang-UM
Copy link

Fang-UM commented Mar 7, 2022

Thank you so much for replying to us.

Yes, the Lab Recorder can record any streams only if they are not empty, otherwise, it would be crashed.

And yes we are going to send our customized markers and collect it as well as the BrainAmp markers at the same time.
But the problem is if there already exists a lsl outlet, we could not push samples into a second outlet that we create after the first one (the 2ed one would be empty), even they have different names.

Below is a test script used to create 2 streams. The data being pushed into the 2ed stream is empty and can not be collected by LabRecord or something. This issue happened in some particular computers but works well in others.

Thank you again and if you have any idea about this I would be very appreciated!

% Send 2 stream at the same time
lib = lsl_loadlib();

% make a new stream outlet
info1 = lsl_streaminfo(lib,'EEG1','EEG',1,500,'cf_float32','eeg1');
info2 = lsl_streaminfo(lib,'EEG2','EEG',1,500,'cf_float32','eeg2');
outlet1 = lsl_outlet(info1);
outlet2 = lsl_outlet(info2);

% send data into the outlet, sample by sample
pausetime = 1/500; 
sample = 1;
beta = sin(20*2*pi*(1/500:1/500:60));
while true
    outlet1.push_sample(beta(sample));
    outlet2.push_sample(beta(sample));
    sample = sample + 1;
    if sample >= length(beta)
        sample = 1;
    end
    pause(pausetime);
end

@cboulay
Copy link
Contributor

cboulay commented Mar 7, 2022

I don't see any obvious reason why this wouldn't work.

There might be something strange about the Matlab lib in certain operating systems. Could it be necessary to open multiple independent instances of the library? That seems strange.

I'm sorry but I almost never use the Matlab library so I have no guesses here.

Let's ping @dmedine who has more experience in Matlab and with BrainAmp.

@Fang-UM
Copy link

Fang-UM commented Mar 8, 2022

Thank you that's helpful!
But no matter streams are created by Matlab or Python, or even BrainAmp itself, there only exist 1 lsl stream, which means the stream with more than 1 would be empty and could not be resolved.
I wonder if you ever have seen this before or have any ideas about it. Thank you!

@cboulay
Copy link
Contributor

cboulay commented Mar 8, 2022

That is very unusual.

Can you tell me more about the computer that is having trouble? Is it a Mac? Does it have VM or Docker installed?

Sometimes liblsl has trouble advertising a stream to its neighbours when it can't figure out which devices it should use to do its networking. It can get confused by virtual network adapters created for VMs. There was a recent change to liblsl in version 1.16 (in a branch, not yet in main) that fixes this. Maybe that will help you.

But usually when that happens it manifests as the stream not being visible. But it sounds like in your case that the stream is visible only it's not transmitting data (or at least the data aren't being received).

I still think it's a bad network configuration but I can't narrow it down more than that. There are some things that can be done to debug but that would require building C++ applications and using a debugger. If you're willing to go through that then I can provide a little extra guidance. If you are not willing to do that then the next step would be to reinstall the OS.

@Fang-UM
Copy link

Fang-UM commented Mar 8, 2022

It's Windows 10. I will check more information when I access the lab pc.

Before that, I just found the exact same issue has been put out Issue23, which is streaminfos always just contains a single pointer to a stream, although there are multiple streams visible from lab recorde. And you also answered it at the end saying modifying the KnownPeers parameter in the lsl_api.cfg file. But I could not find a lsl_api.cfg anyway, and also the link you've game might be expired? So can you maybe specific the solution of "modifying lsl_api.cfg"? Thank you for helping!

@cboulay
Copy link
Contributor

cboulay commented Jun 22, 2022

Sorry I don't know how I missed this message before.
If lsl_api.cfg doesn't exist then you simply create it.

https://labstreaminglayer.readthedocs.io/info/lslapicfg.html

@Fang-UM
Copy link

Fang-UM commented Jun 23, 2022

Sorry I don't know how I missed this message before. If lsl_api.cfg doesn't exist then you simply create it.

https://labstreaminglayer.readthedocs.io/info/lslapicfg.html

Thank you! That would be helpful!

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