My Old Webcams

"Reference Design"
This is the cheapest webcamera that I could find, and at AU$11 you get what you pay for. Bought from http://msy.com.au
  • Name: PC Camera
  • Vendor/Product: 0x0C45:0x613A
  • Bridge Chip: SN9C120
  • Image Sensor: OV7648
  • {{bill:lsusb_microdia.txt|lsusb -v -d 0c45:613a}}
I have tried the following Linux drivers:
  • OVCam Drivers: http://alpha.dyndns.org/ov511/
  • Generic SN9Cxxx http://www.linux-projects.org (closed source)
  • GSPCA / SPCA5xx http://mxhaard.free.fr/
  • Usb Video Class UVC http://linux-uvc.berlios.de/
I'm really not confident in getting this webcam working on Linux. It seems to be very hard to get the chip specifications, which leaves us with reverse engineering and usb packet sniffing. It's probably not worth my time given the crappy image quality.

I have been communicating with Sonix, the maker of the SN9C120 chip, and so far they have stated that they don't release the Register Descriptions or source code. They then said that the SN9C120 was supported by gspca and UVC :-)

Windows Driver Info
The Install disk for Windows says that it is installing "USB PC CAM-168" drivers and applications. This installs an application "C:\Windows\AMCap.exe" and some driver files:
  • Windows INF file {{linux:oem36.inf.txt|oem36.inf}}



I'm running Kubuntu on my laptop, so initially I installed the gspca-source package and used module-assistant to do the compilation. When it didn't recognise the webcam, I modified the gspca_core.c code to include the 0x613a product id by copying the 0x613b code. The commands to try this out are:

sudo -i
rmmod gspca.ko
insmod gspca.ko debug=5
dmesg | tail

It still doesn't actually work, but it is closer. The camera image is just a gray square with some periodic dots. The problem is probably that the I configured the sensor chip as the OV7660 because there was no entry for the OV7648 yet. Next step is to add the usb and i2c init sequence for this sensor.

Here is a good email about adding sensor support: http://lists-archives.org/spca50x-devs/01093-modifying-settings-for-0c45-613b.html

To capture images from the webcam I am trying out fswebcam from http://www.firestorm.cx/fswebcam/

[215180.048000] usbcore: registered new interface driver uvcvideo [215180.048000] USB Video Class driver (v0.1.0) [215194.344000] usb 1-1: USB disconnect, address 6 [215201.336000] usb 1-1: new full speed USB device using uhci_hcd and address 7 [215201.496000] usb 1-1: configuration #1 chosen from 1 choice [215201.500000] /usr/src/modules/gspca/gspca_core.c: driver gspca probing [215201.500000] /usr/src/modules/gspca/gspca_core.c: driver gspca allocating memory [215201.500000] /usr/src/modules/gspca/gspca_core.c: driver gspca detecting camera [215201.500000] /usr/src/modules/gspca/gspca_core.c: USB SPCA5XX camera found. SONIX JPEG (sn9c1xx) [215201.500000] /usr/src/modules/gspca/gspca_core.c: [spca5xx_probe:3997] Camera type JPEG [215201.500000] /usr/src/modules/gspca/gspca_core.c: [spca5xx_getcapability:1192] maxw 640 maxh 480 minw 160 minh 120
luvcview version 0.2.1
Video driver: x11
A window manager is available
video /dev/video0
Error opening device /dev/video0: unable to query device.
Init v4L2 failed !! exit fatal

Reverse Engineering
I'm now using the latest source code: gspcav1-20070508.tar.gz

After adding the i2c init sequence for the OV7648 that I reverse engineered from the Windows driver USB packet sniff, I still get the same "test pattern" image as above.

Turn the camera LEDs on by writing 0x44 to the SN9C120 register 0x02 to set the required GPIO lines. This code example uses the usb functions provided in the gspca module code.

__u8 regF1 = 0x44;
sonixRegWrite(spca50x->dev, 0x08, 0x02, 0x0000, &regF1, 1);

QuickCam Express
This camera is operational - more details to come when I get time.
  • Ubuntu (Dapper) kernel quickcam driver
  • Standard v4l applications like xawtv and streamer
$ lsusb
Bus 003 Device 003: ID 046d:0870 Logitech, Inc. QuickCam Express

[254694.256000] usb 2-1: new full speed USB device using uhci_hcd and address 5
[254694.420000] usb 2-1: configuration #1 chosen from 1 choice
[254695.320000] Linux video capture interface: v2.00
[254695.416000] quickcam: QuickCam USB camera found (driver version QuickCam USB 0.6.6 $Date: 2006/11/04 08:38:14 $)
[254695.416000] quickcam: Kernel:2.6.22-14-generic bus:2 class:FF subclass:FF vendor:046D product:0870
[254695.424000] quickcam: Sensor HDCS-1020 detected
[254695.428000] quickcam: Registered device: /dev/video0
[254695.428000] usbcore: registered new interface driver quickcam

Aiptek Pencam

This camera is operational - more details to come when I get time.

GPhoto2 is able to capture and download "preview" photos

$ lsusb
Bus 002 Device 012: ID 2770:9120 NHJ, Ltd Che-ez! Snap / iClick Tiny VGA Digital Camera

$ gphoto2 --auto-detect
Model Port
Argus DC-1510 usb:
Argus DC-1510 usb:002,012

$ ghoto2 --capture-preview
Saving file as sq_cap.ppm

1 comment:

  1. So, is there an OpenWRT binary for the WRT350N that will not cause the problem you had? I don't want to build a JTAG cable.