{"id":19252321,"url":"https://github.com/sccn/lsl_archived","last_synced_at":"2025-04-06T22:09:10.892Z","repository":{"id":29843623,"uuid":"33388397","full_name":"sccn/lsl_archived","owner":"sccn","description":"Multi-modal time-synched data transmission over local network","archived":false,"fork":false,"pushed_at":"2018-11-23T16:50:10.000Z","size":318828,"stargazers_count":242,"open_issues_count":102,"forks_count":132,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-03-30T21:06:38.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"wecatch/china_regions","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sccn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-04T00:02:05.000Z","updated_at":"2024-05-25T14:08:50.000Z","dependencies_parsed_at":"2022-09-07T18:30:55.891Z","dependency_job_id":null,"html_url":"https://github.com/sccn/lsl_archived","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Flsl_archived","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Flsl_archived/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Flsl_archived/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Flsl_archived/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sccn","download_url":"https://codeload.github.com/sccn/lsl_archived/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:26:26.762Z","updated_at":"2025-04-06T22:09:06.388Z","avatar_url":"https://github.com/sccn.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This is not what you want!\nThis repo is a snapshot of what once was sccn/labstreaminglayer on 11.23.2018. For the current repository, please go to [sccn/labstreaminglayer](https://github.com/sccn/labstreaminglayer).\n\n# Summary\n\nThe **lab streaming layer** (LSL) is a system for the unified collection of measurement time series\nin research experiments that handles both the networking, time-synchronization, (near-) real-time\naccess as well as optionally the centralized collection, viewing and disk recording of the data.\n\nThe **LSL distribution** consists of:\n  * The core transport library (liblsl) and its language interfaces (C, C++, Python, Java, C#, MATLAB). The library is general-purpose and cross-platform (Win/Linux/MacOS, 32/64) and forms the heart of the project.\n  * A suite of tools built on top of the library, including a [recording program](https://github.com/sccn/labstreaminglayer/wiki/LabRecorder.wiki), [online viewers](https://github.com/sccn/labstreaminglayer/wiki/ViewingStreamsInMatlab.wiki), [importers](https://github.com/sccn/labstreaminglayer/wiki/ImportingRecordingsInMatlab.wiki), and apps that make data from a range of [acquisition hardware](https://github.com/sccn/labstreaminglayer/wiki/SupportedDevices.wiki) available on the lab network (for example audio, EEG, or motion capture).\n\nThere is an intro lecture/demo on LSL here: [http://www.youtube.com/watch?v=Y1at7yrcFW0](http://www.youtube.com/watch?v=Y1at7yrcFW0)\n(part of an online course on EEG-based brain-computer interfaces).\n\nYou may also wish to subscribe to the [LSL mailing list](https://mailman.ucsd.edu/mailman/listinfo/lsl-l)\n\nHosted here is only the source code for the project. Developers will want to clone this repo, then run 'python get_deps.py' to download all the 3rd party libraries from our ftp. \n\n## Download Binary Releases\n\nYou can find old releases on our FTP site: ftp://sccn.ucsd.edu/pub/software/LSL/.\n\nThese releases are out of date. We are working toward an automated build and deployment system\nbut it is not ready yet.\n\n## Streaming Layer API\n\nThe liblsl library provides the following **abstractions** for use by client programs:\n\n- **Stream Outlets**: for making time series data streams available on the lab network.\n  The data is pushed sample-by-sample or chunk-by-chunk into the outlet, and can consist of\n  single- or multichannel data, regular or irregular sampling rate, with uniform value types\n  (integers, floats, doubles, strings). Streams can have arbitrary XML meta-data (akin to a\n  file header). By creating an outlet the stream is made visible to a collection of computers\n  (defined by the network settings/layout) where one can subscribe to it by creating an inlet.\n\n- **Resolve functions**: these allow to resolve streams that are present on the lab network\n  according to content-based queries (for example, by name, content-type, or queries on the\n  meta-data). The service discovery features do not depend on external services such as zeroconf\n  and are meant to drastically simplify the data collection network setup.\n\n- **Stream Inlets**: for receiving time series data from a connected outlet.\n  Allows to retrieve samples from the provider (in-order, with reliable transmission,\n  optional type conversion and optional failure recovery). Besides the samples, the meta-data\n  can be obtained (as XML blob or alternatively through a small built-in DOM interface).\n\n- **Built-in clock**: Allows to time-stamp the transmitted samples so that they can be mutually\n  synchronized. See Time Synchronization.\n\n## Reliability\n\nThe following reliability features are implemented by the library (transparently):\n- Transport inherits the reliability of TCP, is message-oriented (partitioned into\n  samples) and type safe.\n\n- The library provides automatic failure recovery from application or computer crashes to minimize\n  data loss (optional); this makes it possible to replace a computer in the middle of a recording\n  without having to restart the data collection.\n\n- Data is buffered both at the sender and receiver side (with configurable and arbitrarily large\n  buffers) to tolerate intermittent network failures.\n\n- Transmission is type safe, and supports type conversions as necessary.\n\n## Time Synchronization\n\nThe lab streaming layer comes with a built-in synchronized time facility for all recorded data which\nis designed to achieve sub-millisecond accuracy on a local network of computers.\nThis facility serves to provide out-of-the-box support for synchronized data collection but does not\npreclude the use of user-supplied alternative timestamps, for example from commercial timing\nmiddleware or high-quality clocks.\n\nThe built-in time synchronization is designed after the widely deployed Network Time Protocol (NTP)\nand implemented in the LSL library.\n\nThis feature is explained in more detail in the\n[TimeSynchronization](https://github.com/sccn/labstreaminglayer/wiki/TimeSynchronization.wiki) section.\n\n## File Format\n\nThe transport API itself does not endorse or provide a particular file format, but the provided recording\nprogram (`LabRecorder`) \u003c!--and Python/C++ library (`RecorderLib`)--\u003e records into the XDF file format\n([Extensible Data Format](https://github.com/sccn/xdf)). XDF was designed concurrently with\nthe lab streaming layer and supports the full feature set of LSL (including multi-stream container\nfiles, per-stream arbitrarily large XML headers, all sample formats as well as time-synchronization\ninformation).\n\n## Coding Guides\n\nThe distribution includes a range of code examples in C, C++, Python, MATLAB, Java, and C# including\nsome very simple sender and receiver programs, as well as some fairly extensive demo apps.\n\n### Sending Random Data in C++\n\n```\n#include \"lsl_cpp.h\"\n#include \u003cstdlib.h\u003e\nusing namespace lsl;\n\n/**\n * This is an example of how a simple data stream can be offered on the network. \n * Here, the stream is named SimpleStream, has content-type EEG, and 128 channels.\n * The transmitted samples contain random numbers (and the sampling rate is irregular \n * and effectively bounded by the speed at which the program can push out samples).\n */\n\nint main(int argc, char* argv[]) {\n\n\t// make a new stream_info (128ch) and open an outlet with it\n\tstream_info info(\"SimpleStream\",\"EEG\",128);\n\tstream_outlet outlet(info);\n\n\t// send data forever\n\tfloat sample[128];\n\twhile(true) {\n\t\t// generate random data\n\t\tfor (int c=0;c\u003c128;c++)\n\t\t\tsample[c] = (rand()%1500)/500.0-1.5;\n\t\t// send it\n\t\toutlet.push_sample(sample);\n\t}\n\n\treturn 0;\n}\n```\n\n## Receiving Data in C++\n```\n#include \"lsl_cpp.h\"\n\n/**\n * This is a minimal example that demonstrates how a multi-channel stream (here 128ch) \n * of a particular name (here: SimpleStream) can be resolved into an inlet, and how the \n * raw sample data \u0026 time stamps are pulled from the inlet. This example does not \n * display the obtained data.\n */\n\nint main(int argc, char* argv[]) {\n\tusing namespace lsl;\n\n\t// resolve the stream of interest \u0026 make an inlet to get data from the first result\n\tstd::vector\u003cstream_info\u003e results = resolve_stream(\"name\",\"SimpleStream\");\n\tstream_inlet inlet(results[0]);\n\n\t// receive data \u0026 time stamps forever (not displaying them here)\n\tfloat sample[128];\n\twhile (true)\n\t\tdouble ts = inlet.pull_sample(\u0026sample[0],128);\n\t\n\treturn 0;\n}\n```\n\n## How to get support\nIf you are having trouble with LSL, there are few things you can do to get help.\nFirst, search this GitHub repository's issues list, including closed issues.\nIf you don't find what you are looking for, then you can create a new issue. Try to include as much\ninformation as possible about your device (if applicable), your computing environment (operating\nsystem, processor achitecture), what you have tested so far, and also provide logs or other error\nmessages if available. If you end up creating a new issue, please close it once the issue is solved.\n\nYou can also try joining the LabStreamingLayer `#users` channel on Slack. [Invite Link](https://join.slack.com/t/labstreaminglayer/shared_invite/enQtMzA2NjEwNDk0NjA5LWI2MmI4MjBhYjgyMmRmMzg2NzEzODc2M2NjNDIwODhmNzViZmRmMWQyNTBkYzkwNmUyMzZhOTU5ZGFiYzkzMzQ).\nSomeone there may be able to get to the bottom of your problem through conversation.\n\n## Acknowledgements\n\nThe original version of this software was written at the\n[Swartz Center for Computational Neuroscience](http://sccn.ucsd.edu/people/), UCSD.\nThis work was funded by the Army Research Laboratory under Cooperative Agreement Number\nW911NF-10-2-0022 as well as through NINDS grant 3R01NS047293-06S1.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Flsl_archived","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsccn%2Flsl_archived","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Flsl_archived/lists"}