Using Raspberry Pi MIPI Cameras with Rock Pi4


#1

Hi everyone,

I am trying to use the 15pin MIPI cameras with the Rock Pi board. Can someone help me set it up? Are there any drivers for this?

Thanks,
Rohan


#2

Hi, Rohan

Which camera are you using? This one works out of box on ROCK Pi 4 with Android All image and Debian Desktop image:

https://www.raspberrypi.org/products/camera-module-v2/


#3

Okay, I will see if I can use the one I have. It’s an IR camera:

https://www.evelta.com/communication/camera-module/rpi-camera-e


#4

Hi Jack,

Are there documentations available for using the pi camera on Debian Desktop? Something like https://picamera.readthedocs.io/en/release-1.13/


#5

Hi, Mickey

The doc is awesome. I am sorry currently we don’t have a doc like that. So you prefer to use python to capture the images? We support standard gstreamer, I think we will write the camera docs based on the python gstreamer binding.


#6

I have used gstreamer before. Python binding is useful but it’s fine if you don’t have it right now. Could you share whatever doc you have on using the camera so that we can get started once we get the boards on Thursday? What we need include setting camera gain and exposure time, take images and videos (preferably with hardware encoding). And on what linux distribution is the camera supported? Debian Desktop or Ubuntu server or both?


#7

Hi,

@jack, Is hardware accelerated video capture is supported? If yes, can you please share gstreamer command line to capture video with hardware acceleration (any sink)?

Regards, Alex


#8

Hi, Volax

I am not a gstreamer expert but here are some links you can refer:

The gstreamer-rockchip-extra package is pre-installed in the debian desktop image(not in the ubuntu server image).


#9

I’d like to report that the following command is working (w/ pi camera v2.1):

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080 ! rkximagesink

Before trying the command I did the following:
sudo apt-get install git gcc make texinfo libncurses5-dev libexpat1-dev flex bison dejagnu libc6-dbg gdb valgrind


#10

Hi Mickey, it’s great that you got it working! I tried to do the same, but I wasn’t able to compile rockchip-gstreamer-extras successfully. I tried following the instructions by @lex on this page: https://forum.armbian.com/topic/8879-made-some-progress-with-the-nanopc-t4-today. Can you elaborate further about how to get it working with Ubuntu 18.04?


#11

For armhf image, we have pre-installed the gstreamer-rockchip-extra package. For Ubuntu 18.04 arm64, you can just install the gstreamer-rockchip-extra package from:

https://github.com/rockchip-linux/rk-rootfs-build/tree/master/packages/arm64/video/gstreamer


#12

Hi themathgeek13, I used the debian desktop image (https://dl.radxa.com/rockpi/images/debian/rockpi4_debian_stretch_lxde_armhf_20181105_2120-gpt.img.gz) where gstreamer is preinstalled.


#13

I get this error:

WARNING: erroneous pipeline: no element “rkximagesink”

I do not understand what it about.

Before i also have to install

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

and after

sudo apt-get install git gcc make texinfo libncurses5-dev libexpat1-dev flex bison dejagnu libc6-dbg gdb valgrind


#14

Hi,

Is tis model supported by the rockpi 4b

Raspberry Pi night vision camera , compatible with Raspberry Pi 3B+/3/2

5 million pixel OV5647 camera

Camera specification:

Lens : 1/4 5M

Aperture (F): 1.8

Focal length (Focal Length): 3.6MM ( adjustable)

FOV (Diagonal): 60 degrees

Best pixel sensor : 1080p

Size : 25mm x 24mm x 22mm


#15

@Pierre, I am also trying the same camera. But after installing the gstreamer-rockchip-extra package successfully from the repository given by @jack above, it still does not work for me, I get an error saying “unable to allocate memory” and the pipeline shuts down without showing any output on the display. Can someone help to resolve this? I think all the necessary packages are installed, and I also upgraded to the latest Radxa kernel version for Ubuntu Server 18.04.


#16

So far, we don’t support this sensor, yet. We support ov5645 but ov5647 is not tested. I suggest to test on Debian Stretch armhf desktop first. It’s pre-installed all the packages with gstreamer and proven working with ov5645 and imx219.


#17

Hi @jack, @themathgeek13,
I found this: https://www.tldp.org/HOWTO/Webcam-HOWTO/hardware.html , https://github.com/6by9/raspiraw and finaly http://html.alldatasheet.com/html-pdf/587045/OMNIVISION/OV5647/1204/2/OV5647.html (Maybe this can help)
But so far am unable to make the camera work. I am on the latest Ubuntu Image.
Is there a guide or Howto to writing a driver/kernel module for our cameras?

Thanks
Pierre


#18

Hi, Pierre

I am glad that you would like to get the ov5647 sensor working. I think basically, you can just use the ov5647 dirver from the kernel and configure the rockpi4 dts fowlloing imx219 part.

ov5647 driver is in the kernel now.

https://github.com/radxa/kernel/blob/release-4.4-rockpi4/drivers/media/i2c/ov5647.c

and imx219 device tree:

https://github.com/radxa/kernel/blob/6520deb8977caa4f6b5fbaa0330b35eeeb2ceae3/arch/arm64/boot/dts/rockchip/rockpi-4b-linux.dts#L611

For how to compile the kernel:

https://wiki.radxa.com/Rockpi4/dev/kernel-4.4


#19

thanks i will try it


#20

When i did the install with dpkg -i linux-image-4.4.154-999-rockchip-_all.deb linux-firmware-image-4.4.154-999-rockchip-_all.deb

It installed it on the emmc and it would not boot from the SSD. I had to re-edit the > Edit /boot/extlinux/extlinux.conf

But now I am wondering if I install it correctly.

When I did a dmesg | grep cam or vid
I do not see the cam detected.
I do not see any modules available in the directory to load in the kernel

@jack can you give me a Hit on what I did incorrectly Thanks!

@ themathgeek13 Did you get a chance to try this? Did it work?

Thanks
Pierre