sccn / lsl_archived

Multi-modal time-synched data transmission over local network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stop recording LSL

robertoguarnieri opened this issue · comments

I am trying to crate a Matlab GUI in which, using a toggle button, I can stop the recording from an EEG amplifier.
How can I do that?
Thanks

How are you recording the data to begin with? Are you using LabRecorder?

There currently isn't a way to do that. LabRecorder needs support for scripting/interprocess-communication but it doesn't exist right now.

Controlling an amplifier itself from Matlab (or wherever) is not something that LSL does. This is the job of your hardware device's SDK.

Back in the day, LabRecorder was scriptable because it was implemented in Python. It got re-done in C++ sometime ago. For a while I was thinking of going back to the python implementation (the bugs in liblsl-Python got hammered out) but since then a fair amount of improvement has been made.

One idea would be to implement a kind of REST-style protocol for messaging via LSL marker streams. This would be a way to expose any LSL app's functionality to pretty much anything. This requires a lot of careful consideration and design.

I was thinking about that too. My thought-experiment solutions were a bit awkward in that anytime an app wanted to send a command to LabRecorder it would have to REcreate the control stream to clobber the old one and take over control. Would these control apps then have to destroy their outlets? Would LabRecorder be able to handle the disappearance and reappearance of the "same" stream from different apps?

One idea would be to implement a kind of REST-style protocol for messaging via LSL marker streams.

That was also one of my ideas, but it doesn't map well to LSL, as you don't want one producer and a lot of consumers but one consumer and multiple producers. My current plan is to write Lua bindungs to the recording lib and then embed a Lua interpreter in the Lab Recorder. With that, adding any kind of interface (REST, telnet style with newline separated commands, ...) would be possible while keeping the recorder app clean. However, this discussion should take place in the right issue (#120), so I'm closing this one.

@tstenner You are right of course about the consumer/producer inversion. I was thinking of this as a kind of stop-gap just for LabRecorder. It could have a listening thread that could spawn inlets to listen for the pre-defined commands (like 'stop'). Realistically no one would ever try to connect a bunch of outlets to control LabRecorder. Lua bindings is certainly more desirable.