The USB Camera
The Sweex Webcam 100K
can capture images at 352 x 288 pixels, 25fps.
The product is also available through several OEM channels, such as Sanwa
CMS-V12 in Japan.
Prerequisite
- Omap linux kernel 2.6.12 or later
The sn9c10x driver is merged in the 2.6.12.
- Confirm your camera is compatible with Webcam 100K
Connect the camera to the OSK5912, and check vendor id and product id
# cat /sys/deices/platform/ohci/usb1/1-1/idVendor
0c45
# cat /sys/device/platform/ohci/usb1/1-1/idProduct
6005
- USB Bus power voltage
The CMV-12 USB camera draws the current more than the OSK5912 nominal capability.
Check your board if this is the case. Probe pin 1 of the USB connector. If it's
around 5[v], it should be OK. Otherwise, an external powered USB hub might be needed.
Compile the kernel with following options enabled.
Device Drivers --->
Multimedia deices --->
<*> Video for Linux ( CONFIG_VIDEO_DEV )
Device Drivers --->
USB support --->
<*> Support for Host-side USB ( CONFIG_USB )
<*> OHCI HCD support ( CONFIG_USB_OHCI_HCD )
Device Drivers --->
USB support --->
USB Camera support-->
<*> USB SN9C10x PC Camera Controler support ( CONFIG_USB_SN9C102 )
Prepare capturing program
On Linix host, execute this script to generate the
osk5912_webcam.tar.gz
Extract this file at the OSK5912's root file system.
# cd /
# tar xvfz osk5912_webcam.tar.gz
bin/webcam
lib/libjpeg.la
lib/libjpeg.so
lib/libjpeg.so.62
lib/libjpeg.so.62.0.0
Create device nodes
# mknod /dev/video0 c 81 0
# ln -s /dev/video0 /dev/video
Test
In the normal environment, the camera gives the values around 0x20.
# hexdump -v -n 100 /dev/video0
0000000 2528 2627 2b2a 252b 2926 292e 262b 2925
0000010 2725 2729 2926 2627 2829 2727 2729 2b24
...
Try variety environment (eg. room light on/off, put red paper
in front of the camera...) to see if the values change.
Capture the image
# /bin/webcam image.jpg
Further reference
# echo -n 1 > /sys/class/video4linux/video0/green
Linux projects
The latest information on webcam drivers. sn9c10x driver was originally posted there, until merged in the kernel package 2.6.12. Other drivers are there, too.
Network camera
Coming soon. Stay tuned...
A graceful acknowledgement
- sn-webcam
My example program above is based on this program.
return