您尚未登录。

楼主 #1 2019-10-24 11:20:38

2505300733
会员
所在地: 广州
注册时间: 2019-10-24
已发帖子: 29
积分: 29

全志A40I的OV5640摄像头驱动问题

设备:全志A40I 要驱动的设备是OV5640的摄像头
说明:
开发平台是居于AndroidM
开机启动打印出的信息如下。VFE成功安装进内核里面打印信息如下:
**************************************************************************************

[    3.535279] [VFE]cci_init end
[    3.538520] [VFE]Welcome to Video Front End driver
[    3.544193] [VFE]csi0 probe end!
[    3.547810] [VFE]csi1 probe end!
[    3.551833] [VFE]csi_init end
[    3.555572] [VFE]sunxi_isp_platform_register end
[    3.561167] [VFE]mipi_init end
[    3.564510] [VFE]flash_init end
[    3.570307] [VFE]pdev->id = 0
[    3.573550] [VFE]dev->cci_sel = 0
[    3.577165] [VFE]dev->csi_sel = 0
[    3.580975] [VFE]dev->mipi_sel = 0
[    3.584686] [VFE]dev->isp_sel = 0
[    3.588337] [VFE_WARN]fetch csi0_dev0_iovdd from device_tree failed
[    3.595435] [VFE_WARN]fetch csi0_dev0_avdd from device_tree failed
[    3.602313] [VFE_WARN]fetch csi0_dev0_dvdd from device_tree failed
[    3.609068] [VFE_WARN]fetch csi0_dev0_afvdd from device_tree failed
[    3.616155] [VFE_WARN]fetch csi0_dev0_power_en from device_tree failed
[    3.623459] [VFE_WARN]fetch csi0_dev0_flash_en from device_tree failed
[    3.630727] [VFE_WARN]fetch csi0_dev0_flash_mode from device_tree failed
[    3.638049] [VFE_WARN]fetch csi0_dev0_flvdd from device_tree failed
[    3.645142] [VFE_WARN]fetch csi0_dev0_flvdd_vol from device_tree failed
[    3.650074] usb 4-1: new full-speed USB device number 2 using sunxi-ohci
[    3.659935] [VFE_WARN]fetch csi0_dev0_af_pwdn from device_tree failed
[    3.667699] [VFE]vfe_init end
[    3.671033] [VFE]probe_work_handle start!
[    3.675818] [VFE]vfe_runtime_resume
[    3.680247] usbcore: registered new interface driver uvcvideo
[    3.686759] USB Video Class driver (v1.0.25_SONiX_v3.10.56)
[    3.693081] [VFE]..........................vfe clk open!.......................
[    3.701233] [VFE]v4l2 subdev register input_num = 0
[    3.701246] sunxi cedar version 0.1
[    3.701384] VE: install start!!!
[    3.701384]

[    3.701464] cedar_ve: cedar-ve the get irq is 85
[    3.702331] VE: install end!!!
[    3.745934] [VFE]vfe sensor detect start! input_num = 0
[    3.751757] [VFE]Find sensor name is "ov5640", i2c address is 78, type is "YUV" !
[    3.760081] [VFE]Sub device register "ov5640" i2c_addr = 0x78 start!
[    3.760088] device-mapper: uevent: version 1.0.3
[    3.772978] device-mapper: ioctl: 4.24.0-ioctl (2013-01-15) initialised: dm-devel@redhat.com
[    3.773298] [VFE]registered sensor subdev is OK!
[    3.773302] [VFE]Check sensor!
[    3.786620] [VFE]mclk on

[    4.258508] [VFE]mclk off
[    4.294711] [VFE]Sub device register "ov5640" is OK!
[    4.295231] [VFE]V4L2 device registered as video2
[    4.295274] [VFE]vfe_runtime_suspend
[    4.295277] [VFE]..........................vfe clk close!.......................
[    4.301581] [VFE]probe_work_handle end!


