labstreaminglayer / App-LabRecorder

An application for streaming one or more LSL streams to disk in XDF file format.
MIT License
123 stars 45 forks source link

Mac OS - Records an empty file with steam metadata #68

Closed katerina-ds closed 3 years ago

katerina-ds commented 3 years ago

Hi, I'm using LabRecorder on Mac OS (Catalina v. 10.15.7). I can see the streams and start recording. But the resulting file does not contain any data, only stream metadata and time offsets. Here is the content of the file read by pyxdf.load_xdf(). I used python -m pylsl.examples.SendData to simulate a sensor.

([{'info': defaultdict(list,
               {'name': ['BioSemi'],
                'type': ['EEG'],
                'channel_count': ['8'],
                'channel_format': ['float32'],
                'source_id': ['myuid34234'],
                'nominal_srate': ['100.0000000000000'],
                'version': ['1.100000000000000'],
                'created_at': ['86.77403583500001'],
                'uid': ['50ba2ea7-d596-4b68-a10a-ce1c28865f64'],
                'session_id': ['default'],
                'hostname': ['mac-kate'],
                'v4address': [None],
                'v4data_port': ['16572'],
                'v4service_port': ['16572'],
                'v6address': [None],
                'v6data_port': ['0'],
                'v6service_port': ['0'],
                'desc': [None],
                'stream_id': 1,
                'effective_srate': 0}),
   'footer': {'info': defaultdict(list,
                {'first_timestamp': ['0'],
                 'last_timestamp': ['0'],
                 'sample_count': ['0'],
                 'clock_offsets': [defaultdict(list,
                              {'offset': [defaultdict(list,
                                            {'time': ['115.9061028785'],
                                             'value': ['-2.26375000025314e-05']}),
                                defaultdict(list,
                                            {'time': ['120.9062368245'],
                                             'value': ['-1.318649999859645e-05']}),
                                defaultdict(list,
                                            {'time': ['125.911398654'],
                                             'value': ['-2.933799999738085e-05']}),
                                defaultdict(list,
                                            {'time': ['130.914101721'],
                                             'value': ['-3.051899999206853e-05']}),
                                defaultdict(list,
                                            {'time': ['135.9167075955'],
                                             'value': ['-4.738350000366154e-05']}),
                                defaultdict(list,
                                            {'time': ['140.918574604'],
                                             'value': ['-5.005799998514249e-05']}),
                                defaultdict(list,
                                            {'time': ['145.9221213515'],
                                             'value': ['-2.135549999593422e-05']}),
                                defaultdict(list,
                                            {'time': ['150.9222015105'],
                                             'value': ['-8.195500001306755e-06']}),
                                defaultdict(list,
                                            {'time': ['155.9260812715'],
                                             'value': ['-1.91484999874092e-05']}),
                                defaultdict(list,
                                            {'time': ['160.9302503625'],
                                             'value': ['-2.403750001178651e-05']}),
                                defaultdict(list,
                                            {'time': ['165.9340586375'],
                                             'value': ['-3.840149999234654e-05']}),
                                defaultdict(list,
                                            {'time': ['170.9357685315'],
                                             'value': ['-2.407150000749425e-05']})]})]})},
   'time_series': array([], shape=(8, 0), dtype=float64),
   'time_stamps': array([], dtype=float64)}],
 {'info': defaultdict(list,
              {'version': ['1.0'], 'datetime': ['2021-08-05T22:15:27-0400']})})
dmedine commented 3 years ago

@cboulay will know more about any issue with OSX. He will most likely post when the sun is up in his part of the world.

But, I can say that the fact that LabRecorder is recording clock offsets and not data suggests that there is something wrong with the data transmission---not LabRecorder. Maybe a firewall setting? I would try running the example ReceiveData.py. If that also does not get any data, it is not a problem with LabRecorder (not that that solves your problem :/). I am not a Mac user so that is about as much help as I can offer.

cboulay commented 3 years ago

Hmm, that's pretty interesting. How did you install pylsl and LabRecorder? There's now a homebrew formula for LabRecorder, but to be honest I'm having trouble navigating Apple's latest round of restrictions and code-signing requirements, so I don't expect it to work on anyone's computer but my own. But it's worth a shot!

brew install labstreaminglayer/tap/labrecorder

If that doesn't work then my recommendation would be to build both liblsl and LabRecorder from source.

I'm occupied tomorrow so I won't be able to look into this. I'll try to circle back to it next week. Please feel free to ping me if you haven't heard anything.

ScottThomasMiller commented 3 years ago

Hi. I am having the same issue on my MacBook M1. LabRecorder is recording the header and footer, but no data. I am using Swift 5 in Xcode 12.5.1 on a MacBook Pro M1 in iOS Simulator mode. I've tried int16 and string types. If I use ReceiveStringMarkers.py and SendStringMarkers.py, in separate iTerm2 windows on my Mac, it works fine.

katerina-ds commented 3 years ago

@cboulay I actually installed it using brew. I'll try to build it from source to see if that help.

ScottThomasMiller commented 3 years ago

Would a tcpdump help?

cboulay commented 3 years ago

I think I've identified the issue. There was a protocol incompatibility introduced into liblsl. See here: https://github.com/sccn/liblsl/issues/134

What this means is that any apps that were using older liblsl were incompatible with apps that were using newly-compiled-from-source liblsl. @katerina-dandelion you were using a new build from source via homebrew (thank you for testing and reporting, by the way), and @ScottThomasMiller you were using a new build because we don't have an iOS or M1 release so you had no choice. These were incompatible with old liblsl, whether that was with pylsl from pip or a release of another application.

This is a major problem and we will try to solve it as soon as possible.

In the meantime, @katerina-dandelion you can try downloading LabRecorder from the release page (there are some mac builds there): https://github.com/labstreaminglayer/App-LabRecorder/releases

@ScottThomasMiller - you can checkout liblsl to a commit before the incompatibility was introduced. You might as well use the latest release tag: git checkout v1.15.0.

ScottThomasMiller commented 3 years ago

I think that fixed it but I won't be sure until I can visualize the xdf file. I now see an entry in the footer which reads:

25

Whereas before, it had a sample_count of 0.

katerina-ds commented 3 years ago

Thank you, @cboulay. I downloaded v1.14.2 release and the recording works fine!