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

Sample Pushed when Streaming is closing #67

Open
matpadalino87 opened this issue Mar 31, 2023 · 4 comments
Open

Sample Pushed when Streaming is closing #67

matpadalino87 opened this issue Mar 31, 2023 · 4 comments

Comments

@matpadalino87
Copy link

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?

Have nice day!

@cboulay
Copy link
Contributor

cboulay commented Apr 4, 2023

This is pretty interesting, though I'm not certain that I understand the problem exactly.

Can you please provide minimal scripts to reproduce the problem (one for the inlet, one for the outlet)?

@matpadalino87
Copy link
Author

matpadalino87 commented Apr 4, 2023

If you record this outlet with labrecorder app you can see that at the end of pushing a sample equal to 0 or a int32 value choosed in the range of the pushed sample values is sent to LSL env. Idem if you receive with the inlet this markers streaming a sample is printed on console after having destroyed the outlet.

In my code outlet and inlet run in 2 different processes (2 different spyder routines), to simplify the procedure the outlet is a for loop but for while loop of inlet must be stopped manually.

Thank you for the support!!! Have nice day

Outlet:


info = StreamInfo(name='phase', type='Markers', channel_count=1,
                  channel_format='int32', source_id='example_stream_001')
outlet = StreamOutlet(info)  # Broadcast the stream.
time.sleep(10)
lista_stim=[]
num_mark = 200
for i in range(0,num_mark):
    last_time = local_clock()
    #Send the calculated time stamp to LSL
    ph_2stim = [random.randint(10,100)]
    outlet.push_sample(ph_2stim, last_time)
    print(ph_2stim)
    lista_stim.append(ph_2stim)
    time.sleep(2)
del outlet

###################################################################
Inlet:

from pylsl import resolve_stream,StreamInlet, local_clock
streams = resolve_stream('source_id','example_stream_001') # make connection
inlet0 = StreamInlet(streams[0])
inlet0.open_stream()

while True:
        sample,timestamp = inlet0.pull_sample()
        print(sample)

@agricolab
Copy link
Contributor

What version of pylsl and liblsl are you using on which operating system?

@matpadalino87
Copy link
Author

I use a Window 10 sys and pylsl 1.16.1 ( I work on anaconda env with Spyder but from terminal I don't see liblsl package version with conda list command).

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

3 participants