CQcam.txt 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. c-qcam - Connectix Color QuickCam video4linux kernel driver
  2. Copyright (C) 1999 Dave Forrest <drf5n@virginia.edu>
  3. released under GNU GPL.
  4. 1999-12-08 Dave Forrest, written with kernel version 2.2.12 in mind
  5. Table of Contents
  6. 1.0 Introduction
  7. 2.0 Compilation, Installation, and Configuration
  8. 3.0 Troubleshooting
  9. 4.0 Future Work / current work arounds
  10. 9.0 Sample Program, v4lgrab
  11. 10.0 Other Information
  12. 1.0 Introduction
  13. The file ../../drivers/media/video/c-qcam.c is a device driver for
  14. the Logitech (nee Connectix) parallel port interface color CCD camera.
  15. This is a fairly inexpensive device for capturing images. Logitech
  16. does not currently provide information for developers, but many people
  17. have engineered several solutions for non-Microsoft use of the Color
  18. Quickcam.
  19. 1.1 Motivation
  20. I spent a number of hours trying to get my camera to work, and I
  21. hope this document saves you some time. My camera will not work with
  22. the 2.2.13 kernel as distributed, but with a few patches to the
  23. module, I was able to grab some frames. See 4.0, Future Work.
  24. 2.0 Compilation, Installation, and Configuration
  25. The c-qcam depends on parallel port support, video4linux, and the
  26. Color Quickcam. It is also nice to have the parallel port readback
  27. support enabled. I enabled these as modules during the kernel
  28. configuration. The appropriate flags are:
  29. CONFIG_PRINTER M for lp.o, parport.o parport_pc.o modules
  30. CONFIG_PNP_PARPORT M for autoprobe.o IEEE1284 readback module
  31. CONFIG_PRINTER_READBACK M for parport_probe.o IEEE1284 readback module
  32. CONFIG_VIDEO_DEV M for videodev.o video4linux module
  33. CONFIG_VIDEO_CQCAM M for c-qcam.o Color Quickcam module
  34. With these flags, the kernel should compile and install the modules.
  35. To record and monitor the compilation, I use:
  36. (make zlilo ; \
  37. make modules; \
  38. make modules_install ;
  39. depmod -a ) &>log &
  40. less log # then a capital 'F' to watch the progress
  41. But that is my personal preference.
  42. 2.2 Configuration
  43. The configuration requires module configuration and device
  44. configuration. I like kmod or kerneld process with the
  45. /etc/modprobe.conf file so the modules can automatically load/unload as
  46. they are used. The video devices could already exist, be generated
  47. using MAKEDEV, or need to be created. The following sections detail
  48. these procedures.
  49. 2.1 Module Configuration
  50. Using modules requires a bit of work to install and pass the
  51. parameters. Understand that entries in /etc/modprobe.conf of:
  52. alias parport_lowlevel parport_pc
  53. options parport_pc io=0x378 irq=none
  54. alias char-major-81 videodev
  55. alias char-major-81-0 c-qcam
  56. will cause the kmod/modprobe to do certain things. If you are
  57. using kmod, then a request for a 'char-major-81-0' will cause
  58. the 'c-qcam' module to load. If you have other video sources with
  59. modules, you might want to assign the different minor numbers to
  60. different modules.
  61. 2.2 Device Configuration
  62. At this point, we need to ensure that the device files exist.
  63. Video4linux used the /dev/video* files, and we want to attach the
  64. Quickcam to one of these.
  65. ls -lad /dev/video* # should produce a list of the video devices
  66. If the video devices do not exist, you can create them with:
  67. su
  68. cd /dev
  69. for ii in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
  70. mknod video$ii c 81 $ii # char-major-81-[0-16]
  71. chown root.root video$ii # owned by root
  72. chmod 600 video$ii # read/writable by root only
  73. done
  74. Lots of people connect video0 to video and bttv, but you might want
  75. your c-qcam to mean something more:
  76. ln -s video0 c-qcam # make /dev/c-qcam a working file
  77. ln -s c-qcam video # make /dev/c-qcam your default video source
  78. But these are conveniences. The important part is to make the proper
  79. special character files with the right major and minor numbers. All
  80. of the special device files are listed in ../devices.txt. If you
  81. would like the c-qcam readable by non-root users, you will need to
  82. change the permissions.
  83. 3.0 Troubleshooting
  84. If the sample program below, v4lgrab, gives you output then
  85. everything is working.
  86. v4lgrab | wc # should give you a count of characters
  87. Otherwise, you have some problem.
  88. The c-qcam is IEEE1284 compatible, so if you are using the proc file
  89. system (CONFIG_PROC_FS), the parallel printer support
  90. (CONFIG_PRINTER), the IEEE 1284 system,(CONFIG_PRINTER_READBACK), you
  91. should be able to read some identification from your quickcam with
  92. modprobe -v parport
  93. modprobe -v parport_probe
  94. cat /proc/parport/PORTNUMBER/autoprobe
  95. Returns:
  96. CLASS:MEDIA;
  97. MODEL:Color QuickCam 2.0;
  98. MANUFACTURER:Connectix;
  99. A good response to this indicates that your color quickcam is alive
  100. and well. A common problem is that the current driver does not
  101. reliably detect a c-qcam, even though one is attached. In this case,
  102. modprobe -v c-qcam
  103. or
  104. insmod -v c-qcam
  105. Returns a message saying "Device or resource busy" Development is
  106. currently underway, but a workaround is to patch the module to skip
  107. the detection code and attach to a defined port. Check the
  108. video4linux mailing list and archive for more current information.
  109. 3.1 Checklist:
  110. Can you get an image?
  111. v4lgrab >qcam.ppm ; wc qcam.ppm ; xv qcam.ppm
  112. Is a working c-qcam connected to the port?
  113. grep ^ /proc/parport/?/autoprobe
  114. Do the /dev/video* files exist?
  115. ls -lad /dev/video
  116. Is the c-qcam module loaded?
  117. modprobe -v c-qcam ; lsmod
  118. Does the camera work with alternate programs? cqcam, etc?
  119. 4.0 Future Work / current workarounds
  120. It is hoped that this section will soon become obsolete, but if it
  121. isn't, you might try patching the c-qcam module to add a parport=xxx
  122. option as in the bw-qcam module so you can specify the parallel port:
  123. insmod -v c-qcam parport=0
  124. And bypass the detection code, see ../../drivers/char/c-qcam.c and
  125. look for the 'qc_detect' code and call.
  126. Note that there is work in progress to change the video4linux API,
  127. this work is documented at the video4linux2 site listed below.
  128. 9.0 --- A sample program using v4lgrabber,
  129. v4lgrab is a simple image grabber that will copy a frame from the
  130. first video device, /dev/video0 to standard output in portable pixmap
  131. format (.ppm) To produce .jpg output, you can use it like this:
  132. 'v4lgrab | convert - c-qcam.jpg'
  133. 10.0 --- Other Information
  134. Use the ../../Maintainers file, particularly the VIDEO FOR LINUX and PARALLEL
  135. PORT SUPPORT sections
  136. The video4linux page:
  137. http://linuxtv.org
  138. The V4L2 API spec:
  139. http://v4l2spec.bytesex.org/
  140. Some web pages about the quickcams:
  141. http://www.pingouin-land.com/howto/QuickCam-HOWTO.html
  142. http://www.crynwr.com/qcpc/ QuickCam Third-Party Drivers
  143. http://www.crynwr.com/qcpc/re.html Some Reverse Engineering
  144. http://www.wirelesscouch.net/software/gqcam/ v4l client
  145. http://phobos.illtel.denver.co.us/pub/qcread/ doesn't use v4l
  146. ftp://ftp.cs.unm.edu/pub/chris/quickcam/ Has lots of drivers
  147. http://www.cs.duke.edu/~reynolds/quickcam/ Has lots of information