blob: 0b69e4ee8e312d8dd8e26489b706f83aa6851382 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001c-qcam - Connectix Color QuickCam video4linux kernel driver
2
3Copyright (C) 1999 Dave Forrest <drf5n@virginia.edu>
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -03004 released under GNU GPL.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
61999-12-08 Dave Forrest, written with kernel version 2.2.12 in mind
7
8
9Table of Contents
10
111.0 Introduction
122.0 Compilation, Installation, and Configuration
133.0 Troubleshooting
144.0 Future Work / current work arounds
159.0 Sample Program, v4lgrab
1610.0 Other Information
17
18
191.0 Introduction
20
Lad, Prabhakar83c73532012-09-14 05:17:52 -030021 The file ../../drivers/media/parport/c-qcam.c is a device driver for
Mhayk Whandson575f9af2009-07-28 11:53:20 -030022the Logitech (nee Connectix) parallel port interface color CCD camera.
Linus Torvalds1da177e2005-04-16 15:20:36 -070023This is a fairly inexpensive device for capturing images. Logitech
24does not currently provide information for developers, but many people
25have engineered several solutions for non-Microsoft use of the Color
26Quickcam.
27
281.1 Motivation
29
30 I spent a number of hours trying to get my camera to work, and I
31hope this document saves you some time. My camera will not work with
32the 2.2.13 kernel as distributed, but with a few patches to the
33module, I was able to grab some frames. See 4.0, Future Work.
34
35
36
372.0 Compilation, Installation, and Configuration
38
39 The c-qcam depends on parallel port support, video4linux, and the
40Color Quickcam. It is also nice to have the parallel port readback
41support enabled. I enabled these as modules during the kernel
42configuration. The appropriate flags are:
43
44 CONFIG_PRINTER M for lp.o, parport.o parport_pc.o modules
45 CONFIG_PNP_PARPORT M for autoprobe.o IEEE1284 readback module
46 CONFIG_PRINTER_READBACK M for parport_probe.o IEEE1284 readback module
47 CONFIG_VIDEO_DEV M for videodev.o video4linux module
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -030048 CONFIG_VIDEO_CQCAM M for c-qcam.o Color Quickcam module
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50 With these flags, the kernel should compile and install the modules.
51To record and monitor the compilation, I use:
52
53 (make zlilo ; \
54 make modules; \
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -030055 make modules_install ;
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 depmod -a ) &>log &
57 less log # then a capital 'F' to watch the progress
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -030058
Linus Torvalds1da177e2005-04-16 15:20:36 -070059But that is my personal preference.
60
612.2 Configuration
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -030062
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 The configuration requires module configuration and device
Lucas De Marchi970e2482012-03-30 13:37:16 -070064configuration. The following sections detail these procedures.
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
66
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300672.1 Module Configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
69 Using modules requires a bit of work to install and pass the
Lucas De Marchi970e2482012-03-30 13:37:16 -070070parameters. Understand that entries in /etc/modprobe.d/*.conf of:
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
72 alias parport_lowlevel parport_pc
73 options parport_pc io=0x378 irq=none
74 alias char-major-81 videodev
75 alias char-major-81-0 c-qcam
76
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772.2 Device Configuration
78
79 At this point, we need to ensure that the device files exist.
80Video4linux used the /dev/video* files, and we want to attach the
81Quickcam to one of these.
82
83 ls -lad /dev/video* # should produce a list of the video devices
84
85If the video devices do not exist, you can create them with:
86
87 su
88 cd /dev
89 for ii in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
90 mknod video$ii c 81 $ii # char-major-81-[0-16]
91 chown root.root video$ii # owned by root
92 chmod 600 video$ii # read/writable by root only
93 done
94
95 Lots of people connect video0 to video and bttv, but you might want
96your c-qcam to mean something more:
97
98 ln -s video0 c-qcam # make /dev/c-qcam a working file
99 ln -s c-qcam video # make /dev/c-qcam your default video source
100
101 But these are conveniences. The important part is to make the proper
102special character files with the right major and minor numbers. All
103of the special device files are listed in ../devices.txt. If you
104would like the c-qcam readable by non-root users, you will need to
105change the permissions.
106
1073.0 Troubleshooting
108
109 If the sample program below, v4lgrab, gives you output then
110everything is working.
111
112 v4lgrab | wc # should give you a count of characters
113
114 Otherwise, you have some problem.
115
116 The c-qcam is IEEE1284 compatible, so if you are using the proc file
117system (CONFIG_PROC_FS), the parallel printer support
118(CONFIG_PRINTER), the IEEE 1284 system,(CONFIG_PRINTER_READBACK), you
119should be able to read some identification from your quickcam with
120
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300121 modprobe -v parport
122 modprobe -v parport_probe
123 cat /proc/parport/PORTNUMBER/autoprobe
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124Returns:
125 CLASS:MEDIA;
126 MODEL:Color QuickCam 2.0;
127 MANUFACTURER:Connectix;
128
129 A good response to this indicates that your color quickcam is alive
130and well. A common problem is that the current driver does not
131reliably detect a c-qcam, even though one is attached. In this case,
132
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300133 modprobe -v c-qcam
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134or
135 insmod -v c-qcam
136
137 Returns a message saying "Device or resource busy" Development is
138currently underway, but a workaround is to patch the module to skip
139the detection code and attach to a defined port. Check the
140video4linux mailing list and archive for more current information.
141
1423.1 Checklist:
143
144 Can you get an image?
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300145 v4lgrab >qcam.ppm ; wc qcam.ppm ; xv qcam.ppm
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300147 Is a working c-qcam connected to the port?
148 grep ^ /proc/parport/?/autoprobe
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300150 Do the /dev/video* files exist?
151 ls -lad /dev/video
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300153 Is the c-qcam module loaded?
154 modprobe -v c-qcam ; lsmod
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155
156 Does the camera work with alternate programs? cqcam, etc?
157
158
159
160
1614.0 Future Work / current workarounds
162
163 It is hoped that this section will soon become obsolete, but if it
164isn't, you might try patching the c-qcam module to add a parport=xxx
165option as in the bw-qcam module so you can specify the parallel port:
166
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -0300167 insmod -v c-qcam parport=0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
169And bypass the detection code, see ../../drivers/char/c-qcam.c and
170look for the 'qc_detect' code and call.
171
172 Note that there is work in progress to change the video4linux API,
173this work is documented at the video4linux2 site listed below.
174
175
Mauro Carvalho Chehab48773e62006-03-25 09:21:43 -03001769.0 --- A sample program using v4lgrabber,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Randy Dunlapa22f1cb2006-05-26 10:32:13 -0300178v4lgrab is a simple image grabber that will copy a frame from the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179first video device, /dev/video0 to standard output in portable pixmap
Randy Dunlapa22f1cb2006-05-26 10:32:13 -0300180format (.ppm) To produce .jpg output, you can use it like this:
181'v4lgrab | convert - c-qcam.jpg'
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
183
18410.0 --- Other Information
185
186Use the ../../Maintainers file, particularly the VIDEO FOR LINUX and PARALLEL
187PORT SUPPORT sections
188
189The video4linux page:
Mauro Carvalho Chehab43db48d2007-01-09 11:20:59 -0300190 http://linuxtv.org
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191
Mauro Carvalho Chehab43db48d2007-01-09 11:20:59 -0300192The V4L2 API spec:
193 http://v4l2spec.bytesex.org/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194
195Some web pages about the quickcams:
Justin P. Mattock0ea6e612010-07-23 20:51:24 -0700196 http://www.pingouin-land.com/howto/QuickCam-HOWTO.html
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197
198 http://www.crynwr.com/qcpc/ QuickCam Third-Party Drivers
199 http://www.crynwr.com/qcpc/re.html Some Reverse Engineering
Justin P. Mattock0ea6e612010-07-23 20:51:24 -0700200 http://www.wirelesscouch.net/software/gqcam/ v4l client
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 http://phobos.illtel.denver.co.us/pub/qcread/ doesn't use v4l
202 ftp://ftp.cs.unm.edu/pub/chris/quickcam/ Has lots of drivers
203 http://www.cs.duke.edu/~reynolds/quickcam/ Has lots of information
204
205