Hi,
I prepared a simple finger tapping task for an fNIRS experiment and was planning to use Lab Streaming Layer (LSL) to pass the trial labels to Aurora (official data collection software of NIRX). I tested the experiment before adding LSL, and everything worked smoothly. Then I added the following lines to generate an LSL object and stream at the beginning of the experiment:
from pylsl import StreamInfo, StreamOutlet # import required classes
info = StreamInfo(name='TriggerStream', type='Markers', channel_count=1, channel_format='int32', source_id='Example') # sets variables for object info
outlet = StreamOutlet(info) # initialize stream.
and the following line to push the trigger label at the beginning of each trial:
outlet.push_sample(x=[trigs[ind]])
where “trigs” is the list of labels and “ind” is the current trial number. I had already used these exact four lines in one of my previous experiments, 5-6 years ago, without an issue. Now, when I run the experiment, I get the following error in the “Runner”, PsychoPy pushes the triggers to the recording software (I can see them in an online analysis), generates the log files properly, but crashes.
When I comment out the last line of the first code block (I mean outlet = StreamOutlet(info) # initialize stream.
), I don’t get this error message, the experiment runs without an issue. Of course, trigger labels are not pushed in this scenario.
The interesting thing is that the position number changes in each run. In this image, it says on the last line that "… byte 0xfc in position 1: … ", but sometimes it becomes “position 69”, sometimes “position 19”, just a random number.
I would be grateful if someone could help me with this problem.
Best,
Murat