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

Wrong default platform name shown on Raspberry Pi / Raspbian Stretch: armv6, should be armv7 #206

Closed
Sciss opened this issue Feb 4, 2019 · 4 comments

Comments

@Sciss
Copy link

Sciss commented Feb 4, 2019

So I came across this when trying to find the ELSE external, which is built for armv7. The system definitely is armv7:

$ uname -a
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

I just built Pd vanilla 0.49-0 from sources. The preferences says

Default platform: Linux-armv6-32

When I choose User-defined platform: Linux-armv7-32, the externals are found.

Perhaps related: #195

@umlaeute
Copy link
Contributor

umlaeute commented Feb 5, 2019

the arm world is slightly more complicated, with architectures being compatible (or not).

what are the deken-architecture related printouts your get on the Pd-console?

[deken] Platform detected:
[deken] Platform re-detected:

@umlaeute
Copy link
Contributor

umlaeute commented Feb 5, 2019

related nodejs/node#13629

@umlaeute
Copy link
Contributor

umlaeute commented Oct 1, 2019

to summarize:

  • RPi2 is an armv7 architecture
  • armv7 is compatible with armv6 (so you can run armv6 binaries on armv7, but not necessarily the other way round)
  • Raspbian (and Debian/armel) uses armv6 as the target architecture (since this allows the resulting binaries to run on RPi1-RPi3)
      • Pd/deken decides at compile-time which architectures it supports. Since the target architecture during compilation is armv6, this is what gets reported to deken.
  • ELSE was built with higher optimization, producing an armv7-only binary (which would run on the RPi2)
  • since a generic armv6 canNOT run armv7-binaries, deken does not list the binaries.

There's two ways forward:

  • add runtime detection of CPU-features to Pd
  • upload an armv6 binary of ELSE

the latter is simple, and afaict has been implemented.
I leave this open though, in case somebody wants to implement runtime CPU detection

umlaeute added a commit that referenced this issue Mar 10, 2021
previously the master archs for these CPUs where "armv6l" resp "armv7l".
however, Pd only reports the endianness for big-endian architectures,
so the compat-archs didn't really come to play.

Related: #206
@umlaeute
Copy link
Contributor

i checked again, and it seems this is somewhat different than what i thought.

  • Raspbian has a baseline CPU armv6
  • Debian/armhf has a baseline CPU armv7

So: whenever you install a package from the Raspbian repositories, you get the old/legacy architecture (without any decent floating point performance).
But when you install a package from the Debian repositories, you get pretty fast binaries (but they won't run on the RPiZero or the RPi1).

Now Raspbian does not have any puredata package.
If you install puredata via your package manager, it will therefore come from Debian (provided that the Debian repos are enabled; can't check whether this is the default on RPi2 and above), and it will use the armv7 CPU architecture: therefore it will find the proper ELSE (or whatever libraries).

However, if you compile Pd yourself, then you are (most likely) using the compiler provided by Raspbian, which targets armv6.
(urgh).

To conclude: if you build Pd yourself on a Raspbian system, you might get less than you payed for.
If possible, you should use the Debian provided packages.
If this is not an option, you should make sure to manually add build-flags that ensure proper optimization for your CPU.

I'm closing this as wontfix. (I also just committed a patch that is related as it allows you to properly find armv6 libraries when using an armv7 Pd)

umlaeute added a commit to pure-data/pure-data that referenced this issue Aug 3, 2022
Pd might be compiled for ARMv6 (as in Raspbian), but run on an ARMv7 (or higher) (e.g. RPi2 and newer).
In this case, announce the newer CPU so we can automatically use libraries built for the newer CPU.

Closes: pure-data/deken#206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants