WhyCan Forum

人过留名,雁过留声,感谢各位朋友不离不弃地支持。 QQ: 516333132, 微信: whycan_cn (哇酷网/挖坑网/填坑网) admin@whycan.cn

您尚未登录。

#1 2019-11-27 12:29:05

MTLINUX
会员
注册时间: 2019-10-21
累计积分: 5

v3s bsp(linux3.4)下摄像头问题

参考licheepi zero BSP 内核(linux3.4) 编译教程  https://whycan.cn/t_682.html

直接使用晕哥的V3s_uboot_bsp_linux_qt_ethernet_tf(whycan.cn).7z用dd 命令直接写到卡上;
参考荔枝派指南http://zero.lichee.pro/  bsp编译部分
在linux3.4里 使能USB摄像头驱动 和 使能MIPI摄像头
重新编译linux3.4 并替换掉TF卡里的uImage;
先测试UVC摄像头:
在主线linux-zero-4.13.y下能正常使用的uvc视频显示在TFT上的demo,在BSP下提示错误如下:
改用https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/capture.c.html错误一样)

[   29.405222] uvcvideo: (f:uvc_dequeue_buffer, l:349) fatal error! v4l2_buffer->buf.byteused[614400]>=buflength[614400], jpeg picture may be cut!
定位到源码在:
Uvc_queue.c文件349行;
    if(buf->buf.bytesused >= buf->buf.length)
    {
        while(1)
        {
            uvc_printk(KERN_ERR, "(f:%s, l:%d) fatal error! v4l2_buffer->buf.byteused[%d]>=buflength[%d], jpeg picture may be cut!", __FUNCTION__, __LINE__, buf->buf.bytesused, buf->buf.length);
        }
        //panic("(f:%s, l:%d) fatal error! v4l2_buffer->buf.byteused[%d]>buflength[%d], jpeg picture may be cut!", __FUNCTION__, __LINE__, buf->buf.bytesused, buf->buf.length);
    }

请问这是什么问题?谢谢!

离线

#2 2019-11-27 13:11:43

daydayup
会员
注册时间: 2017-10-09
累计积分: 307

Re: v3s bsp(linux3.4)下摄像头问题

貌似缓冲区不够的样子

离线

#3 2019-11-27 13:41:37

MTLINUX
会员
注册时间: 2019-10-21
累计积分: 5

Re: v3s bsp(linux3.4)下摄像头问题

感谢回复!  新手不太懂,能提示下应该如何处理呢?谢谢!
top:
Mem: 11120K used, 18276K free, 72K shrd, 368K buff, 1852K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq

离线

#4 2019-11-27 14:03:00

smartcar
会员
注册时间: 2018-02-19
累计积分: 431

Re: v3s bsp(linux3.4)下摄像头问题

应该是驱动里面的缓冲区吧

离线

#5 2019-11-27 15:08:59

MTLINUX
会员
注册时间: 2019-10-21
累计积分: 5

Re: v3s bsp(linux3.4)下摄像头问题

bsp(linux3.4)直接下载的,我也没有修改,难道里面有bug?
不至于一个简单的uvc摄像头都有bug吧.

离线

#6 2019-11-27 15:10:13

jimmy
Moderator
注册时间: 2017-10-29
累计积分: 286

Re: v3s bsp(linux3.4)下摄像头问题

这些bsp都不知道哪里来的版本,问题多着呢

离线

#7 2019-11-28 10:36:45

MTLINUX
会员
注册时间: 2019-10-21
累计积分: 5

Re: v3s bsp(linux3.4)下摄像头问题

uvc问题: 新手胆大,直接修改 >=为= 后.重新编译替换uImage后.uvc正常;  至于修改后会影响到什么,就不知道了....

接下来测试mipi 5647,  ov5647插入一体板,测量脚位后,确定没有插错.
启动信息:

