Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronization issue when recording #17

Open
nvitucci opened this issue May 20, 2019 · 2 comments
Open

Synchronization issue when recording #17

nvitucci opened this issue May 20, 2019 · 2 comments

Comments

@nvitucci
Copy link
Contributor

Hi all,

I've tried running the P300 notebook with a Muse 2 using Python 3 and muse-lsl 2.0.1 on a Linux machine. Besides a couple fixes on imports that I can add with a PR, I couldn't get the stimulus.start() + recording.start() section to work.
The Muse is correctly working and I can view the stream, but when I get to that section it either fails with a "Cannot find EEG stream" message or, if I invert the order of the calls, with an exception related to an empty list (sorry, I don't have the full exception handy at the moment, but I can attach it later).
The interesting bit is that, if I start the stimulus and press "Esc" within a couple seconds, the EEG stream will actually be found; the markers will not be found anyway, but the recording will go on. Any ideas on what it could be?

@nvitucci
Copy link
Contributor Author

For completeness, when recording.start() is called before stimulus.start(), the output is as follows:

Looking for a EEG stream...
Started acquiring data.
Looking for a Markers stream...

Process Process-3:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/lib64/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "[...]/eeg-notebooks/venv/lib64/python3.6/site-packages/muselsl/record.py", line 43, in record
    inlet_marker = StreamInlet(marker_streams[0])
  File "[...]/eeg-notebooks/venv/lib64/python3.6/site-packages/pylsl/pylsl.py", line 641, in __init__
    self.sample = self.sample_type()
TypeError: 'list' object is not callable

@nvitucci
Copy link
Contributor Author

I just found another interesting behaviour. If I skip the notebook part where the viewer is started (Step 2), and then I run the experiment launching recording.start() before stimulus.start(), both the EEG stream and the Markers stream are successfully recorded. It doesn't appear to be a problem if, instead, I launch the four processes manually from the command line in this sequence:

  1. muselsl stream
  2. muselsl view -b Qt5Agg
  3. muselsl record
  4. python stimulus_presentation/visual_p300_stripes.py

(In both cases I am using PyQt5 as a backend.)

Maybe some weird interactions among threads/processes when multiprocessing is used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant