Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1412793
  • 博文数量: 430
  • 博客积分: 9995
  • 博客等级: 中将
  • 技术积分: 4388
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-24 18:04
文章存档

2013年(1)

2008年(2)

2007年(14)

2006年(413)

分类:

2006-10-16 15:13:56

1、摄像头(Webcam)驱动说明;

  摄像头在Windows的驱动极为容易,最多是点几下鼠标,没有什么太大的难度。但在Linux中,驱动起来是有点困难,这并不是说Linux多高雅。只能说开发商唯利是图,没有好处的事,他们的确不怎么积极。Linux 的用户比较少,所以他们也不把用户当回事。

  目前看来摄像头(Webcam)在 Linux 中驱动基本成熟,缺少的是应用程序的支持,比如即时通讯工具支持视频的好程序比较少。有些芯片组是没有任何问题,在国内,大多摄像头的芯片组是Z-Star,也有显示为Vimmicro(和Z-Star是同样的芯片)的。在Fedora 5.0或SuSE 10.x中,已经支持了很多摄像头,应该说即插即用。对于我们来说,是不是即插即用,那是另一回事,只有幸运儿才有这个的福气。如果您的摄像头接上还是用不了,那您就有必要看一下我写的这个文档了。

  本文操作环境: Fedora Core 5.0 。由于大部份是用源码包编译 ,所以还是有通用性的;

  1.1 摄像头在Linux中是如何支持的;

  在 Linux中,硬件的驱动程序,都是由内核支持的;目前比较新内核版本也集成了一些的摄像头驱动。就是Fedora、SuSE最新版本所支持的内核也是来自由 kernel.org 。所以支持也是极为正常的。内核对硬件的支持分为内置于和外挂模块两种方便。对于摄像头来说,大多是模块支持的;

  1.2 摄像头(Webcam)驱动网址;

  

  目前最新版本的摄像头驱动,已经到了 spca5xx-20060501.tar.gz 版本;您可以在上面的地址下载;

  2、驱动摄像头详细过程;

  2.1 查看摄像头型号;

  我们用用到 lshal 工具,在老版本的Linux是没有这个工具的。在最新版本的Linux都有这个工具;

  [root@localhost ~]# lshal |grep WebCam

  info.product = 'ZC0303 WebCam' (string)

  usb_device.product = 'ZC0303 WebCam' (string)

  上面这个命令是列出系统硬件设备,然后从输出中,提取WebCam字样的信息。这说明这个摄像头是ZC0303芯片组的;如果想更详细的,就用下面的命令,找到带有ZC0303 WebCam设备的详细信息,就把所有USB设备都列出来;

  [root@localhost ~]# lshal |grep usb

  然后就找 ZC0303字样的设备 ,那一大段都要仔细的看;

  也可以这样的方法;

  [root@localhost ~]# lshal -s |grep usbusb_device_0_0_0000_00_1d_0usb_device_0_0_0000_00_1d_0_if0usb_device_4fc_3_noserialusb_device_4fc_3_noserial_if0usb_
device_4fc_3_noserial_if0_logicaldev_inputusb_device_4fc_3_noserial_usbrawusb_device_0_0_0000_00_1d_0_usbrawusb_device_
0_0_0000_00_1d_1usb_device_0_0_0000_00_1d_1_if0usb_device_ac8_303b_noserialusb_device_ac8_303b_noserial_if0usb_
device_ac8_303b_noserial_usbrawusb_device_ac8_303b_noserial_video4linuxusb_device_0_0_0000_00_1d_1_usbrawusb_
device_0_0_0000_00_1d_2usb_device_0_0_0000_00_1d_2_if0usb_device_0_0_0000_00_1d_2_usbrawusb_device_0_0_
0000_00_1d_7usb_device_0_0_0000_00_1d_7_if0usb_device_0_0_0000_00_1d_7_usbraw

  我们看到带有video4linux字样的,他的设备号是 usb_device_ac8_303b_noserial_video4linux字样的,在其前面还有几个差不多的编号的设备。比如 usb_device_ac8_303b_noserial。我们就先查这个设备,大多数这样的一组相似的设备号,查第一个就能知道是什么设备。于是用。。

  [root@localhost ~]# lshal -l -u usb_device_ac8_303b_noserial

  udi = '/org/freedesktop/Hal/devices/usb_device_ac8_303b_noserial'

  info.udi = '/org/freedesktop/Hal/devices/usb_device_ac8_303b_noserial' (string)

  linux.subsystem = 'usb' (string)

  linux.hotplug_type = 1 (0x1) (int)

  usb_device.bus_number = 3 (0x3) (int)

  usb_device.can_wake_up = false (bool)

  usb_device.is_self_powered = false (bool)

  usb_device.version_bcd = 272 (0x110) (int)

  usb_device.speed_bcd = 4608 (0x1200) (int)

  usb_device.linux.device_number = 2 (0x2) (int)

  usb_device.num_ports = 0 (0x0) (int)

  usb_device.max_power = 160 (0xa0) (int)

  usb_device.device_revision_bcd = 256 (0x100) (int)

  info.product = 'ZC0303 WebCam' (string)

  usb_device.product = 'ZC0303 WebCam' (string)

  info.vendor = 'Z-Star Microelectronics Corp.' (string)

  usb_device.vendor = 'Z-Star Microelectronics Corp.' (string)

  usb_device.product_id = 12347 (0x303b) (int)

  usb_device.vendor_id = 2760 (0xac8) (int)

  usb_device.device_protocol = 0 (0x0) (int)

  usb_device.device_subclass = 0 (0x0) (int)

  usb_device.device_class = 255 (0xff) (int)

  usb_device.num_interfaces = 1 (0x1) (int)

  usb_device.num_configurations = 1 (0x1) (int)

  usb_device.configuration_value = 1 (0x1) (int)

  usb_device.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1' (string)

  info.linux.driver = 'usb' (string)

  info.bus = 'usb_device' (string)

  info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_0000_00_1d_1' (string)

  linux.sysfs_path_device = '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1' (string)

  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1' (string)

这回应该详细了吧。看上面的设备是哪个厂出品的?

  usb_device.vendor_id = 2760 (0xac8) (int)

  usb_device.product_id = 12347 (0x303b) (int)

  info.product = 'ZC0303 WebCam' (string)

  info.vendor = 'Z-Star Microelectronics Corp.' (string)

  usb_device.product_id = 12347 (0x303b) (int)

  在Gnome桌面环境下,还用hal-gnome软件包工具可用;您可以通过下面的方式来安装此软件包

  [root@localhost ~]# yum install hal-gnome

  然后运行hal-device-manager工具;

  [root@localhost ~]# hal-device-manager

阅读(1044) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~