【原创】全志A64平台调通OV5640摄像头V1.0版本

全志A64平台调通OV5640摄像头

大文实验室出品

2017/5/25 15:48

版本:V1.0

开发板:BPI-M64开发板

1、

R:\wyb\ov5640_bpi_a64_android\android\device\softwinner\bpi-m64-lcd\configs\camera.cfg

used_preview_size = 1

key_support_preview_size = 1280x720,640x480

key_default_preview_size = 1280x720

used_picture_size = 1

key_support_picture_size = 1280x720,640x480

key_default_picture_size = 1280x720

修改为:

used_preview_size = 1

key_support_preview_size = 2592x1936, 2048x1536, 1600x1200, 1280x960, 1280x960, 1024x768, 1920x1080 ,1280x720, 800x600, 640x480

key_default_preview_size = 640x480

used_picture_size = 1

key_support_picture_size = 2592x1936, 2048x1536, 1600x1200, 1280x960, 1280x960, 1024x768, 1920x1080 ,1280x720, 800x600, 640x480

key_default_picture_size = 640x480

分辨率来源:

R:\wyb\ov5640_bpi_a64_android\lichee\linux-3.10\drivers\media\platform\sunxi-vfe\device\ov5640.c

关键词搜索:_regs]

取前几项就可以得知驱动中配置好的分辨率:

static struct regval_list sensor_default_regs] = {

static struct regval_list sensor_qsxga_regs] = { //qsxga: 2592*1936

static struct regval_list sensor_qxga_regs] = { //qxga: 2048*1536

static struct regval_list sensor_uxga_regs] = { //UXGA: 1600*1200

static struct regval_list sensor_sxga_regs] = { //SXGA: 1280*960

static struct regval_list sensor_xga_regs] = { //XGA: 1024*768

static struct regval_list sensor_1080p_regs] = { //1080: 1920*1080

static struct regval_list sensor_720p_regs] = { //1280*720

static struct regval_list sensor_svga_regs] = { //SVGA: 800*600

static struct regval_list sensor_vga_regs] = { //VGA: 640*480

最终版本为:

;-------------------------------------------------------------------------------

; 用于camera的配置

;

; 采用格式:

; key = key_value

; 注意: 每个key需要顶格写;

; key_value紧跟着key后面的等号后面, 位于同一行中;

; key_value限制大小为256字节以内;

;

;-------------------------------------------------------------------------------

;-------------------------------------------------------------------------------

; exif information of “make” and “model”

;-------------------------------------------------------------------------------

key_camera_exif_make = MAKE_A64

key_camera_exif_model = MODEL_A64

;-------------------------------------------------------------------------------

; 1 for single camera, 2 for double camera

;-------------------------------------------------------------------------------

number_of_camera = 1

;-------------------------------------------------------------------------------

; CAMERA_FACING_BACK

; ov5640

;-------------------------------------------------------------------------------

camera_id = 0

;-------------------------------------------------------------------------------

; 1 for CAMERA_FACING_FRONT

; 0 for CAMERA_FACING_BACK

;-------------------------------------------------------------------------------

camera_facing = 0

;-------------------------------------------------------------------------------

; 1 for camera without isp(using built-in isp of Axx)

; 0 for camera with isp

;-------------------------------------------------------------------------------

use_builtin_isp = 0

;-------------------------------------------------------------------------------

; camera orientation (0, 90, 180, 270)

;-------------------------------------------------------------------------------

camera_orientation = 180

;-------------------------------------------------------------------------------

; driver device name

;-------------------------------------------------------------------------------

camera_device = /dev/video0

;-------------------------------------------------------------------------------

; device id

; for two camera devices with one CSI

;-------------------------------------------------------------------------------

device_id = 0

used_preview_size = 1

key_support_preview_size = 2592x1936, 2048x1536, 1600x1200, 1280x960, 1280x960, 1024x768, 1920x1080 ,1280x720, 800x600, 640x480

key_default_preview_size = 640x480

used_picture_size = 1

key_support_picture_size = 2592x1936, 2048x1536, 1600x1200, 1280x960, 1280x960, 1024x768, 1920x1080 ,1280x720, 800x600, 640x480

key_default_picture_size = 640x480

used_flash_mode = 0

key_support_flash_mode = on,off,auto

key_default_flash_mode = on

used_color_effect = 1

key_support_color_effect = none,mono,negative,sepia,aqua

key_default_color_effect = none

used_frame_rate = 1

key_support_frame_rate = 30

key_default_frame_rate = 30

used_focus_mode = 1

key_support_focus_mode = auto,infinity,macro,fixed,continuous-video,continuous-picture

key_default_focus_mode = auto

used_scene_mode = 0

key_support_scene_mode = auto,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,steadyphoto,fireworks,sports,party,candlelight,barcode

key_default_scene_mode = auto

used_white_balance = 1

key_support_white_balance = auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight

key_default_white_balance = auto

used_exposure_compensation = 1

key_max_exposure_compensation = 3

key_min_exposure_compensation = -3

key_step_exposure_compensation = 1

key_default_exposure_compensation = 0

key_horizonal_view_angle = 48.6

key_vertical_view_angle = 37.0

used_zoom = 1

key_zoom_supported = true

key_smooth_zoom_supported = false

key_zoom_ratios = 100,120,150,200,230,250,300

key_max_zoom = 30

key_default_zoom = 0

2、(已经默认加载OV5640了,不用修改:)

R:\wyb\ov5640_bpi_a64_android\android\device\softwinner\bpi-m64-lcd\init.sun50iw1p1.rc