******************************************************************************************
在开机的过程中抓到MCLK和SDA和SCL都是有信号,有对应的波形。并且抓到I2C通信成功。
开机完之后检测摄像头的各个引脚的时候。三个电源都正常在,并且复位引脚引脚为高
睡眠引脚为低。 MCLK有电压出现,但是没有对应的波形。
进入ADB模式之后 ls /dev/video*
**************************************

/dev/video2
/dev/video5
/dev/video6
/dev/video7

*************************************

出现了对应的设备。
在I2C-3的目录下都发现了我对应设备的名字:
****************
cd /sys/class/i2c-adapter/i2c-3/3-003c 
cat name

#a40i:   ov5640


****************
但是在安卓系统部分启动的时候发现打印出一个这个提示:
**************************************************
[   63.709808] vidioc_g_fmt_vid_cap: signal is not locked.
[   63.927192] vidioc_g_fmt_vid_cap: signal is not locked.
[   64.140787] vidioc_g_fmt_vid_cap: signal is not locked.
[   64.354394] vidioc_g_fmt_vid_cap: signal is not locked.
[   64.567889] vidioc_g_fmt_vid_cap: signal is not locked.
[   64.785277] vidioc_g_fmt_vid_cap: signal is not locked.

**************************************************

正常进入到安卓系统里面的时候,点击相机出现以下两种情况
一、拍照情况下全部都是黑屏,但是点击拍照按钮还是会有提示音。
     但是整个拍照都图案都是黑色,连拍出来得到图片都是黑色的

二、在录视频的情况下,就会直接提示出相机发生错误 无法连接到相机
     且每一次都打印出下面的提示。说索取信号失败。
三、在打开相机的是会发现MCLK这个引脚没有时钟,但是电压保持正常。
*********************************************************
tvd_close:__tvd_3d_comp_mem_free
hpd :tvd_num[] = 4,g_status[] =401,
tvd_onsingal=vidioc_g_fmt_vid_cap: signal is not locked.
vidioc_s_fmt_vid_cap:dev_sel=0
hpd :tvd_num[] = 4,
g_status[] =400,
tvd_onsingal=0
****************************************************************
上面四打印提示,经过百度多次都无果。 在这里请大家帮个忙。再次谢谢了

一、怀疑方向有内核层没有给对正确的VFE设备给安卓层调用,所以安卓系统开机的时候没有获取到时钟,由于
      对安卓系统不熟悉没办法验证。

二、 由于开机过程中有MCLK出现并且也成功注册设备成功,怀疑是安卓层和内核层之间的数据交流出现误差,但是具体的沟通文   
     件没办法丁文

三、由于看到最后打印出以下对话可能是MCLK睡眠过去了,但是没有找到对应的方法或者是没有用对方法将其唤醒。
     *********************
[    4.060054] [VFE]mclk off
[    4.096233] [VFE]Sub device register "ov5640" is OK!
[    4.096719] [VFE]V4L2 device registered as video2
[    4.096764] [VFE]vfe_runtime_suspend
    *********************


在整个系统里面,动过的文件有sys_config.fex   camera.cfg     menuconfig配置   sunxi-vfe/devices。ov5640.c
VFE该加的驱动文件都加上去了。但是安卓系统的照相机就是没有办法工作起来,并且没有mclk。 

有调过的大神希望不舍赐教,小弟在这里不胜感激,  刚毕业出来才疏学浅,有什么问题描述不完整的希望赐教

QQ:2505300733


