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

Stream times are not synchronized #6

Open
Matthew910818 opened this issue Nov 26, 2023 · 2 comments
Open

Stream times are not synchronized #6

Matthew910818 opened this issue Nov 26, 2023 · 2 comments

Comments

@Matthew910818
Copy link

Matthew910818 commented Nov 26, 2023

Hi, I have tried to plot the channel data through EEGLAB, but however, the event markers are all at time = 0.
The data was EEG data from Muse2 Headband and the events were from python (pylsl) as a marker stream.
This is the python code :

import serial
from pylsl import StreamInfo, StreamOutlet, local_clock

serial_port = 'COM4'
baud_rate = 9600
ser = serial.Serial(serial_port, baud_rate)

info = StreamInfo('MyMarkerStream', 'Markers', 1, 0, 'string', 'myuid34234')
outlet = StreamOutlet(info)

while True:
    try:
        line = ser.readline().decode('utf-8').strip()
        timestamp = local_clock()
        print(type([line]))
        outlet.push_sample([line], timestamp)
        print(f"Sent data: {line} hz at time: {timestamp}")
    except KeyboardInterrupt:
        print("Exiting...")
        ser.close()
        break
    except Exception as e:
        print(f"An error occurred: {e}")
@cboulay
Copy link
Contributor

cboulay commented Nov 26, 2023

Please put triple-backticks before and after your code block so it is more legible.

But, as I mentioned in xdf-modules/xdf-Matlab#18, there's no problem with your Python code. The problem is either in how you're loading the data into EEGLAB or it's originating from the Muse source. I think the latter is more likely.

Can you please provide details about how you're getting an LSL stream from your Muse device?

@Matthew910818
Copy link
Author

Hi, I installed Muse LSL from this website ( https://github.com/alexandrebarachant/muse-lsl ), and type "muselsl stream" in the command line to start streaming.

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

2 participants