Comments (6)
That's interesting. A friend and colleague recently developed a browser extension for BCI2000 so I know the field would fine utility in this kind of project in LSL too. But, this is the first I've heard of it, so maybe it simply hasn't occurred to anyone before.
from labstreaminglayer.
Anything that runs in a browser sandbox will not be able to open the sockets for network communication, so unless you have a gateway / new protocol version that uses websockets it's going to be difficult. (For the record: I think it's a good thing a browser doesn't have this kind of access to the local network.)
from labstreaminglayer.
Well emscripten provides at least some support for Boost.ASIO. Apparently it puts a sockets wrapper on webSockets to interface to the C code. But yes, it must then expose it to the Browser as a webSocket and the browser would then enforce same-origin policy.
For my application, and for many I would think, at least for implementing the LSL push interface, CORS (cross origin permissions (to the local network? - I guess so) to just one origin, would do the trick nicely.
I think tho, that might involve a significant change to libLSL.
Looks like I will be forced to a less elegant Electron solution to provide a separate, standalone LSL interface (that is an entirely separate app, wrapping our web App) whilst our App proper runs exquisitely in the browser - the browser in large measure performs the same function as Electron and Cmake build systems (ie cross-platform capability) but much more elegantly (without drivers, and with instant updates).
C'est la vie.
from labstreaminglayer.
Even then you'd have to discover the stream.
The current process is:
- the outlet subscribes to multicast packets
- before creating an inlet, a discovery packet is sent via broadcast/multicast
- the outlets checks if the query matches the stream and replies with the connection parameters (IP, ports)
- the inlet connects
So, even if you could open a plain TCP socket and get your outlets to connect to the stream, you'd still need the time offsets (which are currently synchronized via UDP), otherwise you'd just stream data without any useful time information.
The protocol for data exchange is simple and should be quite easy the replicate in javascript / typescript. The time exchange could work over TCP, but it's modeled after PTP (IEEE 1588), and a TCP exchange would need a different clock exchange and delay calculation. The outlets still wouldn't be discoverable, but scanning all IP addresses in the config file could work.
If someone were to volunteer I could mentor them, but I neither have the time nor the websockets experience to do this.
from labstreaminglayer.
Nice explanation - I begin to see the difficulties.
From the few tests I have done, the LSL discovery system works beautifully - that is why I was keen to participate (as well as a few customer requests!)
Early tests on the Electron package approach are positive. Might have the Inlet implemented in a day or two using Urish/Node-LSL module.
from labstreaminglayer.
I'm interested in this also, WASI might be useful too...
from labstreaminglayer.
Related Issues (20)
- How do I find device name that is being streamed through LSL? HOT 1
- Synch Xsens + TCD/IP cameras HOT 2
- time stamp jump bug HOT 6
- Submitting new app fails HOT 6
- building for android fails HOT 5
- "Error trying to send a time packet: Invalid argument" when accessing a new stream HOT 8
- empty folders HOT 1
- Screen Capture as an LSL Inlet HOT 4
- Single PC clock offset meaning vs. latency and jitter HOT 1
- Time synchronization between multiple OS HOT 4
- Data from udp HOT 1
- Is it possible to compile liblsl to .frameworks or other format which callable in labview?
- Unable to record multiple audio streams HOT 1
- Bluetooth version HOT 1
- what happened to your forum, formerly at https://mailman.ucsd.edu/mailman/listinfo/lsl-l ? HOT 5
- Record data by SCAN4.5 and labrecorder is different? HOT 4
- LSL connection between Windows and Ubuntu HOT 3
- Documentation for maintaining various distributions. HOT 1
- Best way to send data from a device to the web HOT 5
- Streams with manual timestamps sent by LSL to Labrecorder are incorrectly loaded from .xdf HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labstreaminglayer.