#  dmesg| grep VFE
[    1.080848] [VFE]cci probe start cci_sel = 0!
[    1.085888] [VFE]cci probe end cci_sel = 0!
[    1.090693] [VFE]cci_init end
[    1.094094] [VFE]Welcome to Video Front End driver
[    1.099863] [VFE]pdev->id = 0
[    1.103276] [VFE]dev->mipi_sel = 0
[    1.107153] [VFE]dev->vip_sel = 0
[    1.110929] [VFE]dev->isp_sel = 0
[    1.120805] [VFE_WARN]vfe vpu clock is null
[    1.132049] [VFE]vfe_init end
[    1.145318] [VFE]probe_work_handle start!
[    1.149865] [VFE]..........................vfe clk open!.......................
[    1.176110] [VFE]v4l2 subdev register input_num = 0
[    1.181719] [VFE]vfe sensor detect start! input_num = 0
[    1.187615] [VFE]Find sensor name is "ov5647_mipi", i2c address is 6c, type is "RAW" !
[    1.196597] [VFE]Sub device register "ov5647_mipi" i2c_addr = 0x6c start!
[    1.204321] [VFE]v4l2_device_register_subdev return 0
[    1.210031] [VFE]registered sensor subdev is OK!
[    1.215332] [VFE]Check sensor!
[    1.218809] [VFE]Sub device register "ov5647_mipi" is OK!
[    1.278688] [VFE]Check open /system/etc/hawkview/ov5647_mipi/isp_test_param.ini failed!
[    1.291831] [VFE_WARN]NOT found this item:  ov5647_mipi, you can add this ISP Config in the isp_cfg_array!
[    1.291843] [VFE]read ini start
[    1.295630] [VFE]Fetch ini file form "/system/etc/hawkview/ov5647_mipi/isp_test_param.ini"
[    1.330916] [VFE_WARN]read ini info fail
[    1.335784] [VFE]V4L2 device registered as video0
[    1.363807] [VFE]..........................vfe clk close!.......................
[    1.383766] [VFE]probe_work_handle end!

在dev下有video0设备;

以上是否表示OV5647 MIPI 驱动正常了呢?
由于不会编译 fswebcam ,无法用这个测试; 如果哪位知道如何编译安装,麻烦告之下.
ps: 帖子里晕哥有说 fswebcam 编译:
./configure --prefix=/usr --host=xxxxxxx --build=xxxxx
make
make install
但 新手并不知道xxx填什么...

改用 https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/capture.c.html 代码测试


# ./capture -d /dev/video0 -f
[ 2013.939408] [VFE]vfe_open
[ 2013.942933] [VFE]..........................vfe clk open!.......................
[ 2013.952171] [VFE]vfe_open ok
[ 2013.955682] [VFE_ERR]try yuv422 bus error when pix fmt is yuv422 interleaved at try_fmt_internal!
[ 2013.965781] [VFE_ERR]pixel format (0x56595559) width 640 height 480 invalid at vidioc_s_fmt_vid_cap.
VIDIOC_S_FMT error 22, Invalid a[ 2013.976891] [VFE]vfe_close
rgument\n[ 2013.982526] [VFE]vfe select input flag = 0, s_input have not be used .
[ 2013.990747] [VFE]..........................vfe clk close!.......................
[ 2013.999776] [VFE]vfe_close end


# ./capture -d /dev/video0 -r
[ 4037.443521] [VFE]vfe_open
[ 4037.446675] [VFE]..........................vfe clk open!.......................
[ 4037.455780] [VFE]vfe_open ok
[ 4037.459568] [VFE_ERR]csi is not generating!
[ 4037.465046] [VFE_ERR]csi is not generating!
read error 22, Invalid argument\[ 4037.470528] [VFE]vfe_close
n[ 4037.475881] [VFE]vfe select input flag = 0, s_input have not be used .
[ 4037.483454] [VFE]..........................vfe clk close!.......................
[ 4037.492184] [VFE]vfe_close end


请问,这表示什么呢,是哪里不正常,如何修改,谢谢!

最近编辑记录 MTLINUX (2019-11-28 10:40:48)

离线

#8 2019-11-30 21:03:06

MTLINUX
会员
注册时间: 2019-10-21
累计积分: 5

Re: v3s bsp(linux3.4)下摄像头问题

