LSL (low-level)🔗
If the high-level API is not sufficient, the low-level API interface directly with liblsl, with a similar API to pylsl.
Compared to pylsl, mne_lsl.lsl
pulls a chunk of numerical data
faster thanks to numpy
. In numbers, pulling a 1024 samples chunk with 65 channels in
double precision (float64
) to python takes:
4.33 ms ± 37.5 µs with
pylsl
default behavior471 ns ± 1.7 ns with
pylsl
using andarray
asdest_obj
to prevent memory re-allocation268 ns ± 0.357 ns with
mne_lsl.lsl
which usesnumpy.frombuffer()
under the hood
More importantly, pylsl
default behavior pulls a chunk in linear time O(n)
,
scalings with the number of values; while mne_lsl.lsl
pulls a chunk in constant time
O(1)
. Additional details on the differences with pylsl
and mne_lsl
can be
found here.
Base Stream information object, storing the declaration of a stream. |
|
An inlet to retrieve data and metadata on the network. |
|
An outlet to share data and metadata on the network. |
|
Version of the binary LSL library. |
|
Version of the LSL protocol. |
|
Obtain a local system timestamp in seconds. |
|
Resolve streams on the network. |