Toybrick

【TOYBRICK】Fedora读取OV9750 MIPI摄像头问题

JoelYang

新手上路

积分
24
楼主
发表于 2020-4-20 10:30:02    查看: 8391|回复: 4 | [复制链接]    打印 | 只看该作者
按照Wiki上面的说明,自己写了一个小例子,但是运行报错。源代码:
  1. #include <rockchip/rockchip_isp.h>
  2. #include <rockchip/rockchip_drm.h>
  3. extern "C"{
  4. #include <rockchip/rockchip_rga.h>
  5. }

  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. void* engine;
  9. int vidFd;
  10. const char ispNode[] = "/dev/video0";
  11. const char tuningFile[] = "/etc/cam_iq_ov9750.xml";

  12. int main(int argc, char** argv)
  13. {
  14.         unsigned char* data;
  15.         data = (unsigned char*)malloc(1920 * 1080 * sizeof(unsigned char));
  16.         RockchipRga* myRga;

  17.         if(rkisp_start(engine, vidFd, ispNode, tuningFile))
  18.         {
  19.                 printf("Error For Init RKISP Start\n");
  20.                 return -1;
  21.         }

  22.         myRga = RgaCreate();
  23.         if(myRga == NULL)
  24.         {
  25.                 printf("Error For Create Rga\n");
  26.                 return -1;
  27.         }

  28.         myRga->ops->initCtx(myRga);

  29.         myRga->ops->setSrcBufferFd(myRga, vidFd);
  30.         myRga->ops->setDstBufferPtr(myRga, data);

  31.         myRga->ops->setDstFormat(myRga, V4L2_PIX_FMT_ARGB32, 1920, 1080);
  32.         myRga->ops->setSrcFormat(myRga, V4L2_PIX_FMT_SGRBG10, 1920, 1080);


  33.         while(true)
  34.         {
  35.                 myRga->ops->go(myRga);

  36.         }
复制代码

1、报错信息
  1. CAMHALInfo:   CAMHALVERSION is: 2.0.8.0

  2. CAMHALError:  ERR(getSensorModeData): RK_VIDIOC_SENSOR_MODE_DATA failed, err: Inappropriate ioctl for device

  3. CAMHALInfo:   CAMIAVERSION is: 2.0.9.0

  4. CAMHALInfo:   init:tuningFile /etc/cam_iq_ov9750.xml
  5. CAMHALInfo:   load tunning file success.
  6. AWB: AwbConfigure: AWB_VERSION_10

  7. AWB: AwbPrepareCalibDbAccess: resolution (0x0@2129354592) not found in database

  8. CAMHALError:  initDynamic:awb config failure!
  9. CAMHALError:  cam_ia10_isp_dpcc_config: resolution (0x0) not found in database

  10. CAMHALError:  runManISP:config DPCC failed !
  11. CAMHALError:  cam_ia10_isp_bls_config: resolution (0x0) not found in database

  12. CAMHALError:  runManISP:config BLS failed !
  13. CAMHALInfo:   (null): resolution (0x2129351192) not found in database

  14. CAMHALInfo:   fail to get no FilterProfile, ret: 13
  15. CAMHALError:  runManISP:config FLT failed !
  16. Segmentation fault
复制代码
2、ls /dev/video*信息

3、dmesg | grep cif

4、dmesg | grep ov9750
  1. [    2.153714] ov9750 1-0010: probing cam_num:0 0x10
  2. [    2.155803] ov9750 1-0010: probing successful
  3. [    2.167542] ov9750 1-0036: Error applying setting, reverse things back
  4. [    2.170114] ov9750 1-0036: probing cam_num:1 0x36
  5. [    2.172498] ov9750 1-0036: probing successful
  6. [    2.185581] ov9750 2-0010: Error applying setting, reverse things back
  7. [    2.188401] ov9750 2-0010: probing cam_num:2 0x10
  8. [    2.191022] ov9750 2-0010: probing successful
  9. [    2.205697] ov9750 2-0036: Error applying setting, reverse things back
  10. [    2.208878] ov9750 2-0036: probing cam_num:3 0x36
  11. [    2.211908] ov9750 2-0036: probing successful
  12. [    2.626166] ov9750.pltfrm_camera_module_get_data WARN: could not get default pinstate
  13. [    2.628032] ov9750.pltfrm_camera_module_get_data WARN: could not get sleep pinstate
  14. [    2.665238] ov9750.ov_camera_module_write_config(180) ERR: no active sensor configuration
  15. [    2.665989] ov9750.ov_camera_module_write_config(231) ERR: failed with error -14
  16. [    2.675495] ov9750.ov9750_check_camera_id: successfully detected camera ID 0x9750
  17. [    2.677259] cif_isp10_pltfrm_get_img_src_device: ov9750 attach to cif isp10 img_src_array[0]
  18. [    2.679201] ov9750.pltfrm_camera_module_get_data WARN: could not get default pinstate
  19. [    2.681002] ov9750.pltfrm_camera_module_get_data WARN: could not get sleep pinstate
  20. [    2.682840] ov9750.pltfrm_camera_module_init_gpio(258) ERR: failed to request GPIO #153 ('rockchip,pd-gpio')
  21. [    2.684815] ov9750.pltfrm_camera_module_init_gpio(282) ERR: failed with error -16
  22. [    2.686567] ov9750.pltfrm_camera_module_init(1739) ERR: GPIO initialization failed (-16)
  23. [    2.688372] ov9750.ov_camera_module_init(1337) ERR: failed with error -16
  24. [    2.712984] ov9750.pltfrm_camera_module_get_data WARN: could not get default pinstate
  25. [    2.714864] ov9750.pltfrm_camera_module_get_data WARN: could not get sleep pinstate
  26. [    2.752155] ov9750.ov_camera_module_write_config(180) ERR: no active sensor configuration
  27. [    2.752907] ov9750.ov_camera_module_write_config(231) ERR: failed with error -14
  28. [    2.756488] ov9750.pltfrm_camera_module_read_reg(1040) ERR: i2c read from offset 0x0000300b failed with error -6
  29. [    2.759110] ov9750.pltfrm_camera_module_read_reg(1040) ERR: i2c read from offset 0x0000300c failed with error -6
  30. [    2.761273] ov9750.ov9750_check_camera_id(912) ERR: register read failed, camera module powered off?
  31. [    2.763314] ov9750.ov9750_check_camera_id(930) ERR: failed with error (-6)
  32. [    2.765161] ov9750.ov_camera_module_attach(254) ERR: failed with error -6
  33. [    2.772795] ov9750.pltfrm_camera_module_get_data WARN: could not get default pinstate
  34. [    2.774770] ov9750.pltfrm_camera_module_get_data WARN: could not get sleep pinstate
  35. [    2.812192] ov9750.ov_camera_module_write_config(180) ERR: no active sensor configuration
  36. [    2.812943] ov9750.ov_camera_module_write_config(231) ERR: failed with error -14
  37. [    2.816955] ov9750.pltfrm_camera_module_read_reg(1040) ERR: i2c read from offset 0x0000300b failed with error -6
  38. [    2.819997] ov9750.pltfrm_camera_module_read_reg(1040) ERR: i2c read from offset 0x0000300c failed with error -6
  39. [    2.822228] ov9750.ov9750_check_camera_id(912) ERR: register read failed, camera module powered off?
  40. [    2.824357] ov9750.ov9750_check_camera_id(930) ERR: failed with error (-6)
  41. [    2.826286] ov9750.ov_camera_module_attach(254) ERR: failed with error -6
复制代码
以上是一些调试信息。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

JoelYang

新手上路

积分
24
沙发
 楼主| 发表于 2020-4-20 10:30:57 | 只看该作者
求帮忙看一下是什么问题引起的
回复

使用道具 举报

addy

超级版主

积分
609
板凳
发表于 2020-4-20 11:36:05 | 只看该作者
I2C读写出错。看下是否是接触不良。量下I2C硬件波形是否正常。
回复

使用道具 举报

JoelYang

新手上路

积分
24
地板
 楼主| 发表于 2020-4-20 12:47:47 | 只看该作者
addy 发表于 2020-4-20 11:36
I2C读写出错。看下是否是接触不良。量下I2C硬件波形是否正常。

好嘞、我检查一下
回复

使用道具 举报

zcxDYJ77

注册会员

积分
136
5#
发表于 2020-4-28 18:11:13 | 只看该作者
JoelYang 发表于 2020-4-20 12:47
好嘞、我检查一下

请问一下: 有在Fedora上读出OV9750的数据吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表