下面附上我的camera.cfg的配置:
;-------------------------------------------------------------------------------
; 用于camera的配置
;
; 采用格式:
; key = key_value
; 注意: 每个key需要顶格写;
; key_value紧跟着key后面的等号后面, 位于同一行中;
; key_value限制大小为256字节以内;
;
;-------------------------------------------------------------------------------
; exif information of "make" and "model"
;-------------------------------------------------------------------------------
key_camera_exif_make = MAKE_A33
key_camera_exif_model = MODEL_A33
;
; 1 for single camera, 2 for double camera
;-------------------------------------------------------------------------------
number_of_camera = 2
;-------------------------------------------------------------------------------
; CAMERA_FACING_BACK
; hi253
;-------------------------------------------------------------------------------
camera_id = 1
;-------------------------------------------------------------------------------
; 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 = 0
;-------------------------------------------------------------------------------
; driver device name
;-------------------------------------------------------------------------------
camera_device = /dev/video2
;-------------------------------------------------------------------------------
; device id
; for two camera devices with one CSI
;-------------------------------------------------------------------------------
device_id = 0
used_preview_size = 1
key_support_preview_size = 720x576
key_default_preview_size = 720x576
used_picture_size = 1
key_support_picture_size = 720x576
key_default_picture_size = 720x576
used_flash_mode = 0
key_support_flash_mode = on,off,auto,red-eye,torch
key_default_flash_mode = off
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 = 0
key_support_focus_mode = auto,infinity,macro,fixed
key_default_focus_mode = auto
;used_scene_mode = 0
;----------------------------------------------------
;key_support_scene_mode = auto,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,steadyphoto,fireworks,sports,party,candlelight,barcode,hdr
;----------------------------------------------------
key_default_scene_mode = auto
used_scene_mode = 0
key_support_scene_mode = auto,hdr
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 = 4
key_min_exposure_compensation = -4
key_step_exposure_compensation = 1
key_default_exposure_compensation = 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
key_horizonal_view_angle = 48
key_vertical_view_angle = 39.4
;-------------------------------------------------------------------------------
; CAMERA_FACING_FRONT
; sp0a19
;------------------------------------------------------------------------------camera_id = 1
;-------------------------------------------------------------------------------
; 1 for camera without isp(using built-in isp of Axx)
; 0 for camera with isp
;------------------------------------------------------------------------------use_builtin_isp = 0
;-------------------------------------------------------------------------------
; 1 for CAMERA_FACING_FRONT
; 0 for CAMERA_FACING_BACK
;-------------------------------------------------------------------------------
camera_facing = 1
;-------------------------------------------------------------------------------
; camera orientation (0, 90, 180, 270)
;-------------------------------------------------------------------------------
camera_orientation = 0
;-------------------------------------------------------------------------------
; driver device name
;-------------------------------------------------------------------------------
camera_device = /dev/video2
;-------------------------------------------------------------------------------
; device id
; for two camera devices with one CSI
;-------------------------------------------------------------------------------
device_id = 1
used_preview_size = 1
key_support_preview_size = 640x480,320x240,176x144
key_default_preview_size = 640x480
used_picture_size = 1
key_support_picture_size = 640x480,320x240
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 = 0
key_support_focus_mode = auto,infinity,macro,fixed
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 = 4
key_min_exposure_compensation = -4
key_step_exposure_compensation = 1
key_default_exposure_compensation = 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
key_horizonal_view_angle = 44.6
key_vertical_view_angle = 39.4

离线

#2 2019-10-24 11:33:09

xyzijk
会员
注册时间: 2019-08-23
已发帖子: 31
积分: 19.5

Re: 全志A40I的OV5640摄像头驱动问题

android版本6.0还是7.1?

离线

楼主 #3 2019-10-24 14:16:25

2505300733
会员
所在地: 广州
注册时间: 2019-10-24
已发帖子: 29
积分: 29

Re: 全志A40I的OV5640摄像头驱动问题

xyzijk 说:

android版本6.0还是7.1?

Android M

离线

楼主 #4 2019-10-24 14:19:47

2505300733
会员
所在地: 广州
注册时间: 2019-10-24
已发帖子: 29
积分: 29

Re: 全志A40I的OV5640摄像头驱动问题

这个是Android M  也就是所谓的6吧。    排查到目前为止,发现可能是CSI和TVIN这两个设备冲突了。    但是不知道哪里切换摄像头的类型,在A40I的情况下带有两种摄像头的。 按照招引信息排查驱动代码发现的TVIN这方面。   也就是说安卓层可能调用的是TVIN摄像头(但是我没有配置TVIN摄像头)。  但是不知道数字摄像头怎么切换上去,知道的哥们说下 谢谢

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn