sccn / lsl_archived

Multi-modal time-synched data transmission over local network
242 stars 134 forks source link

complications with optitrack -- LSL crashes if a sample has 0 channels #104

Open dmedine opened 8 years ago

dmedine commented 8 years ago

I am currently at the Tokyo Institute of Technology setting up a lab there with LSL. Their mocap system is optitrack, which is great because as far as I know, the optitrack App was never tested. Low and behold, there were a few bugs (an impressively few, number, I might add -- a testament to Christian's ninja-ness!).

Anyway, I am working it out and a nice tested OptiTrack app is coming soon.

The important thing to mention, though, is that I did come across a couple of nasty little 'gotchas' today. One is that if you set up an LSL stream with 0 channels, your program will crash hard. It might be worth while to write a little safeguard against this in the liblsl source code. Furthermore, I was able to make labrecorder to crash by setting up an outlet that claimed to run at 240Hz, but in fact ran at 0Hz (which one can potentially do with the OptiTrack App in its current form). I'm not quite sure how to robustly prevent this from happening.

chkothe commented 8 years ago

Thanks! Version 1.4 was tested, 2.2 wasn't (though there was a lab that asked for it). Actually liblsl has been used with 0 channels in the past, and that's a valid use case (there's an LSL app that only posts meta-data). So that must be a more recent regression (could be related to the code that enabled extremely high throughput). On Mar 28, 2016 2:05 AM, "David Medine" notifications@github.com wrote:

I am currently at the Tokyo Institute of Technology setting up a lab there with LSL. Their mocap system is optitrack, which is great because as far as I know, the optitrack App was never tested. Low and behold, there were a few bugs (an impressively few, number, I might add -- a testament to Christian's ninja-ness!).

Anyway, I am working it out and a nice tested OptiTrack app is coming soon.

The important thing to mention, though, is that I did come across a couple of nasty little 'gotchas' today. One is that if you set up an LSL stream with 0 channels, your program will crash hard. It might be worth while to write a little safeguard against this in the liblsl source code. Furthermore, I was able to make labrecorder to crash by setting up an outlet that claimed to run at 240Hz, but in fact ran at 0Hz (which one can potentially do with the OptiTrack App in its current form).

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/sccn/labstreaminglayer/issues/104

dmedine commented 8 years ago

Hmmm... Maybe I am misunderstanding what is causing the crash then. It could be related to the fact that NatNet uses callbacks as opposed to the usual blocking loops that we use for other apps. I can write some simple C programs to test this out. I will put that in my cue.