又研究了2天,还是没有搞定BSP下ov5647. 路过的大神帮忙看看吧. 或者哪位能提供个IMG让我烧进去看看也行啊.
谢谢!

怎么打印日志,不能发帖,提示: 标签不允许在其自身内部使用.

# dmesg| grep -e VFE  -e 5647
[    1.181372] [VFE]cci probe start cci_sel = 0!
[    1.186427] [VFE]cci probe end cci_sel = 0!
[    1.191236] [VFE]cci_init end
[    1.194634] [VFE]Welcome to Video Front End driver

[    1.200297] [VFE_DEBUG]vfe_probe
[    1.200434] [VFE]pdev->id = 0
[    1.203819] [VFE]dev->mipi_sel = 0
[    1.207700] [VFE]dev->vip_sel = 0
[    1.211492] [VFE]dev->isp_sel = 0

[    1.215347] [VFE_DEBUG]fetch sys_config1
[    1.215357] [VFE_DEBUG]dev->ccm_cfg[0] = c19f0494
[    1.215367] [VFE_DEBUG]dev->ccm_cfg[1] = c19f07a0
[    1.215381] [VFE_DEBUG]vip0 vip_dev_qty=1
[    1.215391] [VFE_DEBUG]vip0 vip_define_sensor_list=0
[    1.215444] [VFE_DEBUG]fetch vip_dev0_power_en from sys_config failed
[    1.215457] [VFE_DEBUG]fetch vip_dev0_flash_en from sys_config failed
[    1.215470] [VFE_DEBUG]fetch vip_dev0_flash_mode from sys_config failed
[    1.215483] [VFE_DEBUG]fetch vip_dev0_af_pwdn from sys_config failed
[    1.215502] [VFE_DEBUG]dev->ccm_cfg[0]->ccm = ov5647_mipi
[    1.215512] [VFE_DEBUG]dev->ccm_cfg[0]->twi_id = 0
[    1.215522] [VFE_DEBUG]dev->ccm_cfg[0]->i2c_addr = 6c
[    1.215532] [VFE_DEBUG]dev->ccm_cfg[0]->is_isp_used = 1
[    1.215541] [VFE_DEBUG]dev->ccm_cfg[0]->is_bayer_raw = 1
[    1.215551] [VFE_DEBUG]dev->ccm_cfg[0]->vflip = 0
[    1.215560] [VFE_DEBUG]dev->ccm_cfg[0]->hflip = 0
[    1.215569] [VFE_DEBUG]dev->ccm_cfg[0]->iovdd_str =
[    1.215577] [VFE_DEBUG]dev->ccm_cfg[0]->avdd_str =
[    1.215586] [VFE_DEBUG]dev->ccm_cfg[0]->dvdd_str =
[    1.215595] [VFE_DEBUG]dev->ccm_cfg[0]->afvdd_str =
[    1.215603] [VFE_DEBUG]dev->ccm_cfg[0]->act_used = 0
[    1.215611] [VFE_DEBUG]dev->ccm_cfg[0]->act_name = dw9714_act
[    1.215620] [VFE_DEBUG]dev->ccm_cfg[0]->act_slave = 0x18


[    1.221663] [VFE_WARN]vfe vpu clock is null

[    1.226412] [VFE_DEBUG]get io resource num = 3
[    1.226421] [VFE_DEBUG]get resource, name = csi
[    1.226439] [VFE_DEBUG]dev->regs.csi_regs = f1cb0000
[    1.226447] [VFE_DEBUG]get resource, name = isp
[    1.226458] [VFE_DEBUG]dev->regs.isp_regs = f1cb8000

[    1.226535] [VFE_DEBUG]isp load paddr = 42577000
[    1.226546] [VFE_DEBUG]isp load dma_addr = 02577000
[    1.226555] [VFE_DEBUG]isp load addr = c4a12000

[    1.226563] [VFE_DEBUG]isp saved paddr = 42578000
[    1.226571] [VFE_DEBUG]isp saved dma_addr = 02578000
[    1.226579] [VFE_DEBUG]isp saved addr = c4a16000

[    1.226586] [VFE_DEBUG]get irq resource

[    1.226614] [VFE_DEBUG]clock resource
[    1.226653] [VFE_DEBUG]vfe core clk = 297000000
[    1.226675] [VFE_DEBUG]get pin resource
[    1.233126] [VFE]vfe_init end


[    1.246383] [VFE]probe_work_handle start!
[    1.250943] [VFE_DEBUG]v4l2_device_register
[    1.250952] [VFE]..........................vfe clk open!.......................
[    1.277185] [VFE_DEBUG]vfe mipi csi clock  is null
[    1.277203] [VFE_DEBUG]v4l2 subdev register
[    1.277211] [VFE]v4l2 subdev register input_num = 0
[    1.282818] [VFE]vfe sensor detect start! input_num = 0
[    1.288715] [VFE]Find sensor name is "ov5647_mipi", i2c address is 6c, type is "RAW" !
[    1.297698] [VFE]Sub device register "ov5647_mipi" i2c_addr = 0x6c start!
[    1.305424] [VFE]v4l2_device_register_subdev return 0
[    1.311135] [VFE_DEBUG]ccm_cfg pt = c19f0494
[    1.311143] [VFE_DEBUG]ccm_cfg->sd = c1913080
[    1.311151] [VFE_DEBUG]module vflip = 0 hflip = 0
[    1.311160] [VFE_DEBUG]module vflip_thumb = 0 hflip_thumb = 0
[    1.311169] [VFE_DEBUG]module is_isp_used = 1 is_bayer_raw= 1
[    1.311176] [VFE]registered sensor subdev is OK!
[    1.316390] [VFE]Check sensor!
[    1.319952] [VFE]Sub device register "ov5647_mipi" is OK!
[    1.379762] [VFE]Check open /system/etc/hawkview/ov5647_mipi/isp_test_param.ini failed!
[    1.392979] [VFE]Match isp cfg ok
[    1.396840] [VFE_DEBUG]read ini end
[    1.396852] [VFE_DEBUG]dev->ccm_cfg[0] = c19f0494
[    1.396861] [VFE_DEBUG]dev->ccm_cfg[0]->sd = c1913080
[    1.396870] [VFE_DEBUG]dev->ccm_cfg[0]->power.iovdd =   (null)
[    1.396879] [VFE_DEBUG]dev->ccm_cfg[0]->power.avdd =   (null)
[    1.396888] [VFE_DEBUG]dev->ccm_cfg[0]->power.dvdd =   (null)
[    1.396896] [VFE_DEBUG]dev->ccm_cfg[0]->power.afvdd =   (null)
[    1.420354] [VFE]V4L2 device registered as video0
[    1.425804] [VFE]..........................vfe clk close!.......................
[    1.434148] [VFE_DEBUG]vfe mipi csi clock is null
[    1.434159] [VFE]probe_work_handle end!

[   14.446125] [VFE]vfe_open
[   14.449570] [VFE]..........................vfe clk open!.......................
[   14.461130] [VFE_DEBUG]vfe mipi csi clock  is null
[   14.461224] [VFE_DEBUG]isp_def_lut_tbl_vaddr[0] = c4a32000
[   14.461238] [VFE_DEBUG]isp_lsc_tbl_vaddr[0] = c4a32000
[   14.461248] [VFE_DEBUG]isp_gamma_tbl_vaddr[0] = c4a32600
[   14.461267] [VFE_DEBUG]isp_drc_tbl_vaddr[0] = c4a36000

[   14.461285] [VFE_DEBUG]dev->isp_stat_bq.isp_stat[i].isp_stat_buf.stat_buf[0] = c4a3a000
[   14.461304] [VFE_DEBUG]dev->isp_stat_bq.isp_stat[i].isp_stat_buf.stat_buf[1] = c4a40000
[   14.461322] [VFE_DEBUG]dev->isp_stat_bq.isp_stat[i].isp_stat_buf.stat_buf[2] = c4a46000
[   14.461341] [VFE_DEBUG]dev->isp_stat_bq.isp_stat[i].isp_stat_buf.stat_buf[3] = c4a4c000
[   14.461360] [VFE_DEBUG]dev->isp_stat_bq.isp_stat[i].isp_stat_buf.stat_buf[4] = c4a52000
[   14.461371] [VFE_DEBUG]tasklet init !

