caprica / picam

Unofficial Java API library for the Raspberry Pi camera.
GNU General Public License v3.0
49 stars 11 forks source link

64 bit Version #27

Closed neil-benn closed 3 years ago

neil-benn commented 3 years ago

Hello,

I need this to work on 64 bit raspberry pi OS; I've compiled the native library on 64 bit and I'm going to test it just by forking the library for now and using my fork but could we deploy with a classifier for 64 bit?

Cheers,

Neil

neil-benn commented 3 years ago

I compiled picam-native on my 64 bit OS, copied the so library across to a forked picam library, deployed picam to my local repos, executed my test code and ran a test (basically the code from README.md) and have an mmal error:

pi@raspberrypi:~/rpicamgrab $ target/appassembler/bin/testrpicam mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x7f90155908 (EINVAL)
uk.co.caprica.picam.CameraException: Failed to open camera
        at uk.co.caprica.picam.Camera.<init>(Camera.java:92)
        at com.ziath.rpicamgrab.TestRpiCam.main(TestRpiCam.java:21)

Note that I'm on the following version:

pi@raspberrypi:~/rpicamgrab $ uname -a Linux raspberrypi 5.10.63-v8+ #1457 SMP PREEMPT Tue Sep 28 11:27:02 BST 2021 aarch64 GNU/Linux

My hardware is a CM4 board mounted on an IO board running on CAM1; raspistill works.

neil-benn commented 3 years ago

As an additional note the C++ raspicam library works (https://github.com/cedricve/raspicam) but picam would be so much easier to implement as the C++ raspicam library will involve a ton of JavaCPP/JNI work which you've obviously already done!

caprica commented 3 years ago

What can I tell you, this works on the stock OS, if the code is not working on the 64-bit OS, I don't know.

I am not in a position where I can install a 64-bit OS on any of my Pi's to try and troubleshoot this.

Maybe the native code compilation needs extra flags for 64-bit, I really don't know.

neil-benn commented 3 years ago

OK, thanks. I'll try to JavaCPP link to the raspicam library instead - if you want me to test anything on picam let me know. If I discover anything of use to your project I'll make you aware.