unity-experiment-framework icon indicating copy to clipboard operation
unity-experiment-framework copied to clipboard

[Feature request] Add support for the lab streaming layer (LSL) and / or hardware triggers

Open soelderer opened this issue 1 month ago • 2 comments

Many labs face the challenge of multimodal data collection, e.g., behavioral data in Unity alongside EEG, force plates, video, and other systems. These devices often run on different PCs, each with its own hardware clock and sampling frequency. This creates a non-trivial problem: how to synchronize data streams across systems for joint analysis. For many use cases, millisecond precision is required. While UXF trackers and session loggers are excellent, they don’t address differences in hardware clocks and sampling rates.

A widely used software/network-based solution for near–real-time synchronization is the Lab Streaming Layer (LSL). Another option is hardware-based synchronization, such as TTL pulses.

Although an LSL wrapper for Unity already exists, I think it would be valuable for UXF to provide an integrated abstraction layer for these kinds of synchronization mechanisms. I imagine a common base class with different implementations (e.g., LSL, hardware TTL), which would make it easier to standardize usage and encourage community contributions.

Since I may have time to look into LSL integration, I’d like to use this thread to discuss how we might structure such an addition. We might work together on an API draft.

For me, one important requirement would be to avoid reliance on the Unity API → allow sending events from custom threads.

Related issues: #117, #118

soelderer avatar Nov 22 '25 19:11 soelderer