• «
  • 1
  • 2
  • 3
  • »
  • Pages: 1/3     Go
主题 : mini6410 v4l 图像采集出错,打开摄像头文件的时候段错误 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 23915
精华: 0
发帖: 23
金钱: 115 两
威望: 23 点
综合积分: 46 分
注册时间: 2010-06-28
最后登录: 2011-07-09
楼主  发表于: 2010-07-14 15:56

 mini6410 v4l 图像采集出错,打开摄像头文件的时候段错误

管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2010-09-09)
用的是中星微摄像头,qtopia里的那个摄像头查看程序能正常采集图像。
自己编的程序在PC机器上能正常采集,在板子上运行到获取摄像头参数的时候就出段错误
if((vd->fd=open(dev,O_RDWR,10705))<0)
    {
        return -1;
    };
   if(v4l_get_capability(vd)<0)  (到这里出错)
       return -1;
    if(v4l_get_picture(vd)<0)
        return -1;
    return 0;
}
int v4l_get_capability(v4ldevice *vd)
{
    if(ioctl(vd->fd,VIDIOCGCAP,&(vd->capability))<0)
    {
        perror("v4l_get_capability:");
        return -1;
    }

   return 0;

}

出错信息如下
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c71f0000
[00000000] *pgd=570c8031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#6]
Modules linked in:
CPU: 0    Tainted: G      D     (2.6.28.6-FriendlyARM #1)
PC is at memcpy+0x48/0x330
LR is at s3c_fimc_v4l2_enum_fmt_vid_cap+0x44/0x4c
pc : [<c021a448>]    lr : [<c02de45c>]    psr: 80000013
sp : c71e9a84  ip : 00000000  fp : c71e9abc
r10: c05d52ec  r9 : 00000001  r8 : c0405602
r7 : c71fcc80  r6 : c05d52ec  r5 : 00000000  r4 : c71e9c80
r3 : 00000000  r2 : ffffffc0  r1 : 00000000  r0 : c71e9c80
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 00c5387d  Table: 571f0008  DAC: 00000015
Process capture7 (pid: 754, stack limit = 0xc71e8260)
Stack: (0xc71e9a84 to 0xc71ea000)
9a80:          00000000 c05d52ec c71fcc80 c0405602 c71e9c80 c71e9c80 c02de45c
9aa0: c02de418 c71e9c80 c0591760 c0458fdc c71e9bac c71e9ac0 c026d5c4 c02de424
9ac0: 00000004 c71e9af4 ca800010 c71e9ae4 c030ee7c c03094b0 0000003c c70994bc
9ae0: c7099400 c70994bc c71e9b1c 00000000 c030cc2c c030eb28 ffffffea c7099400
9b00: 000420df 00000002 ca800000 c70994bc c71e9b3c c71e9b20 c030be6c c0309448
9b20: c70994bc c7099400 c7481000 00013ce9 c71e9b64 c71e9b40 c030ad88 20000013
9b40: c7099400 00000000 00000001 00000003 00000000 20000013 c05a2a4c c05a2a48
9b60: c71e9bcc c71e9b70 c0132154 c0130564 00000044 c71e9b80 c00ff8d8 c03fb5b4
9b80: 00000000 c71e9e38 c759d380 c71fcc80 c026cfc4 00000000 c71e9c80 00000001
9ba0: c71e9d2c c71e9bb0 c0272b90 c026cfd0 c71e9c1c 00000000 00000000 00000000
9bc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9be0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9c00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9c20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9c40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9c60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9c80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9ca0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9cc0: 00000000 00000000 00000000 00000000 000000a4 00000004 00000000 00000000
9ce0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9d00: 000000d0 c71e9e38 c0591760 c0458fdc c71fcc80 803c7601 00000000 c05d52ec
9d20: c71e9d3c c71e9d30 c0273b8c c02729dc c71e9e2c c71e9d40 c026d0dc c0273a48
9d40: 000000f0 00000000 000000f4 00000000 000000f8 00000000 000000fc 00000000
9d60: 00000100 00000000 00000104 00000000 00000108 00000000 0000010c 00000000
9d80: 00000110 00000000 00000114 00000000 00000118 00000000 0000011c 00000000
9da0: 00000120 00000000 00000124 00000000 00000128 00000000 0000012c 00000000
9dc0: 00000130 00000000 00000134 00000000 00000000 c05d5304 c71e9e04 c71e9de8
9de0: c03fa35c c68160d8 c71e9e14 c71e9df8 c012cc4c c021e1f4 00000000 c72029f8
9e00: c68160d4 00000000 c71fcc80 c71e9e38 00000000 00000000 00000000 803c7601
9e20: c71e9ee4 c71e9e30 c0270394 c026cfd0 00000002 beaf66c4 2d633373 636d6966
9e40: 00000030 00000000 00000000 00000000 00000000 00000000 00000029 00000002
9e60: 00000000 00000000 00000000 00000000 00000000 c72029f8 c71e9edc c71e9e88
9e80: c013ab04 c012cf3c c014e648 000000f6 c7292bd8 00000000 c74d8a10 400f6000
9ea0: 00000000 000000cf 400f6000 c065ee00 00000003 00000000 c72029f8 c71fcc80
9ec0: 803c7601 00000000 00000003 c00ebf08 c71e8000 00000000 c71e9ef4 c71e9ee8
9ee0: c02704b8 c0270208 c71e9f14 c71e9ef8 c015c1f0 c02704a8 c689f370 beaf66c4
9f00: c71fcc80 803c7601 c71e9f7c c71e9f18 c015c664 c015c198 c71e9fb0 c72029f8
9f20: c71e9f3c c71e9f30 c011d6e0 c021fba4 c71e9f7c c71e9f40 c00f2394 c011d6dc
9f40: c014e1e0 c03fb5d0 00000003 00000200 c71fcc80 ffffffff c71fcc80 beaf66c4
9f60: 803c7601 00000003 c00ebf08 c71e8000 c71e9fa4 c71e9f80 c015c6f4 c015c238
9f80: 60000010 00000000 0000863c 00000140 00000000 00000036 00000000 c71e9fa8
9fa0: c00ebd60 c015c6c0 0000863c 00000140 00000003 803c7601 beaf66c4 beaf66c4
9fc0: 0000863c 00000140 00000000 00000036 00000000 00000000 4016cb60 beaf6674
9fe0: 00000000 beaf6668 000088f0 400f6c3c 60000010 00000003 00000000 00000000
Backtrace:
[<c02de418>] (s3c_fimc_v4l2_enum_fmt_vid_cap+0x0/0x4c) from [<c026d5c4>] (__vide
o_do_ioctl+0x600/0x3238)
r6:c0458fdc r5:c0591760 r4:c71e9c80 r3:c02de418
[<c026cfc4>] (__video_do_ioctl+0x0/0x3238) from [<c0272b90>] (v4l1_compat_get_ca
pabilities+0x1c0/0x25c)
[<c02729d0>] (v4l1_compat_get_capabilities+0x0/0x25c) from [<c0273b8c>] (v4l_com
pat_translate_ioctl+0x150/0x238)
[<c0273a3c>] (v4l_compat_translate_ioctl+0x0/0x238) from [<c026d0dc>] (__video_d
o_ioctl+0x118/0x3238)
[<c026cfc4>] (__video_do_ioctl+0x0/0x3238) from [<c0270394>] (__video_ioctl2+0x1
98/0x2a0)
[<c02701fc>] (__video_ioctl2+0x0/0x2a0) from [<c02704b8>] (video_ioctl2+0x1c/0x2
0)
[<c027049c>] (video_ioctl2+0x0/0x20) from [<c015c1f0>] (vfs_ioctl+0x64/0x74)
[<c015c18c>] (vfs_ioctl+0x0/0x74) from [<c015c664>] (do_vfs_ioctl+0x438/0x488)
r6:803c7601 r5:c71fcc80 r4:beaf66c4 r3:c689f370
[<c015c22c>] (do_vfs_ioctl+0x0/0x488) from [<c015c6f4>] (sys_ioctl+0x40/0x64)
r9:c71e8000 r8:c00ebf08 r7:00000003 r6:803c7601 r5:beaf66c4
r4:c71fcc80
[<c015c6b4>] (sys_ioctl+0x0/0x64) from [<c00ebd60>] (ret_fast_syscall+0x0/0x2c)
r7:00000036 r6:00000000 r5:00000140 r4:0000863c
Code: ba000002 f5d1f03c f5d1f05c f5d1f07c (e8b151f8)
---[ end trace f915a0040fedc642 ]---
Segmentation fault
[ 此帖被tq033t7在2010-07-14 16:12重新编辑 ]
自由,自强,共享,共创。
级别: 论坛版主
UID: 12573
精华: 27
发帖: 8838
金钱: 46490 两
威望: 9298 点
综合积分: 18216 分
注册时间: 2010-01-09
最后登录: 2019-07-16
1楼  发表于: 2010-07-14 16:42
我们的USB摄像头应用程序采用的是V4L2接口编程实现的。
新手如何向我们反馈有效的信息,以便解决问题,见此贴:
http://www.arm9home.net/read.php?tid-14431.html

[注]: 此处签名链接仅为指引方向,而非解答问题本身.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2010-07-14 16:44

PC is at memcpy+0x48/0x330
LR is at s3c_fimc_v4l2_enum_fmt_vid_cap+0x44/0x4c

V4L2的驱动s3c_fimc_v4l2_enum_fmt_vid_cap()里调用memcpy()的时候用了一个空指针?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 23915
精华: 0
发帖: 23
金钱: 115 两
威望: 23 点
综合积分: 46 分
注册时间: 2010-06-28
最后登录: 2011-07-09
3楼  发表于: 2010-07-14 16:47
谢谢管理员啊,我也感觉是这个问题,刚才试了试所有的ioctl函数都会出错,话说新版内核不是兼容V4L的么,是不是开发板上的新内核都不支持v4l了?
级别: 新手上路
UID: 23915
精华: 0
发帖: 23
金钱: 115 两
威望: 23 点
综合积分: 46 分
注册时间: 2010-06-28
最后登录: 2011-07-09
4楼  发表于: 2010-07-14 16:50

 回 2楼(kasim) 的帖子

不知道啊,这个程序没用v4l2的东西呀,在PC机上程序跑的一切正常,在板子上ioctl都出问题,应该是不支持V4L了吧?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2010-07-14 17:09

 Re:回 2楼(kasim) 的帖子

引用第4楼tq033t7于2010-07-14 16:50发表的 回 2楼(kasim) 的帖子 :
不知道啊,这个程序没用v4l2的东西呀,在PC机上程序跑的一切正常,在板子上ioctl都出问题,应该是不支持V4L了吧?


就像Mindee所说,内核用的V4L2。V4L2兼容V4L的API,所以用ioctl(vd->fd,VIDIOCGCAP,&(vd->capability))的时候,内核其实调用的是V4L2的驱动接口来处理。你可以认为内核“依然”支持所有的V4L接口。
[<c02de418>] (s3c_fimc_v4l2_enum_fmt_vid_cap+0x0/0x4c) from [<c026d5c4>] (__vide
o_do_ioctl+0x600/0x3238)
r6:c0458fdc r5:c0591760 r4:c71e9c80 r3:c02de418
[<c026cfc4>] (__video_do_ioctl+0x0/0x3238) from [<c0272b90>] (v4l1_compat_get_ca
pabilities+0x1c0/0x25c)
[<c02729d0>] (v4l1_compat_get_capabilities+0x0/0x25c) from [<c0273b8c>] (v4l_com
pat_translate_ioctl+0x150/0x238)
[<c0273a3c>] (v4l_compat_translate_ioctl+0x0/0x238) from [<c026d0dc>] (__video_d
o_ioctl+0x118/0x3238)
[<c026cfc4>] (__video_do_ioctl+0x0/0x3238) from [<c0270394>] (__video_ioctl2+0x1
98/0x2a0)
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 23915
精华: 0
发帖: 23
金钱: 115 两
威望: 23 点
综合积分: 46 分
注册时间: 2010-06-28
最后登录: 2011-07-09
6楼  发表于: 2010-07-14 17:13

 回 5楼(kasim) 的帖子

版主,怎么做才能让这个程序正常运行呢?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
7楼  发表于: 2010-07-14 17:17

 回 6楼(tq033t7) 的帖子

我在上面已经说了,问题出在内核里的V4L2驱动上。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 23915
精华: 0
发帖: 23
金钱: 115 两
威望: 23 点
综合积分: 46 分
注册时间: 2010-06-28
最后登录: 2011-07-09
8楼  发表于: 2010-07-14 17:23

 回 7楼(kasim) 的帖子

我晕,感觉超出我能力之外了
用V4L2重新编一遍算了。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
9楼  发表于: 2010-07-14 17:27

 Re:回 7楼(kasim) 的帖子

引用第8楼tq033t7于2010-07-14 17:23发表的 回 7楼(kasim) 的帖子 :
我晕,感觉超出我能力之外了
用V4L2重新编一遍算了。

我不觉得用V4L2的接口会有什么不同。现在有内核crash的call stack,只要有驱动源代码,问题应该很容易发现并解决。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
  • «
  • 1
  • 2
  • 3
  • »
  • Pages: 1/3     Go