LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 13143|回复: 57

成功实现在linux 上使用 z-star usb 摄像头

[复制链接]
发表于 2005-1-11 00:34:44 | 显示全部楼层 |阅读模式
在linux 上使用 z-star usb 摄像头
在得到听峰兄弟的消息后,小弟第一时间进行了实现,在我的debian上成功啦!

听峰兄弟原贴:
---------------------------------------------------
USB摄像头的兄弟们注意啦!有驱动了!

Sunplus, Etoms, Conexant, Z-star ~ Vimicro, Sonix, Zoran, IcMedia ~ TransVision

摄像头的驱动有了,
http://www.qbik.ch/usb/devices/showdr.php?id=98

作者网站
http://mxhaard.free.fr/download.html
支持硬件列表
http://mxhaard.free.fr/spca5xx.html

刚刚下载,不知是否能安装成功,系统大家同时努力,各自找到各自系统和设备的安装方法。
快去下载吧。
---------------------------------------------------

具体安装方法:
1.准备工作:确认videodev 模块是否存在 modprobe -l | grep videodev,如果没有,则如下安装之:
        1.a进入linux源码目录(位置可能因人而异),以我机为例:
        deb3:/datas/kernel2.6/linux-2.6.9#
        1.b
        如果编译过内核:
                i. sed -i '/=m$/d' .config
                ii. vim .config
                找到CONFIG_VIDEO_DEV 那行,改为 CONFIG_VIDEO_DEV=m (前面#干掉),保存
                iii. make modules
                iv. cp drivers/media/video/videodev.ko /lib/modules/2.6.9/kernel/drivers/media/video/
                注意:1.一定要cp,不能make modules_install 2. 2.6.9 换成你的内核版本号
        如果没编译过:
                make menuconfig时选上
                Device Drivers ----> Multimedia devices --> <> Video for Linux
2. http://mxhaard.free.fr/download.html
下载得到 spca5xx-20050109.tar.gz [当前最新]
2.解压 #tar zxvvf spca5xx-20050109.tar.gz
3.进入此目录 spca5xx-20050109 后 # make  成功后 # make install
4.看看2个驱动是否都能正常加载
  modprobe videodev
  modprobe spca50x
  
  [不知为何,我进行到此步时,modprobe -l 列表为空了,用 insmod /lib/modules/..../videodev.ko 也行]
5.如果加载成功,则驱动安装部分已经完成。下面几步是安装软件gqcam
6.确认 /dev/video 是否存在,如果没有则
  # mknod /dev/video c 81 0
  # chmod 744 /dev/video
7.apt-get install gqcam
8.启动 gqcam ,看看成功没?(如果开始没有影像,先stop capture 再 start capture)

********************************************
说明 实现环境
        PII400 128M IBM390x notepad + debian3.1 2.6.9

usb 摄像头


Bus 001 Device 004: ID 0ac8:301b Z-Star Microelectronics Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0ac8 Z-Star Microelectronics Corp.
  idProduct          0x301b
  bcdDevice            1.00
  iManufacturer           1 Z-Star Corp.
  iProduct                2 PC Camera
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          193
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      Remote Wakeup
    MaxPower              160mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0080  1x 128 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x00c0  1x 192 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0100  1x 256 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0180  1x 384 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       6
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0300  1x 768 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       7
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x03ff  1x 1023 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10

Bus 001 Device 001: ID 0000:0000  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0000
  idProduct          0x0000
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.9 uhci_hcd
  iProduct                2 Intel Corp. 82371AB/EB/MB PIIX4 USB
  iSerial                 1 0000:00:02.2
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval             255
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             2
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
  bPwrOn2PwrGood        1 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0x01
太平洋里的水 该用户已被删除
发表于 2005-1-11 00:43:03 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2005-1-11 09:56:54 | 显示全部楼层
呵呵,我和环宇飞扬的联系过了,她说春节过后就推出驱动,现在驱动还不是很稳定。
发表于 2005-1-11 10:32:47 | 显示全部楼层
我也成功,来张图

本帖子中包含更多资源

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

x
发表于 2005-1-11 15:21:57 | 显示全部楼层
太感谢了,我也成功了
发表于 2005-1-15 20:40:05 | 显示全部楼层
在make的时候出现错误:
[root@localhost spca5xx-20050109]# make
Compiling drivers/usb/spca50x.c
In file included from /lib/modules/2.4.20-8/build/include/linux/vmalloc.h:8,
                 from drivers/usb/spca50x.c:44:
/lib/modules/2.4.20-8/build/include/linux/highmem.h: In function `bh_kmap':
/lib/modules/2.4.20-8/build/include/linux/highmem.h:20: warning: pointer of type
`void *' used in arithmetic
drivers/usb/spca50x.c: In function `spca50x_mmap':
drivers/usb/spca50x.c:4901: warning: passing arg 1 of `remap_page_range_R2baf18f
2' makes pointer from integer without a cast
drivers/usb/spca50x.c:4901: incompatible type for argument 4 of `remap_page_rang
e_R2baf18f2'
drivers/usb/spca50x.c:4901: too few arguments to function `remap_page_range_R2ba
f18f2'
make: *** [drivers/usb/spca50x.o] Error 1

我的操作系统是RH 9.0, videodev已经存在,请问各位XD,是哪里出了问题? 是不是由于我的内核是2.4的原因?
回复 支持 反对

使用道具 举报

发表于 2005-1-16 03:27:37 | 显示全部楼层
我的错误提示:
Building SPCA5XX driver for 2.5/2.6 kernel.
   PLEASE IGNORE THE "Overriding SUBDIRS" WARNING
   Remember: you must have read/write access to your kernel source tree.
make -C /lib/modules/`uname -r`/build SUBDIRS=/home/alan/spca5xx-20050109 module s
make: *** /lib/modules/2.6.9-1-k7/build: 没有那个文件或目录。 停止。
make: *** [default] 错误 2
回复 支持 反对

使用道具 举报

发表于 2005-1-16 14:04:46 | 显示全部楼层
现在的问题是,摄像头是可以用了,但拍出来的东东是反的,怎么办呀?

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

发表于 2005-1-19 17:51:15 | 显示全部楼层
请问,我在make 的时候,似乎是成功的,但继而make install就无法继续了,显示信息如下:

make 的时候显示如下信息:

[root@localhost spca5xx-20050109]# make
   Building SPCA5XX driver for 2.5/2.6 kernel.
   PLEASE IGNORE THE "Overriding SUBDIRS" WARNING
   Remember: you must have read/write access to your kernel source tree.
make -C /lib/modules/`uname -r`/build SUBDIRS=/root/camora/spca5xx-20050109 modules
make[1]: Entering directory `/lib/modules/2.6.9-1.667/build'
  CC [M]  /root/camora/spca5xx-20050109/drivers/usb/spca50x.o
/root/camora/spca5xx-20050109/drivers/usb/spca50x.c: In function `spca50x_read':
/root/camora/spca5xx-20050109/drivers/usb/spca50x.c:4829: warning: `interruptible_sleep_on' is deprecated (declared at include/linux/wait.h:290)
  CC [M]  /root/camora/spca5xx-20050109/drivers/usb/spcadecoder.o
  LD [M]  /root/camora/spca5xx-20050109/spca50x.o
  Building modules, stage 2.
  MODPOST
  CC      /root/camora/spca5xx-20050109/spca50x.mod.o
  LD [M]  /root/camora/spca5xx-20050109/spca50x.ko
make[1]: Leaving directory `/lib/modules/2.6.9-1.667/build'

而make install 的时候显示:

[root@localhost spca5xx-20050109]# make install
make: “install”是最新的。
回复 支持 反对

使用道具 举报

发表于 2005-1-20 09:27:22 | 显示全部楼层
精品!!!!
多谢兄弟指教 !!

北南 呈上
回复 支持 反对

使用道具 举报

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

本版积分规则

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