Getting raspberry pi camera working on android-rpi (not Android RT nor android-things)

917 views
Skip to first unread message

issam....@gmail.com

unread,
Oct 30, 2017, 6:32:21 AM10/30/17
to Android-rpi
Somehow I do not find a single post that explains how to get the camera working on Android build for Raspberry Pi (android 7.1.2)
I tested the doobell application on android-things but I would like to do the same for android image that I build myself from
https://github.com/android-rpi/device_brcm_rpi3 instructions
Enabling the default camera hal in the rpi3.mk causes some camera service crashes in a loop (refer to

https://github.com/android-rpi/device_brcm_rpi3/issues/95)


So I found an application from Android RT that just execute raspistill to take pictures using the official Rpi camera connected through the CSI port:

https://gitlab.com/emteria/public/samples_apps_PiCamera


This is where I decided to port the raspistill utility to use on my rpi android build 7.1.2
I took the code from https://github.com/raspberrypi/userland.git
I installed cmake, mae sure my compiler path was correct for g++-arm-linux-gnueabihf
And I managed to succesfully build the userland code.
Then I pushed the newly compiled raspistill and made it executable

adb push ./build/bin/raspistill /system/bin/
adb shell chmod +x /system/bin/raspistill

However when trying to execute raspistill I am getting the following error:
rpi3:/ #

/system/bin/raspistill                                                  /system/bin/sh: /system/bin/raspistill: No such file or directory

Question:
Has anyone succeeded in doing such a thing: getting the official rpi camera working on a build generated from https://github.com/android-rpi/device_brcm_rpi3
and if so, could you please explain how you did this

Best regards,



John Wong

unread,
Nov 29, 2017, 3:34:16 AM11/29/17
to Android-rpi
Thank you for your work!I follow your instruction,and face the problem.And after google it,i found it is because there is missing many files in /lib folder,such as ld-linux-armhf.so.3,libm.so.6,etc.I have not resolve this problem yet.But when it is done,I will share the solution.

在 2017年10月30日星期一 UTC+8下午6:32:21,issam....@gmail.com写道:

Issam Dridi

unread,
Nov 29, 2017, 4:45:32 AM11/29/17
to John Wong, Android-rpi
Many thanks for looking at this, this is so nice of you. 
I will try to find some time to investigate as well.

Best regards,
Issam
--
You received this message because you are subscribed to a topic in the Google Groups "Android-rpi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-rpi/Zss8Ktx9E90/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-rpi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-rpi/fd7b909a-16f5-4cf4-9aff-c6f47a930971%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Wong

unread,
Nov 30, 2017, 1:24:29 AM11/30/17
to Android-rpi
After copy all needed files,run raspistill,and got follow message:

mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)

mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)

mmal: Failed to create camera component

mmal: main: Failed to create camera component

mmal: Camera is not enabled in this build. Try running "sudo raspi-config" and ensure that "camera" has been enabled

and mmal_vc_diag camerainfo get follow message:

cameras  : 1

flashes  : 2

camera 0 : port 0: 3280 x 2464 lens absent

flash 0  : flash type LED

flash 1  : flash type LED


Any ideas?

在 2017年11月29日星期三 UTC+8下午5:45:32,Issam Dridi写道:

issam....@gmail.com

unread,
Nov 30, 2017, 11:55:43 AM11/30/17
to Android-rpi
Hi John,

If you provide detailed step (which lib to copy and where you got them), I can try to reproduce and help you.

Also it seems that this is needed:
Add "start_x=1" and "gpu_mem=128" in /boot/config.txt.
As well as loading
"modprobe bcm2835-v4l2"

When trying to use externql USB camera I ended adding this in kernel/rpi/arch/arm/configs/bcm2709_defconfig, but not sure this applies here:

CONFIG_VIDEO_DEV=y CONFIG_VIDEO_V4L2_COMMON=y CONFIG_VIDEO_MEDIA=y CONFIG_USB_VIDEO_CLASS=y CONFIG_V4L_USB_DRIVERS=y CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
Message has been deleted

John Wong

unread,
Nov 30, 2017, 7:54:01 PM11/30/17
to Android-rpi
Hi, Issam.Here is the detail step:
1、After buiding the userland,I remount the root folder and system folder to rw:
mount -o remount -rw /
mount -o remount -rw /system
2、copy all builded lib file to android /lib folder
adb push ./userland/build/lib *.* /lib
3、copy following files to android /lib folder,these files can be found in toolchain:
ld-linux-armhf.so.3
libc.so.6
lbrt.so.1
libpthread.so.0
libdl.so.2
libm.so.6

now we can run raspistill -o test.jpg,but unfortunately it still not working.
by the way,all files we coped will lost after reboot!

在 2017年12月1日星期五 UTC+8上午12:55:43,issam....@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages