Skip to content

Close and re-open a stream does not work #180

@mscheltienne

Description

@mscheltienne

Hello, another edge-case issue discovered through the Python API that is probably a bug in the C++ lib since the methods involved are one-line wrappers around the C++ functions.

import time

from pylsl import StreamInlet, StreamInfo, StreamOutlet


sinfo = StreamInfo("test", "Markers", 2, 0.)
outlet = StreamOutlet(sinfo)
inlet = StreamInlet(sinfo)
inlet.open_stream()
time.sleep(0.5)  # https://github.com/sccn/liblsl/issues/176
outlet.push_sample([1, 2])
time.sleep(0.2)
assert inlet.samples_available() == 1
inlet.close_stream()
time.sleep(0.2)
assert not outlet.have_consumers()
inlet.open_stream()
time.sleep(0.5)  # https://github.com/sccn/liblsl/issues/176
assert inlet.samples_available() == 1
assert outlet.have_consumers()
outlet.push_sample([1, 2])
time.sleep(0.2)
assert inlet.samples_available() == 2  # fails, still one sample, no matter the number of push

After re-opening a stream, new pushes on the outlet do not yield any new samples at the inlet.
This issue is present on all 3 OS, with version 1.16 of the lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions