Skip to content
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

pylsl not working on RaspberryPi #36

Open
dmedine opened this issue Oct 9, 2020 · 7 comments
Open

pylsl not working on RaspberryPi #36

dmedine opened this issue Oct 9, 2020 · 7 comments

Comments

@dmedine
Copy link
Contributor

dmedine commented Oct 9, 2020

Not sure how many LSL users out there on RaspberryPi, but I had a project recently and noticed a couple problems:

The distro that pip fetches on a pi does not come with a 32-bit build of liblsl. I also assume that the 64 bit builds that it does come with are not compiled for the ARM chip on a pi.

Also, after compiling the source(1.14.0), the library still doesn't work because of the name change. pylsl is still looking for liblsl32.so, not liblsl.so.

Looks like this was already handled (and I vaguely recall talking about it) in the module loading code in pylsl so I guess the only thing to do would be to roll a pi distro for pip. Again, probably not a high priority task, but I thought I would make a note of it before I forget.

I have some 32-bit liblsl.so's compiled for Raspberry Pi hot off the presses if anyone needs them.

@cboulay
Copy link
Contributor

cboulay commented Oct 9, 2020

I have some 32-bit liblsl.so's compiled for Raspberry Pi hot off the presses if anyone needs them.

For the sake of finding it more easily in the future, you can manually attach those so's to the liblsl release page (after renaming them to something intuitive). This is what I do for the manylinux .so's for each pylsl release.

pylsl is still looking for liblsl32.so, not liblsl.so.

The latest release on pypi is 1.13.6. The lib finding code has been updated but I don't know if that made it into 1.13.6.

Side note: this reminded me of something else that needs fixing so I made an issue #37

roll a pi distro for pip

I don't know how to do that. Apparently manylinux2014 supports armv7l tags so it should be possible, but I expect there are dragons that way (e.g., Android vs Raspbian, armel vs armhf).

The correct solution is to not provide wheels for linux at all, so pip defaults to installing from source only, then the linux user has to separately install liblsl as a system-level package. @tstenner has done this before, but we shied away from making it an officially supported way of setting up liblsl because it's a different concept to how things work on Win/Mac which is where the majority of users are and it seemed like it wasn't worth the headache of supporting 2 different workflows for a very small number of users (most of whom can figure it out on their own eventually).

However, more and more users are wanting to use lsl on small devices with arm chips, so maybe installing liblsl at the system level should be the way in Linux.

In the interim, maybe we can make a custom wheel and upload it to piwheels somehow.

@dmedine
Copy link
Contributor Author

dmedine commented Oct 9, 2020

There must be a way to do this. There are so many pip packages that are available for both pi and 'normal' linux computers, but I too have no idea how this works.

A custom wheel is a good stop-gap solution, though.

@dmedine
Copy link
Contributor Author

dmedine commented Oct 9, 2020

I will upload my .so's to the release page. Something like 'liblsl-1.14.0-raspbian'? I can add it to the b4 release. It was built from today's (8.10.2020) source code.

@cboulay
Copy link
Contributor

cboulay commented Oct 9, 2020

There must be a way to do this. There are so many pip packages that are available for both pi and 'normal' linux computers

According to piwheels.org, their cloud cluster scans pypi and automatically builds all the packages they find. This includes pylsl: https://www.piwheels.org/project/pylsl/

For pure Python projects, and projects where everything needed to build it can be found via setup.py, this just works. And Raspberry Pi OS has some configuration in it so its pip attempts to download from piwheels before pypi. That's actually why your pip install pylsl did anything at all, because if it tried from pypi it would have failed because there are no wheels with matching tags. Edit: I didn't expand the list. Now I see that piwheels hosts some old versions of pylsl (<=1.12) when they were 'source only', which in practice meant source + as many different lib files as we were packaging at the time but none for ARM. This is probably what you go.

Some options, as I see them:

@tstenner
Copy link
Contributor

make liblsl an apt-installable package as mentioned above, AND provide better error messages when pylsl fails to load the lib so users know to install liblsl.

I mostly agree. The liblsl distribution issues on non-Intel platforms start to affect the Unity users as well and I think it's easier to install it globally on these devices rather than figure out how to inform PyPI, nuget etc. about these platforms.

apt is a very comfortable distribution format that's trivial to build with CMake, for all others I'd just put the binary in an archive with a descriptive name and be done with it.

@xloem
Copy link
Contributor

xloem commented Mar 4, 2022

Bumped into this. Thoughts:

  • finding another maintained package that does this and simply copying its approach could ease maintenance
  • it would be good to have up-to-date instructions for getting this running on arm
  • it's possible there wouldn't be armel vs armhf issues if there is little math code, but it can likely be fixed by specifying a compiler flag if there are

@PeterGamma
Copy link

PeterGamma commented Aug 22, 2022

If nothing works: buy a LattePanda V 1 instead of a Raspberry Pi .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants