nicarran / jpen

Java library for accessing pen/digitizer tablets and pointing devices
42 stars 17 forks source link

How to get the library to work on raspberry pi #22

Open MarkRaph opened 1 year ago

MarkRaph commented 1 year ago

Thank you for this library. I created an application with Processing 4 which gets stylus position, angle and pressure. However, when launched on raspberry pi, the following error shows up despite having the library present.

jpen.provider.NativeLibraryLoader$4 run INFO: loading JPen 2-150301 JNI library: jpen-2-4-x86_64 ... jpen.provider.NativeLibraryLoader$4 logOnFail INFO: jpen-2-4-x86_64 couldn't be loaded jpen.provider.NativeLibraryLoader load INFO: no suitable JNI library found

Because of this error, the stylus pressure show up as zeros when collected.

hamoid commented 1 year ago

Hi! By looking at your message I see x86_64 which is a desktop cpu. I think for Raspberry Pi it should show something like arm6 or arm64. I get the impression the pom.xml file doesn't list anything about arm processors.

MarkRaph commented 1 year ago

Thank you for your feedback. The libjpen-2-4.so also gives the same error. I tried running the jpen demo provided and I got a similar error.

This following is from the status report of the demo.

Construction Exception: jpen.PenProvider$ConstructionException: jpen.provider.NativeLibraryLoader$LoadException: java.lang.UnsatisfiedLinkError: /home/.../jpen-2-150301/libjpen-2-4.so: /home/.../jpen-2-150301/libjpen-2-4.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32 .so on a ARM platform)...

hamoid commented 1 year ago

Sounds like the same reason: the library is not compiled for ARM. It's either a 64 bit or a 32 bit desktop version.

hamoid commented 1 year ago

Maybe you can contact the author of this branch: https://github.com/nicarran/jpen/compare/master...Birch-san:jpen:arm64

Based on the comments a successful build for arm64 was built.

MarkRaph commented 1 year ago

Thank you @hamoid I will contact him.