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.
| 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 |
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
| 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 | |
| signal_viewer_lsl | library | Source provider for LSL streams | |
| signal_viewer_xdf | library | Source provider for XDF recordings | |
| signal_viewer_serial | library | Source provider for serial devices, including WebSerial | |
| signal_core | library | Format-agnostic multichannel signal engine: summary pyramids, display filters, re-referencing and channel quality |
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).
| 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) |
|
| lsl_tools | library | Recording to XDF, the WebSocket bridge and relay, test outlets, and the lsl command line tool |
|
| 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 |
liblsl is added to a project with dart pub add liblsl. Installation
notes and usage examples are in the
package README.
| Name | Type | Description | Get it |
|---|---|---|---|
| peer_coordinator | library | Transport-neutral coordination of devices: election of a coordinator, membership, heartbeat and synchronised data streams | |
| liblsl_coordinator | library | LSL transport for peer_coordinator |
|
| webrtc_coordinator | library | Peer-to-peer WebRTC transport for peer_coordinator |
|
| webrtc_coordinator_flutter | library | flutter_webrtc binding for webrtc_coordinator |
| 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 | |
| liblsl_test | application | Test application for liblsl with Flutter on each platform |
1.1.1 |
| 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 | |
| serial_transport | library | Multi-platform serial port transport |
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 getScripts 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 packageBoth are expected to pass before changes are pushed.
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.
This project is licensed under the MIT License; see LICENSE.