labstreaminglayer / pylsl

Python bindings (pylsl) for liblsl
MIT License
142 stars 58 forks source link

Cannot stream on multiple outlets #66

Closed spanezz closed 1 year ago

spanezz commented 1 year ago

This is an example program that streams on two different outlets:

#!/usr/bin/python3    

import time

import pylsl

def main():     
    info1 = pylsl.StreamInfo(
            "POS", "Test", 1, pylsl.IRREGULAR_RATE, 'float32', 'myuid34234')
    info2 = pylsl.StreamInfo(
            "NEG", "Test", 1, pylsl.IRREGULAR_RATE, "int16", 'myuid43432')

    # next make an outlet
    outlet1 = pylsl.StreamOutlet(info1)
    outlet2 = pylsl.StreamOutlet(info2)                                                    

    seq: int = 0
    while True:                                                     
        outlet1.push_sample([time.time()])
        if seq % 3 == 0:
            outlet2.push_sample([seq % 65536])
        seq += 1
        time.sleep(0.01)

if __name__ == '__main__':
    main()

If I run it and resolve the available streams, only NEG will appear. I observe the same with muse-lsl, where if I stream more than one type of sensors, only the last outlet opened will appear for discovery

This is with liblsl 1.16.2b1 and pylsl 1.16.1

spanezz commented 1 year ago

This happens also between different processes: if I start muselsl stream and afterwards I also start the script above, resolving streams will only return NEG

spanezz commented 1 year ago

It looks like a firewall issue: if I stop the firewall, all streams show up in discovery