Coder Social home page Coder Social logo

pylsl's Introduction

pylsl

This is the Python interface to the Lab Streaming Layer (LSL). LSL is an overlay network for real-time exchange of time series between applications, most often used in research environments. LSL has clients for many other languages and platforms that are compatible with each other.

Pylsl should work with any recent version of the liblsl library (which is also included with this package), on any operating system and with any recent Python version, including 2.7+ and 3.x.

Let us know if you encounter any bugs (ideally using the issue tracker on the GitHub project).

Known Issues

  • On Linux one currently cannot call pylsl functions from a thread that is not the main thread.

Acknowledgments

Pylsl was primarily written by Christian Kothe while at Swartz Center for Computational Neuroscience, UCSD. The LSL project was funded by the Army Research Laboratory under Cooperative Agreement Number W911NF-10-2-0022 as well as through NINDS grant 3R01NS047293-06S1. Thanks for contributions, bug reports, and suggestions go to Bastian Venthur, Chadwick Boulay, David Medine, Clemens Brunner, and Matthew Grivich.

pylsl's People

Contributors

chkothe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pylsl's Issues

Sample Pushed when Streaming is closing

Dear all,

I'm writing you to ask about an issue that I have when I'm closing my stream. I'm pushing one sample with a marker stream type and when I stop the execution of my script Labrecorder saves a marker equal to 0 or another number randomly if the sent markers are more than 100. I also used and not used the command "del" to destroy the outlet object but in both cases the randomic marker is saved on Labrecorder... Can you help me? Can you give me some information about this last marker automatically generated?

Properties, shortcuts and different flavours of StreamInfo

Hey!

Thanks for the lib, it's very helpful. I'd love if you used, in a next major version, properties instead of getters-almost-like-properties. For example I'd like to just write:
stream_info.channel_count
instead of:
stream_info.channel_count()
Simple addition of @property would work wonders :)

Moreover please don't use shortcuts in public methods. I saw one (maybe the only one) example: nominal_srate - I thought first, when doing CR for my colleague, that it was a typo. nominal_sampling_rate would be perfect, no reason to shorten it :)

While I'm at it, why:

original_stream_info = pylsl.resolve_streams()[0]
inlet = pylsl.StreamInlet(original_stream_info)
stream_info = inlet.info()

gives a StreamInfo instance with additional data? stream_info has channels data, while original_stream_info doesn't. We may be misusing the lib, but that's the way we get channels data for active streams, producing an obsolete inlet for that.

has no moduel on raspberry pi

I have alredy follow the Self-built steps on this website and seems like it has intalled already.
https://pypi.org/project/pylsl/

however when I am trying to use any class in pylsl on my raspberry pi, it always tells me that I have no module.

additional note:
standalone_compilation_linux.sh
this command line is not working on my pi

Cannot import on Raspberry Pi

On my Raspberry Pi, importing pylsl fails:

Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylsl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/pylsl/__init__.py", line 2, in <module>
    from .pylsl import IRREGULAR_RATE, DEDUCED_TIMESTAMP, FOREVER, cf_float32,\
  File "/usr/local/lib/python3.4/dist-packages/pylsl/pylsl.py", line 1147, in <module>
    lib = CDLL(libpath)
  File "/usr/lib/python3.4/ctypes/__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python3.4/dist-packages/pylsl/liblsl32.so: cannot open shared object file: No such file or directory

Of course, /usr/local/lib/python3.4/dist-packages/pylsl/liblsl32.so exists.

Any suggestions?

Having trouble importing pylsl

Hi everyone, I having trouble importing pylsl. Everytime I try to import it I get:

Traceback (most recent call last):
File "C:/Users/computer/PycharmProjects/pythonProject1/MuseRead.py", line 33, in
import pylsl
File "C:\Users\computer\PycharmProjects\pythonProject1\venv\lib\site-packages\pylsl_init_.py", line 2, in
from .pylsl import IRREGULAR_RATE, DEDUCED_TIMESTAMP, FOREVER, cf_float32,
File "C:\Users\computer\PycharmProjects\pythonProject1\venv\lib\site-packages\pylsl\pylsl.py", line 1217, in
lib = CDLL(libpath)
File "C:\Users\computer\AppData\Local\Programs\Python\Python37\lib\ctypes_init_.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

I'm tried looking at the installation guide for pylsl and the only thing I can see is to use pip install pylsl which is what I used.

Thanks in advance to everyone that helps.

pylsl cannot be used within a python multiprocessing.Process

In the ReadMe it is written "On Linux one currently cannot call pylsl functions from a thread that is not the main thread."

I want to use LSL within a Python multiprocessing.Process for reading in data from a stream (and I am using a Windows machine Python 3.10.4). I get the following exception however ctypes objects containing pointers cannot be pickled.

So I assume multiprocessing for pylsl is not possible due to the C type implementation right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.