Setting up the environment
You need to compile your own module for supporting various types of webcams.
For starting with compiling, some pre-work is needed regarding downloading all needed software packages. I assume that you are running the 2.6.23-voyage kernel. First we need our partition writable:
little-agent:/# remountrw
The next step is the download of the archives needed.
Try to change „deb http://www.voyage.hk/dists/experimental ./“ to „deb http://de.voyage.hk/dists/experimental ./“ for improving the your downloadspeed.
Start with:
little-agent:/# apt-get update little-agent:/# apt-get install linux-source-2.6.23-voyage little-agent:/# apt-get install build-essential little-agent:/# apt-get install gspca-source little-agent:/# apt-get install camserv
Compiling the kernel
As the downloading is finished we can continue with building the kernel with the original .config-file used for current running voyage-kernel, again. We will switch to the /usr/src/ – directory and unpack the sources.
little-agent:/# cd /usr/src/ little-agent:/usr/src# ls gspca-source.tar.bz2 linux-source-2.6.23-voyage linux-source-2.6.23-voyage.tar.bz2 modules little-agent:/usr/src# tar xjvf linux-source-2.6.23-voyage.tar.bz2 little-agent:/usr/src# tar xjvf gspca-source.tar.bz2
The next step ist now copying the old .config file to our kernel-source
little-agent:/usr/src# cd linux-source-2.6.23-voyage/ little-agent:/usr/src# cp /boot/config-2.6.23-486-voyage /usr/src/linux-source-2.6.23-voyage/.config
Change the Option „EXTRAVERSION =“ to „EXTRAVERSION = -486-voyage“ in the Makefile and run the kernel compiling process. Keep in mind, that there is now plenty of time for a coffee. This can take a lot of time! It took about two hours on my Alix Box.
little-agent:/usr/src# cd linux-source-2.6.23-voyage little-agent:/usr/src/linux-source-2.6.23-voyage# nano Makefile little-agent:/usr/src/linux-source-2.6.23-voyage# make
After finishing all the compiling stuff you are now able to create a symlink to the build-directory and compile your own modules:
little-agent:/usr/src/linux-source-2.6.23-voyage# ln -s /usr/src/linux-source-2.6.23-voyage /lib/modules/2.6.23-486-voyage/build
Build your module
No it is time for your camera module. Switch to the directory where you have unpacked the camera module sources and compile them
little-agent:/usr/src/linux-source-2.6.23-voyage# cd ../modules/gspca/ little-agent:/usr/src/modules/gspca# make make -C /lib/modules/`uname -r`/build SUBDIRS=/usr/src/modules/gspca CC=cc modules make
When anything went right, you should see an output similar to the one above.
Installing the module is the last step to perform.
little-agent:/usr/src/modules/gspca# make install little-agent:/usr/src/modules/gspca# depmode -a little-agent:/usr/src/modules/gspca# modprobe gspca
Now plugin your camera to usb and you will see an output like the following in your kernel messages.
For testing I used a Logitech Quickcam and one from Labtech.
little-agent:/# dmesg usb 2-1: new full speed USB device using ohci_hcd and address 4 usb 2-1: configuration #1 chosen from 1 choice /usr/src/modules/gspca/gspca_core.c: USB SPCA5XX camera found.(ZC3XX) /usr/src/modules/gspca/gspca_core.c: [spca5xx_probe:3887] Camera type JPEG /usr/src/modules/gspca/Vimicro/zc3xx.h: [zc3xx_config:515] Sensor ID:9 /usr/src/modules/gspca/Vimicro/zc3xx.h: [zc3xx_config:582] Find Sensor PAS202BCB /usr/src/modules/gspca/gspca_core.c: [spca5xx_getcapability:1165] maxw 640 maxh 480 minw 176 minh 144 usb 2-2: new full speed USB device using ohci_hcd and address 5 usb 2-2: configuration #1 chosen from 1 choice /usr/src/modules/gspca/gspca_core.c: USB SPCA5XX camera found.(ZC3XX) /usr/src/modules/gspca/gspca_core.c: [spca5xx_probe:3887] Camera type JPEG /usr/src/modules/gspca/Vimicro/zc3xx.h: [zc3xx_config:515] Sensor ID:7 /usr/src/modules/gspca/Vimicro/zc3xx.h: [zc3xx_config:597] Find Sensor HV7131R(c) /usr/src/modules/gspca/gspca_core.c: [spca5xx_getcapability:1165] maxw 640 maxh 480 minw 176 minh 144 little-agent:/#
Please start your camserv-programm now and point your webbrowser to the right webpage (p.e. http://little-agent:9192/).
little-agent:/# camserv /dev/video0
Congratulations!
You have just finished your first kernel module for your Alix 3d3 board.
It think this should also work with other boards and different kernel versions. Please check the kernel version in the dev repository and change the shell commands according to the given version number. If you like another resolution, and if your webcam supports it, you can change it in /etc/camserv/camserv.cfg.
(Look for 320 and 200 and change them to 640 and 480 or another resolution.)
You can now include the Webstream-Video in your html like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="author" content="sven@seiler.it" /> <title>Webcam - Test</title> </head> <body> <img src="http://192.168.1.92:9192" width="640" height="480" alt="Webcam" > </body> </html>
Hinterlasse einen Kommentar