当前位置: 技术问答>linux和unix
求助,Spca5xx驱动的问题
来源: 互联网 发布时间:2016-03-20
本文导语: 由于一个270平台上需要使用USB摄像头,领导要求最好是市面上还能大量买到的,我逛了一下市场,选择了多彩科技的B55(Type Vimicro Zc301 0x303),控制器的linux内核是2.6.9,搜索了一下,发现spca5xx驱动比较适合。为了...
由于一个270平台上需要使用USB摄像头,领导要求最好是市面上还能大量买到的,我逛了一下市场,选择了多彩科技的B55(Type Vimicro Zc301 0x303),控制器的linux内核是2.6.9,搜索了一下,发现spca5xx驱动比较适合。为了方便测试驱动,于是我买了个兼容性比较好的301p的摄像头做实验, 使用的spca5xx补丁是usb-2.6.8.1-2.patch(我想可能对2.6.9内核兼容性较好),遇到的问题我分了两个情况3个问题:
1、 打好补丁之后我曾经试图将其编译进内核,但是那样做的话,插入摄像头提示信息:
usb 1-1.4: new full speed USB device using address 3
drivers/usb/media/spca5xx/spca_core.c: USB SPCA5XX camera found. Type Vimicro Zc301P 0x301b
usb 1-1.4: 60mA over 100mA budget!
但是对/dev/v4l/video0的操作提示 No sensor found:
[root@(none) v4l]#cat video0 > /root/aaa.jpg
no sensor found
cat: video0: Operation not permitted
估计是没加载正确,但是搞不清楚原因。。。。
2、 不得以,我将几个驱动设置成,另外做成ko单独加载,操作的信息如下:
[root@(none) spca5xx]#ls
ohci-hcd.ko usbcore.ko v4l2-common.ko
spca5xx.ko v4l1-compat.ko videodev.ko
[root@(none) spca5xx]#/sbin/insmod usbcore.ko
usbcore: registered new driver usbfs
usbcore: registered new driver hub
[root@(none) spca5xx]#/sbin/insmod ohci-hcd.ko
Setting port 2 power failed.
Setting port 3 power failed.
drivers/usb/host/ohci-pxa.c: ohci_hcd (PXA) at 0xf8000000, irq 3
pxa-ohci pxa-ohci: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usb 1-1: new full speed USB device using address 2
usb 1-1: device not accepting address 2, error -110
usb 1-1: new full speed USB device using address 3
usb 1-1: device not accepting address 3, error -110
[root@(none) spca5xx]#/sbin/insmod v4l1-compat.ko
[root@(none) spca5xx]#/sbin/insmod v4l2-common.ko
[root@(none) spca5xx]#/sbin/insmod videodev.ko
Linux video capture interface: v1.00
[root@(none) spca5xx]#/sbin/insmod spca5xx.ko
usbcore: registered new driver spca5xx
drivers/usb/media/spca5xx/spca_core.c: spca5xx driver 00.57.05 registered
[root@(none) spca5xx]#/bin/mknod /dev/video0 c 81 0
然后用cat截个图片(按网上帖子操作的,不知道这么对不对。。。)
[root@(none) spca5xx]#cd /mnt/yaffs/
[root@(none) yaffs]#cat /dev/video0 > a.jpg
cat: Write Error: No space left on device
[root@(none) yaffs]#
最后把这个a.jpg发到pc上查看,是一个分辨率320×240的灰色的图,除了灰色什么都没有。。。。。。
3、后来我使用servfox和spcaview来获取图像,servfox虽然有错误信息但是好像工作正常(网上的帖子也是这个错误,但是他说工作正常):
[root@(none) ~]#./servfox -d /dev/video0 -s 320x240 -w7070
servfox version: 1.1.3 date: 11:12:2005 (C) mxhaard@magic.fr
wrong spca5xx device
Waiting .... for connection. CTrl_c to stop !!!!
Got connection from 192.168.0.104
但是spcaview好像遇到一个X Error(在kde环境下运行的):
[root@localhost spcaview-20061208]# ./spcaview -s 320x240 -w 192.168.0.105:7070
Spcaview version: 1.1.7 date: 06:11:2006 (C) mxhaard@magic.fr
size width: 320 height: 240
using Server 192.168.0.105 Port 7070
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 12 (X_ConfigureWindow)
Value in failed request: 0x0
Serial number of failed request: 82
Current serial number in output stream: 90
还请高手赐教~谢谢谢谢
1、 打好补丁之后我曾经试图将其编译进内核,但是那样做的话,插入摄像头提示信息:
usb 1-1.4: new full speed USB device using address 3
drivers/usb/media/spca5xx/spca_core.c: USB SPCA5XX camera found. Type Vimicro Zc301P 0x301b
usb 1-1.4: 60mA over 100mA budget!
但是对/dev/v4l/video0的操作提示 No sensor found:
[root@(none) v4l]#cat video0 > /root/aaa.jpg
no sensor found
cat: video0: Operation not permitted
估计是没加载正确,但是搞不清楚原因。。。。
2、 不得以,我将几个驱动设置成,另外做成ko单独加载,操作的信息如下:
[root@(none) spca5xx]#ls
ohci-hcd.ko usbcore.ko v4l2-common.ko
spca5xx.ko v4l1-compat.ko videodev.ko
[root@(none) spca5xx]#/sbin/insmod usbcore.ko
usbcore: registered new driver usbfs
usbcore: registered new driver hub
[root@(none) spca5xx]#/sbin/insmod ohci-hcd.ko
Setting port 2 power failed.
Setting port 3 power failed.
drivers/usb/host/ohci-pxa.c: ohci_hcd (PXA) at 0xf8000000, irq 3
pxa-ohci pxa-ohci: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usb 1-1: new full speed USB device using address 2
usb 1-1: device not accepting address 2, error -110
usb 1-1: new full speed USB device using address 3
usb 1-1: device not accepting address 3, error -110
[root@(none) spca5xx]#/sbin/insmod v4l1-compat.ko
[root@(none) spca5xx]#/sbin/insmod v4l2-common.ko
[root@(none) spca5xx]#/sbin/insmod videodev.ko
Linux video capture interface: v1.00
[root@(none) spca5xx]#/sbin/insmod spca5xx.ko
usbcore: registered new driver spca5xx
drivers/usb/media/spca5xx/spca_core.c: spca5xx driver 00.57.05 registered
[root@(none) spca5xx]#/bin/mknod /dev/video0 c 81 0
然后用cat截个图片(按网上帖子操作的,不知道这么对不对。。。)
[root@(none) spca5xx]#cd /mnt/yaffs/
[root@(none) yaffs]#cat /dev/video0 > a.jpg
cat: Write Error: No space left on device
[root@(none) yaffs]#
最后把这个a.jpg发到pc上查看,是一个分辨率320×240的灰色的图,除了灰色什么都没有。。。。。。
3、后来我使用servfox和spcaview来获取图像,servfox虽然有错误信息但是好像工作正常(网上的帖子也是这个错误,但是他说工作正常):
[root@(none) ~]#./servfox -d /dev/video0 -s 320x240 -w7070
servfox version: 1.1.3 date: 11:12:2005 (C) mxhaard@magic.fr
wrong spca5xx device
Waiting .... for connection. CTrl_c to stop !!!!
Got connection from 192.168.0.104
但是spcaview好像遇到一个X Error(在kde环境下运行的):
[root@localhost spcaview-20061208]# ./spcaview -s 320x240 -w 192.168.0.105:7070
Spcaview version: 1.1.7 date: 06:11:2006 (C) mxhaard@magic.fr
size width: 320 height: 240
using Server 192.168.0.105 Port 7070
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 12 (X_ConfigureWindow)
Value in failed request: 0x0
Serial number of failed request: 82
Current serial number in output stream: 90
还请高手赐教~谢谢谢谢
|
是pxa270吗?我用的是spi口开发的摄像头