Wiki Home » imx6 tinyrex » camera

camera

Last modified by Administrator on 2017/01/27 06:34

Info

OV5647 MIPI (RPi camera module 1.3)

Not every Raspberry Pi Camera Rev 1.3 is detected over i2c. There are some models that does not work.

Bootlog

OV5647 is successfully detected.

Kernel 4.1

...
camera ov5647_mipi is found
...

Kernel 3.14

...
camera ov5647_mipi is found
mxc_v4l2_master_attach: ipu(0:0)/csi(1:0)/mipi(1:0) doesn't match
mxc_v4l2_master_attach: ipu0:/csi1 mipi attached ov5647_mipi:mxc_v4l2_cap1
ERROR: v4l2 capture: slave not found!
...

I2C detect

I2C address is 0x36.

[email protected]:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- UU -- -- -- 3a -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --   

GPIO control

GPIO pins are controlled by camera driver and access to this pins are blocked. 

Power on gpio is 74.
LED gpio is 54.

[email protected]:~# modprobe -r ov5647_camera_mipi
[email protected]:~# echo 54 > /sys/class/gpio/export
[email protected]:~# echo out > /sys/class/gpio/gpio54/direction
[email protected]:~# echo 1 > /sys/class/gpio/gpio54/value
[email protected]:~# echo 0 > /sys/class/gpio/gpio54/value
[email protected]:~# echo 54 > /sys/class/gpio/unexport
[email protected]:~# modprobe ov5647_camera_mipi

Modules

Kernel 4.1

[email protected]:~# lsmod
Module                  Size  Used by
mxc_v4l2_capture       27624  2
ipu_bg_overlay_sdc      5385  1 mxc_v4l2_capture
ipu_still               2331  1 mxc_v4l2_capture
ipu_prp_enc             5903  1 mxc_v4l2_capture
ipu_csi_enc             3904  1 mxc_v4l2_capture
ipu_fg_overlay_sdc      6130  1 mxc_v4l2_capture
ov5647_camera_mipi_int    30566  0
adv7610_video           6373  0
v4l2_int_device         2872  4 ov5647_camera_mipi_int,adv7610_video,ipu_csi_enc,mxc_v4l2_capture
mxc_dcic                6528  0

Kernel 3.14

[email protected]:~# lsmod
Module                  Size  Used by
mxc_v4l2_capture       28532  1
ipu_bg_overlay_sdc      5401  1 mxc_v4l2_capture
ipu_still               2528  1 mxc_v4l2_capture
ipu_prp_enc             5943  1 mxc_v4l2_capture
ipu_csi_enc             3863  1 mxc_v4l2_capture
ipu_fg_overlay_sdc      6217  1 mxc_v4l2_capture
ov5647_camera_mipi     30906  0
v4l2_int_device         2930  2 ov5647_camera_mipi,mxc_v4l2_capture
mxc_dcic                6569  0
evbug                   1875  0

Resolution change

1280x960

echo 0 > /sys/bus/i2c/devices/1-0036/ov5647_mode

1280x720

echo 1 > /sys/bus/i2c/devices/1-0036/ov5647_mode

1920x1080

echo 2 > /sys/bus/i2c/devices/1-0036/ov5647_mode

640x480

echo 3 > /sys/bus/i2c/devices/1-0036/ov5647_mode

1024x768(default)

echo 4 > /sys/bus/i2c/devices/1-0036/ov5647_mode

960x720

echo 5 > /sys/bus/i2c/devices/1-0036/ov5647_mode

640x480(narrow angle of view)

echo 6 > /sys/bus/i2c/devices/1-0036/ov5647_mode 

Gstreamer

Capture single JPEG picture

echo 2 > /sys/bus/i2c/devices/1-0036/ov5647_mode
gst-launch-1.0 v4l2src device="/dev/video1" num-buffers=1 ! video/x-bayer,width=1920,height=1080,framerate=30/1 ! bayer2rgb ! videoconvert ! jpegenc ! filesink location=sample_1920_1080.jpeg

Video preview

echo 2 > /sys/bus/i2c/devices/1-0036/ov5647_mode
gst-launch-1.0 v4l2src device="/dev/video1" ! video/x-bayer,width=1920,height=1080,framerate=30/1 ! queue ! bayer2rgb ! videoconvert ! fbdevsink
echo 3 > /sys/bus/i2c/devices/1-0036/ov5647_mode
gst-launch-1.0 v4l2src device="/dev/video1" ! video/x-bayer,width=640,height=480,framerate=15/1 ! bayer2rgb ! videoconvert ! fbdevsink
Tags:
Created by Administrator on 2015/11/01 19:29

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.1 - Documentation