    # csi module


insmod /system/vendor/modules/videobuf2-core.ko


insmod /system/vendor/modules/videobuf2-memops.ko


insmod /system/vendor/modules/videobuf2-dma-contig.ko


insmod /system/vendor/modules/vfe_io.ko


insmod /system/vendor/modules/actuator.ko


insmod /system/vendor/modules/dw9714_act.ko


insmod /system/vendor/modules/ov5640.ko


insmod /system/vendor/modules/vfe_v4l2.ko

3、(已经默认加载video0了,不用修改:)

R:\wyb\ov5640_bpi_a64_android\android\device\softwinner\bpi-m64-lcd\ueventd.sun50iw1p1.rc

/dev/video0 0770 media media

#/dev/video1 0770 media media

4、(已经默认加载OV5640了,不用修改:)

R:\wyb\ov5640_bpi_a64_android\lichee\linux-3.10\drivers\media\platform\sunxi-vfe\device\ov5640.c

R:\wyb\ov5640_bpi_a64_android\lichee\linux-3.10\drivers\media\platform\sunxi-vfe\device\Makefile

obj-m += ov5640.o

5、R:\wyb\ov5640_bpi_a64_android\lichee\tools\pack\chips\sun50iw1p1\configs\bpi-m64-lcd\sys_config.fex

[csi0]

csi0_used = 1

csi0_sensor_list = 1

csi0_pck = port:PE00<2>

csi0_mck = port:PE01<0><0><1><0>

修改为:

(很难让人相信全志的工程师不是蓄意的。不配置MCLK,你的摄像头肯定不会亮的呀!^_直接让你没脾气,全志的老板可以让你见一次打一次!!!!)

[csi0]

csi0_used = 1

csi0_sensor_list = 0

csi0_pck = port:PE00<2>

csi0_mck = port:PE01<2>

6、可选修改:

R:\wyb\ov5640_bpi_a64_android\android\frameworks\base\packages\SettingsProvider\res\values\defaults.xml

<integer name="def_screen_off_timeout">60000</integer>

修改为:

<integer name="def_screen_off_timeout">1800000</integer>










<bool name="def_lockscreen_disabled">false</bool>

修改为:

<bool name="def_lockscreen_disabled">true</bool>

7、可选修改:

R:\wyb\ov5640_bpi_a64_android\lichee\tools\pack\chips\sun50iw1p1\configs\default\env.cfg

loglevel=4

#uboot system env config

bootdelay=0

修改为:

loglevel=8

#uboot system env config

bootdelay=3