[   14.461379] [VFE]vfe_open ok

[   14.466701] [VFE_DEBUG]vidioc_s_fmt_vid_cap
[   14.466713] [VFE_DEBUG]try_fmt_internal
[   14.466732] [VFE_DEBUG]try bayer bus ok when pix fmt is bayer rgb at try_fmt_internal!
[   14.466743] [VFE_DEBUG]bus pixel code = 3019 at try_fmt_internal
[   14.466752] [VFE_DEBUG]pix->width = 1280 at try_fmt_internal
[   14.466761] [VFE_DEBUG]pix->height = 720 at try_fmt_internal
[   14.466770] [VFE_DEBUG]bus pixel code = 3019 at vidioc_s_fmt_vid_cap
[   14.466779] [VFE_DEBUG]pix->width = 1280 at vidioc_s_fmt_vid_cap
[   14.466788] [VFE_DEBUG]pix->height = 720 at vidioc_s_fmt_vid_cap
[   14.466803] [VFE]V4L2_MBUS_CSI2,2 lane,bus1 channel,rx 1 channel
[   14.490228] [OV5647_mipi]sensor_s_fmt
[   14.490495] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac070335
[   14.490745] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac070335
[   14.490993] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac070335
[   14.491004] [OV5647_mipi]sensor write retry=2
[   14.491246] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = acfa0f38
[   14.491492] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = acfa0f38
[   14.491737] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = acfa0f38
[   14.491747] [OV5647_mipi]sensor write retry=2
[   14.491990] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000e38
[   14.492235] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000e38
[   14.492480] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000e38
[   14.492491] [OV5647_mipi]sensor write retry=2
[   14.492738] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000832
[   14.492984] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000832
[   14.493230] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000832
[   14.493241] [OV5647_mipi]sensor write retry=2
[   14.493483] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac100b35
[   14.493728] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac100b35
[   14.493973] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac100b35
[   14.493984] [OV5647_mipi]sensor write retry=2
[   14.494226] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000a35
[   14.494471] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000a35
[   14.494717] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000a35
[   14.494727] [OV5647_mipi]sensor write retry=2
[   14.494970] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac600235
[   14.495215] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac600235
[   14.495463] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac600235
[   14.495474] [OV5647_mipi]sensor write retry=2
[   14.495716] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac0f0135
[   14.495968] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac0f0135
[   14.496214] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac0f0135
[   14.496225] [OV5647_mipi]sensor write retry=2
[   14.496467] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000035
[   14.496711] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000035
[   14.496956] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac000035
[   14.496967] [OV5647_mipi]sensor write retry=2
[   14.497210] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac100832
[   14.497454] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac100832
[   14.497699] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = ac100832
[   14.497710] [OV5647_mipi]sensor write retry=2
[   14.497952] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = aca00832
[   14.498197] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = aca00832
[   14.498443] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = aca00832
[   14.498453] [OV5647_mipi]sensor write retry=2
[   14.598741] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = bc000001
[   14.598997] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = bc000001
[   14.599244] [VFE CCI_0 ERR] Status error at addr_8bit = 6c, wr_flag = 0, val = bc000001
[   14.599255] [OV5647_mipi]sensor write retry=2
[   14.599265] [OV5647_mipi]error at sensor_write_array
[   14.599273] [OV5647_mipi]error at sensor_s_fmt
[   14.599281] [VFE_ERR]v4l2 sub device s_fmt error!
[   14.605346] [VFE]vfe_close
[   14.609643] [VFE]vfe select input flag = 0, s_input have not be used .
[   14.617210] [VFE]..........................vfe clk close!.......................
[   14.625772] [VFE_DEBUG]vfe mipi csi clock is null
[   14.625826] [VFE]vfe_close end

最近编辑记录 MTLINUX (2019-11-30 21:11:31)

离线

#9 2019-11-30 22:03:30

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 8,491

Re: v3s bsp(linux3.4)下摄像头问题

离线

页脚