[转]Linux操作系统摄像头驱动的安装

Linux操作系统摄像头驱动的安装

a) 请根据内核版本和摄像头类型从http://mxhaard.free.fr/download.html 选择下载最新驱动,该驱动支持市面上大多数摄像头。
b) 编译、安装以及装载摄像头驱动
c
) # tar xvzf gspcav1-20061216.tar.gz
# cd gspcav1-20061216
# make
# make install
# modprobe gspca

注意:Ubuntu更新库中也包含了该驱动,可以简单的通过“m-a a-i spca5xx”命令来自动下载并编译安装,但是由于库中的代码并不是最新的,对于某些摄像头的驱动可能存在问题,所以推荐手动下载、编译并安装的方式。
d) 用Camorama程序测试摄像头及其驱动程序
# apt-get install camorama
从开始菜单启动Camorama程序,如果驱动工作正常,将会在程序中显示动态预览窗口。

二、安装驱动笔记
Linux下摄像头驱动不多,现在比较流行的好像就是那个法国大胡子开发的那个spca5xx,我也来安装一下试试。
先把摄像头插上,按照人家说的lsusb一把,来查看一下,唉,怎么没有这个命令,g之,哦,又没装,文件叫usbutils,yum安装。
lsusb,有罗技鼠标,chesen的键盘,没有摄像头,这是咋了,再试试,重新插了一次,这下有了,Z-Star Microelectronics Corp. ZC0301 WebCam, ID 0ac8:301b ,中芯微的片子,经典版本,有希望。

安装摄像头的驱动,上那个fr结尾的法国网站,竟然上不去,这也被和谐了?代理,出去,终于看到了, 叫gspcavl,下下来,编译,出错,.owner =THIS_MODULE 这句错误,g之,看到openswan编译也有这个问题,他们解决的方法就是注释掉,那我也注释掉好了,再编,OK, insmod 出错,再看makefile,make install,没错,但是没用,ekiga里面还是找不到device,g之,看到某位大侠写的,需要先加载v4l,不懂其中道理,先照着做吧。所以只 要先
modprobe videodev
然后
insmod gspca.ko
就都OK了,在ekiga里device选v4l类型,然后就可以看到可爱的摄像头了

三、安装笔记
1.准备工作。在命令行里打入 cat /proc/bus/usb/devices |grep "0ac8" 。如果有返回,比如P:Vendor=0ac8 ProdID=301b Rev= 1.00,记下ProdID号,这是你的摄像头的传感器产品号。如果没有返回任何东西,不用担心,这说明你的camera不是用的z-Star出的传感 器,但是安装步骤没什么区别,打入cat /proc/bus/usb/devices ,找到PC Camera一行的上面第2行,同样记下ProdID。好了,去这个站点查查看你的传感器ID是否已经被支持了 http://mxhaard.free.fr/spca5xx.html ,这里面z-Star的大多数产品都已经被很好地支持了。如果没有支持,那真是遗憾了,向你表示慰问,下面的也不用看了。

2.去download页面把最新的驱动下载下来,
http://mxhaard.free.fr/spca50x/Download/spca5xx-20050701.tar.gz 。同时把工具spcagui20050601.tar.gz也弄下来。
http://mxhaard.free.fr/spca50x/Download/spcaview-20050701.tar.gz 如果你有兴趣,也可以用它提供的gui工具。顺便说一句,开发的法国人长的像萨达姆。

3. 现在把第一个包解开,查看INSTALL,编译要求你已经装好相应内核的源码树和头文件。当然video4linux也得装好。简单地make; make install 就行了。insmod spca5xx.ko。如果你是2.4的 内核,那就安照INSTALL里的要求做。如果一切都没问题,那你就可以把spcaview也编译安装,需要SDL的库。
用spcaview -f yuv进行测试。如果你还有电视卡,那不要忘了把 -d /dev/video1添进去。

四、ubuntu下安装摄像头(good)
1.a) 请根据内核版本和摄像头类型从http://mxhaard.free.fr/download.html 选择下载最新驱动,该驱动支持市面上大多数摄像头。

  b) 编译、安装以及装载摄像头驱动

  c) # tar xvzf gspcav1-20061216.tar.gz

  # cd gspcav1-20061216

  # make

  # make install

  # modprobe gspca

  注意:Ubuntu更新库中也包含了该驱动,可以简单的通过“m-a a-i spca5xx”命令来自动下载并编译安装,但是由于库中的代码并不是最新的,对于某些摄像头的驱动可能存在问题,所以推荐手动下载、编译并安装的方式。

  d) 用Camorama程序测试摄像头及其驱动程序

  # apt-get install camorama

  从开始菜单启动Camorama程序,如果驱动工作正常,将会在程序中显示动态预览窗口。
插入USB摄像头

$ dmesg

Linux video capture interface: v2.00

zc0301: V4L2 driver for ZC0301[P] Image Processor and Control Chip v1:1.05

usb 1-2: ZC0301[P] Image Processor and Control Chip detected (vid/pid 0x0AC8/0x301B)

usb 1-2: No supported image sensor detected

usbcore: registered new driver zc0301

$ lsusb

Bus 001 Device 005: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 WebCam

Bus 001 Device 004: ID 0bda:8150 Realtek Semiconductor Corp. RTL8150 Fast Ethernet Adapter

Bus 001 Device 002: ID 0ace:1215 ZyDAS

Bus 001 Device 001: ID 0000:0000

ZC0301 WebCam就是我们USB摄像头的芯片,内核是有驱动支持的。

drivers/media/video/zc0301/, 支持V4L2.

$ apt-get install spca5xx-source

[确认源:

deb http://debian.cn99.com/debian etch main contrib non-free

deb-src http://debian.cn99.com/debian etch main contrib non-free

]

看看源码放在哪里拉

$ dpkg -L spca5xx-source

/.

/usr

/usr/src

/usr/src/spca5xx-source.tar.bz2

/usr/share

/usr/share/doc

/usr/share/doc/spca5xx-source

/usr/share/doc/spca5xx-source/README-SONIX

/usr/share/doc/spca5xx-source/README-TV8532

/usr/share/doc/spca5xx-source/RGB-YUV%2fmodule-setting

/usr/share/doc/spca5xx-source/README.Debian

/usr/share/doc/spca5xx-source/copyright

/usr/share/doc/spca5xx-source/changelog.gz

/usr/share/doc/spca5xx-source/README.gz

/usr/share/doc/spca5xx-source/changelog.Debian.gz

/usr/share/modass

/usr/share/modass/overrides

/usr/share/modass/overrides/spca5xx-source

$ cd /usr/src

$ tar jxf spca5xx-source.tar.bz2

$ cd modules/spca5xx/

参考INSTALL文件

$ make clean

$ make

$ make install

加载模块

$ modprobe spca5xx

$ lsmod | grep sp

spca5xx 642544 0

videodev 21120 2 spca5xx,zc0301

pcspkr 3072 0

usbcore 112644 7 spca5xx,zc0301,zd1211b,rtl8150,usbhid,ohci_hcd

[pcspkr是在modprobe之前原来就有的]

这个时候/dev/video0就建好了。

安装一个应用程序

$ apt-get install camorama

运行camorama,就可以看到了。

另外: 换另一个摄像头(芯片sn9c101),因为装过了spca驱动,所以这次可以直接用了。
一般情况下,就可以用了。
2.安装视频软件
sudo apt-get install camorama

ubuntu下安装摄像头2

在终端里输入 lsusb

Bus 005 Device 001: ID 0000:0000

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 WebCam(注意本行就是摄像头信息)
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

在终端里输入 ekiga,然后进行设置(应用程序>Internet>Ekiga软电话),效果如图:


太棒了!至今为止,我的ubuntu什么驱动都没装过,系统自带了都,呵呵

#upgrade:经我测试,ubuntu7.04和ubuntu7.10都是可以的
ubuntu下安装摄像头3
使用EasyCam安装摄像头,
EasyCam 2
EasyCam 2 是EasyCam的新版本。如果您在使用EasyCam时出现问题,请尝试使用EasyCam 2。

安装
把下一行中的代码添加到您的 /etc/apt/sources.list 文件中

deb http://blognux.free.fr/debian unstable main
然后更新您系统中的软件包并安装easycam

sudo apt-get update
sudo apt-get install easycam2
EasyCam 1
EasyCam是一个用于自动安装摄像头的程序。它可以自动检测您的摄像头,选择并安装适合的驱动程序。

这里有一个能够被EasyCam检测到的摄像头的列表。这个列表的规模现在还比较小,但是它正在持续扩大。

源代码可以从这里找到。

安装
把下一行中的代码添加到您的/etc/apt/sources.list文件中

deb http://blognux.free.fr/debian unstable main
然后更新您系统中的软件包并安装easycam

启动easycam
您可以使用下面这条命令来启动easycam(在系统->系统管理菜单中有一个图标,您也可以通过它来启动easycam):

lauchcam2
EasyCam 2
现在请从屏幕上出现的列表中选择您的摄像头型号,然后easycam会向您询问是否安装驱动程序。

经过一段时间的编译,您的摄像头应该就可以使用了。

问题
您如果遇到困难,可以到Documentaion Ubuntu Francophone (法语)或者他们的论坛(法语)查询。

测试您的摄像头
camorama是一个用于观看,修改和保存从摄像头中获得的图像的小工具。您可以使用APT安装它:

sudo apt-get install camorama
介绍一些额外软件
如果您想在摄像头开启的时候在系统托盘上显示一个图标,您可以试试Camera Monitor。debian和ubuntu用户可以直接使用这个deb包进行安装。

手动安装spca5xx
您可以在这里找到手动安装spca5xx驱动程序的指南。

EasyCam 2
EasyCam 2 is a New Release of EasyCam. Please try if you have any problems with EasyCam

Installation
Add the following line to your /etc/apt/sources.list

deb http://blognux.free.fr/debian unstable main
Then you need to update the packages and install easycam

sudo apt-get update
sudo apt-get install easycam2
EasyCam 1
EasyCam is a software for an automated webcam installation. Thanks to the auto detection it will install the needed driver for your webcam.

There is are lists of the autodetected webcam's . At the moment the list is small, but it's constantly growing.

The source code is here

Installation
Add the following line to your /etc/apt/sources.list

deb http://blognux.free.fr/debian unstable main
Then you need to update the packages and install easycam

sudo apt-get update
sudo apt-get install easycam
Start easycam
with the following command you start easycam (There is also an icon under System->Administration):

lauchcam2
Now you can choose your webcam from the list. The software asks you if you want to install the driver.

After a some compilation your webcam should be ready.

Problems
If you get in trouble you can check on their thread (in french) or on the Documentaion Ubuntu Francophone (in french)

Testing your webcam
There is a nifty little application called camorama to view, alter and save images from a webcam. Simply install it via apt:

sudo apt-get install camorama
Additional software
If you want to have a little tray system icon that notifies you when your Webcam is on, try Camera Monitor. There is even a debian/ubuntu package available.

Installing spca5xx manually
You can find howto's for manual installation of the spca5xx driver here

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值