Archive for December, 2007

Sweex Foldable Webcam (WC003V2) works with Linux

Friday, December 14th, 2007

WC003V2_img_pro_a.jpg At action they sell a Sweex Foldable Webcam for just 6 EURO. It’s a low-budget webcam with no extra’s, but it’s working with linux.

The specs:

  • Interface: USB
  • Chipset: Pixart 207
  • Sensor: CMOS
  • Maximum frame rate: 30 frames per second
  • Focus: from 50 mm
  • Colorfilter: RGB 24 and I420
  • Resolution: maximum 640 x 480
  • Supports: Windows 98SE, 2000, XP en Vista

Installation:

First of all, plug in the webcam and use the command ‘lsusb’ to find out the vendor and device id. In the example below the webcam is shown as: ‘Bus 003 Device 003: ID 093a:2460 Pixart Imaging, Inc.’

$ /usr/sbin/lsusb
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 003: ID 093a:2460 Pixart Imaging, Inc.
Bus 003 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 002 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 005: ID 413c:2010 Dell Computer Corp.
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 004: ID 413c:1003 Dell Computer Corp.
Bus 001 Device 006: ID 045e:0083 Microsoft Corp. Basic Optical Mouse
$

Next, we need to install a kernel module that enables the webcam in linux. The module needed for this device can be downloaded at http://mxhaard.free.fr/. It is called the “Generic Software Package for Camera Adapters”. The version I used is “gspcav1-20070508.tar.gz”. However, today a new version (gspcav1-20071214) is released. Anyway, download the package and untar it.

$ cd /tmp
$ wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20070508.tar.gz
$ tar zxf gspcav1-20070508.tar.gz
$ cd gspcav1-20070508

This version of gspcav1 needs to be edited before it actualy works. Edit the file ‘/tmp/gspcav1-20070508/Pixart/pac207.h’ and change line 137 from ‘if (id[0] != 0×27 || id[1] != 0×00)’ to ‘if (id[0] != 0×27 || id[1] != 0×08)’.

After making this important change, build the module using the command ‘gspca_build’. You’ll need root privileges.

# cd /tmp/gspcav1-20070508
# ./gspca_build
REMOVE the old module if present
 
CLEAN gspca source tree
rm -r -f *.o decoder/.gspcadecoder.o.cmd decoder/*.o \
.gspca.o.cmd *.o *.ko *.mod.* .[a-z]* core *.i \
*.symvers *.err
 
COMPILE gspca Please Wait ....!!
 
INSTALL gspca in the kernel binary tree
mkdir -p /lib/modules/`uname -r`/kernel/drivers/usb/media/
rm -f /lib/modules/`uname -r`/kernel/drivers/usb/media/spca5xx.ko
rm -f /lib/modules/`uname -r`/kernel/drivers/media/video/gspca.ko
install -c -m 0644 gspca.ko /lib/modules/`uname -r`/kernel/drivers/usb/media/
/sbin/depmod -ae
 
LOAD gspca in memory
 
PRINT COMPILATION MESSAGES if ERRORS look kgspca.err
make -C /lib/modules/`uname -r`/build SUBDIRS=/tmp/gspcav1-20070508 CC=cc modules
make[1]: Entering directory `/usr/src/kernels/2.6.22.9-91.fc7-i686'
CC [M] /tmp/gspcav1-20070508/gspca_core.o
CC [M] /tmp/gspcav1-20070508/decoder/gspcadecoder.o
LD [M] /tmp/gspcav1-20070508/gspca.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/gspcav1-20070508/gspca.mod.o
LD [M] /tmp/gspcav1-20070508/gspca.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.22.9-91.fc7-i686'
#

If all succeeds, you’ll end up with the following messages in ‘/var/log/messages’:

Dec 14 21:01:56 koko kernel: /tmp/gspcav1-20070508/gspca_core.c: USB GSPCA camera found. (PAC207)
Dec 14 21:01:56 koko kernel: /tmp/gspcav1-20070508/gspca_core.c: [spca5xx_probe:4098] Camera type GBRG
Dec 14 21:01:56 koko kernel: /tmp/gspcav1-20070508/gspca_core.c: [spca5xx_getcapability:1215] maxw 352 maxh 288 minw 160 minh 120
Dec 14 21:01:57 koko kernel: usbcore: registered new interface driver gspca
Dec 14 21:01:57 koko kernel: /tmp/gspcav1-20070508/gspca_core.c: gspca driver 01.00.18 registered

Testing:

Now that all is setup, use tools like ‘ekiga’ or ‘xawtv’ to test the webcam.