-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unity Readme Example Fixes #22
Comments
Yes, the namespace changed at some point from the poorly named LSL to the even more poorly named LSL.LSL. This didn't get reflected in this README.
I don't know how the liblsl namespace ever got in there.
Thank you for this insight. I will take this opportunity to once again express my concern that this C# wrapper is not meeting proper standards for style and technique according to Microsoft's guidelines. I am currently (and slowly) developing a new wrapper(https://github.com/Diademics-Pty-Ltd/LSL-dotnet) which I believe is more idiomatic, takes advantage of the latest C# advancements, adheres to Microsoft's naming and style conventions, and has way better names for the static method namespaces. If you care to take a look, I'd be interested in your feedback. |
PRs welcome! The discussion in #18 seemed like it was going somewhere. I don't mind drastically changing the API of liblsl-Csharp. We can increment the major version. I think Unity users will be the only ones who are annoyed (little benefit to them compared to native C# users). My main motivation is that I don't want to spend eternity answering questions about namespace issues, so if there's a better long-lasting API then I'm all for it. |
Looks like there is a PR sitting there since June to fix this issue: #18 |
Yes. I never merged this because I wanted to re-write the wrapper (which I did) but then I never got any feedback on it. @cboulay, I will prepare a PR for my version. Maybe that is a better way to get some comments than what I did. Also, just to assuage any doubts, the wrapper I wrote will work on any OS with .NET provided it has the right version of lsl.dll to work with. |
I still need to make example programs for this so it might take me a bit of time. In the meantime I guess it is fine to merge #18. |
#18 is now merged. However, the OP's comment about FixedUpdate has not been attended to. |
I updated the comment string around FixedUpdate and Update. Closing, with the understanding that a better solution is coming. |
The readme examples for Unity has a couple issues as far as I can tell:
https://github.com/labstreaminglayer/liblsl-Csharp/blob/master/README-Unity.md
I am using Unity 2020.3.10f1
LSLInput calls LSL.resolve_stream around line 19 but it can not find it. It should be LSL.LSL.resolve_stream as Unity seems to be getting confused with the namespace and class being the same (which probably should changed).
LSLOutput references liblsl.channel_format_t.cf_float32 but it can not find it. If you remove liblsl from the start then it works.
This is more of a best practices than an actual error but LSLOutput calls FixedUpdate and has a comment that says it is called once per frame. This is not true. FixedUpdate gets called at a fixed interval regardless of framerate. Typically 0.02ms. Perhaps that is ideal as framerate can fluctuate, but it is also dangerous as it could make the framerate behavior erratically if too much processing is put within FixedUpdate. Most likely this should be changed to Update or if it is intentional then the comment should be updated to reflect FixedUpdate's behavior.
The text was updated successfully, but these errors were encountered: