Visitar URL original
GitHub - NexusDynamic/liblsl.dart: Dart interface for Lab Streaming Layer / liblsl · GitHub
Skip to content

About

Dart interface for Lab Streaming Layer / liblsl

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

1 watching

Forks

Repository files navigation

liblsl.dart: Lab Streaming Layer for Dart and Flutter, XDF reader and LSL Viewer

melos CI Test

This repository contains Dart and Flutter libraries and applications for Lab Streaming Layer (LSL), networked multimodal data collection, the coordination of multiple devices in experiments, and XDF recordings.

The LSL Viewer application displays XDF recordings and live LSL streams from any source. transport_timing is a cross-platform validation and measurement tool for characterising the transmission timing (latency) between devices. Its recorded measurements are loaded into transport_timing_analysis, which collates and visualises the results from all the devices involved in a test. Applications are distributed as downloads and, where applicable, as web apps.

The core liblsl package provides a Dart interface to the C++ liblsl library. peer_coordinator coordinates multiple devices in an experiment, including starting and stopping data streams on all devices together, and liblsl_coordinator carries that coordination over LSL. The xdf package is a pure-Dart implementation of the XDF file format for reading and writing recordings. All libraries are published on pub.dev.

Guides

Guide Result
Streaming data between two devices A stream of timestamped samples sent from one device and received on another
A coordinated experiment Several devices running one program, in which a coordinator starts a data stream on all of them and announces trials
Validating timing in a lab Measured latency, jitter, loss and clock drift between the devices of a lab
Sharing LSL streams over the network LSL streams available in web browsers and across networks

Viewing recordings and streams

LSL Viewer displays XDF recordings, such as those written by LabRecorder, and live LSL streams on Windows, macOS, Linux, Android and the web. Recordings of any size open with one tab per stream; in the web app, files are read locally in the browser. Live streams can be filtered and re-referenced, and are shown with power spectra, signal quality measures and decoded triggers. Streams can be recorded to XDF, and recordings can be replayed as LSL streams. A WebSocket bridge and relay make LSL streams available to browsers and across networks that multicast does not reach. OpenBCI Cyton boards and other serial devices are supported, including through WebSerial in the browser.

Web app · Download 0.2.1 (Windows, macOS, Linux, Android) · Website · Bridge and relay guide · Source

screenshot of the LSL viewer showing the recorded EEG from an XDF file

Name Type Description Get it
lsl_viewer application Viewer for XDF recordings and live LSL streams web app · 0.2.1
signal_viewer library Flutter viewer for multichannel signals, with pluggable source providers Pub Version
signal_viewer_lsl library Source provider for LSL streams Pub Version
signal_viewer_xdf library Source provider for XDF recordings Pub Version
signal_viewer_serial library Source provider for serial devices, including WebSerial Pub Version
signal_core library Format-agnostic multichannel signal engine: summary pyramids, display filters, re-referencing and channel quality Pub Version

Releases of the applications in this repository provide builds for Windows, macOS, Linux and Android. The desktop archives of lsl_viewer include the lsl command line tool. The macOS builds are unsigned and are opened the first time through the context menu (right-click, Open).

Streaming and recording data

Name Type Description Get it
liblsl library Dart and Flutter interface to the C++ liblsl library, with full parity with the C API (JOSS paper, benchmark history) Pub Version status DOI
lsl_tools library Recording to XDF, the WebSocket bridge and relay, test outlets, and the lsl command line tool Pub Version
xdf library Reader and writer for XDF files in pure Dart, on all platforms including the web. Implements the algorithms of pyxdf and is tested against it Pub Version

liblsl is added to a project with dart pub add liblsl. Installation notes and usage examples are in the package README.

Coordinating devices in an experiment

Name Type Description Get it
peer_coordinator library Transport-neutral coordination of devices: election of a coordinator, membership, heartbeat and synchronised data streams Pub Version
liblsl_coordinator library LSL transport for peer_coordinator Pub Version
webrtc_coordinator library Peer-to-peer WebRTC transport for peer_coordinator Pub Version
webrtc_coordinator_flutter library flutter_webrtc binding for webrtc_coordinator Pub Version

Validating timing

Name Type Description Get it
transport_timing application Measures one-way latency, jitter, loss and clock drift between devices over LSL, WebSocket and WebRTC 2.0.1
transport_timing_analysis application Collates and visualises the run logs written by transport_timing web app · 2.0.1
timing_core library Record format and analysis for transport timing runs Pub Version
liblsl_test application Test application for liblsl with Flutter on each platform 1.1.1

Devices

Name Type Description Get it
openbci_cyton library OpenBCI Cyton and Cyton + Daisy boards over the USB dongle: commands, channel settings and samples in µV Pub Version
serial_transport library Multi-platform serial port transport Pub Version

Development

The repository is a monorepo managed with melos and fvm. It is cloned with its submodules:

git clone --recurse-submodules https://github.com/NexusDynamic/liblsl.dart.git
cd liblsl.dart
fvm dart pub get

Scripts defined in the melos section of the root pubspec.yaml run across all packages:

fvm exec melos run lint:all   # dart analyze and dart format; fails on warnings
fvm exec melos run test       # dart test in every package

Both are expected to pass before changes are pushed.

Contributing and support

Contribution guidelines are in CONTRIBUTING.md, and participants are expected to uphold the Code of Conduct. SUPPORT.md describes where to ask questions and discuss features. Security vulnerabilities are reported as described in SECURITY.md.

Matrix chat room

License

This project is licensed under the MIT License; see LICENSE.

About

Dart interface for Lab Streaming Layer / liblsl

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages