webcam Spca5xx
时间:2007-02-06 来源:kingthr
Content:
- Ubuntu 6.06 (Dapper) and 6.10 (Edgy)
- Ubuntu 5.10 (Breezy)
- Step 1: Get the spca5xx source code
- Step 2: Become root
- Step 3: Download the necessary packages
- Step 4: Compiling the spca5xx source code
- Workaround to make the Makefile use gcc-3.4
- Setting a link back to the source code (headers)
- Compiling the spca5xx source code
- Removing the old driver from memory
- Removing the old driver from the hard drive
- Install the new driver
- Load the new driver
- Links
- Troubleshooting
- "No space left on device" error message
Newer Logitech Quick Cam Express Webcams and a lot of other Webcams are supported by the spca5xx driver, a branch of the spca50x driver. The spca5xx driver supports a wider range of cameras, but classifies itselves as experimental. (This means it might crash your kernel in the worst case.)
The spca5xx driver is included in the Ubuntu kernel and works out of the box in Ubuntu 6.06 and 6.10. In Ubuntu 5.10 the included driver is unfortunately buggy and will freeze your system, once the webcam is accessed. That's why you have to replace it by a self-compiled one (see below).
Ubuntu 6.06 (Dapper) and 6.10 (Edgy)
You don't have to do anything, just go ahead and plugin your webcam. Then you can use any application (e.g. gqcam, kopete, ...) to access the webcam. If it does not work, see the Troubleshooting section below.
Ubuntu 5.10 (Breezy)
If you want to replace the spca5xx driver delivered with Ubuntu Breezy Badger, this text shows you how. A compilation of the kernel is not necessary.
The spca5xx module delivered with Ubuntu Breezy is buggy and needs to be replaced, if you want to use it. This bug manifests itself by crashing the system when the camera is activated.
This howto is partially based on information found in arnieboy's posting: http://www.ubuntuforums.org/showthread.php?t=70657&page=3
Step 1: Get the spca5xx source code
First download the current spca5xx source from Michel Xhaard's homepage and store it in your home directory. At the time of writing 20051212 is the latest version.
cd ~wget http://mxhaard.free.fr/spca50x/Download/spca5xx-20051212.tar.gz
But check out his site for a newer version at http://mxhaard.free.fr/download.html
Change any occurance of spca5xx-20051212 in this how-to to the version you have downloaded.
Step 2: Become root
For administrative task Ubuntu uses the sudo command. This will not work here. (We have to change an environment variable (see below). If we use sudo this change will be discarded when the execution of the sudo commands ends, i.e. immediately.)
So, we use this method:
Open a terminal window and enter:
sudo -s
When prompted for your password, enter your user password.
The prompt should change to:
root@yourmachine:
Step 3: Download the necessary packages
In order to compile and integrate the drivers, the following packages are needed from the Ubuntu repositories:
-
linux-headers-`uname -r`
-
linux-restricted-modules-`uname -r`
-
build-essential
-
gcc-3.4
linux-... - The construct `uname -r` will evaluate to the version of the running kernel, e.g. 2.6.12.10-k7 (may vary on your system). The "linux" packages will download the headers of your kernel and the restricted modules from the repositories.
build-essential - contains utilities for compiling source code.
gcc-3.4 - The GNU C compiler. By default Breezy installs gcc-4.0 on your system. But the current kernel is compiled with gcc-3.4. Kernel modules MUST be compiled with the same compiler version as the kernel itself, so we need the older version.
This information is valid for Breezy and may change in later versions of Ubuntu.
The command to install these packages is:
apt-get install linux-headers-`uname -r` linux-restricted-modules-`uname -r` build-essential gcc-3.4
Step 4: Compiling the spca5xx source code
The linux stuff is installed under /usr/src. So I suggest, you go there:
cd /usr/src
and move the spca5xx source from your home directory to this location:
mv ~/spca5xx-20051212.tar.gz .
Unpack it
tar xfvz spca5xx-20051212.tar.gz
Enter the spca5xx directory
cd spca5xx-20051212
Workaround to make the Makefile use gcc-3.4
The Makefile which controls the compiling process for this driver has to be told to use gcc-3.4 instead of the default version 4.0:
export CC=gcc-3.4
This sets the environment variable CC, which is used in the spac5xx Makefile to select the compiler.
Setting a link back to the source code (headers)
Furthermore the spca5xx Makefile expect a pointer to the kernel source at a specific location. Let's create it:
ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/build
(Note: If you compile a kernel, this link is usually there. But as we use a pre-compiled kernel, we have to cheat.)
Compiling the spca5xx source code
make
There should be no errors.
Removing the old driver from memory
modprobe -r spca5xx
Removing the old driver from the hard drive
rm -rf /lib/modules/`uname -r`/kernel/drivers/usb/media/spca5xx*
Install the new driver
make install
Load the new driver
modprobe spca5xx
There should be no errors and dmesg could give you something like
spca5xx-20050419/drivers/usb/spca5xx.c: USB SPCA5xx camera found. Type QC Express (unknown CCD)spca5xx-20050419/drivers/usb/spca5xx.c: [spca5xx_probe:8174] Camera type GBGRusbcore: registered new driver spca5xxspca5xx-20050419/drivers/usb/spca5xx.c: spca5xx driver 00.56.01 registered
If there are no errors and the 'dmesg' output checks out, but you are still not getting an image from your camera, remove the driver from memory:
modprobe -r spca5xx
then reload the driver with a 'usbgrabber=1' parameter:
modprobe spca5xx usbgrabber=1
(The 'usbgrabber=1' has been known to solve problems with the X10 VA11A USB capture device.)
Remember: This process (at least the last 4 steps) has to be repeated if a new kernel version has been installed.
Links
A HowTo in the blog entry http://dvlinux.blogspot.com/2005_03_13_dvlinux_archive.html#111101610927602822
Easycam is a script automating the above mentioned procedure. It's only running in a graphical environment. See. Webcam
Troubleshooting
-
If the kernel was compiled using a gcc version different from what was used for compiling the spca5xx module, you will get an error message complaining
FATAL: Error inserting spca5xx (spca5xx.ko): Invalid module format
You will have to recompile with the correct gcc version.
-
Check whether the webcam was recognized by your system: The device node /dev/video and/or /dev/video0 should exist.
-
Be sure you connect your webcam to an usb port directly. If your are using and usb hub for connect it, the webcam will not work and will freeze your computer.
-
Check the last lines of dmesg for information about a possible failure
-
If you get the error message No space left on device, first unplug all other USB devices from your USB port. If the webcam works then, you might want to experiment with which USB port to use, as it seems to have these problems when on the same bus as e.g. a USB mouse.
-
To use your spca5xx-supported webcam with GnomeMeeting will require libpt-plugins-v4l. This can be installed by running:
sudo apt-get install libpt-plugins-v4l
Once installed set up GnomeMeeting with v4l (not v4l2). The video controls (brightness, contrast etc. in GnomeMeeting) do not seem to work.
-
(Copied here to be found by searches for camera names; up-to-date on http://mxhaard.free.fr/spca5xx.html)
"No space left on device" error message
How to Fix the “No space left on device” error message and Install the Spca5xx driver?
check the following thread in the forums: http://www.ubuntuforums.org/showpost.php?p=1444031&postcount=1