The Connectix Quickcam Technical FAQ (Proposal) December 4, 1997 This document is archived at http://www.cs.duke.edu/~reynolds/quickcam/ This file lists answers to some of the often heard technical questions about the Connectix Quickcam line of digital cameras. The information in this text was gathered by independent developers on the "Connectix Third Party Drivers mailing list" and is NOT official and was NOT approved by Connectix. In other words - we cannot guarantee that this information is 100% correct, and if you destroy your camera using these information, don't sue us, please. You were warned. 0. First of all 0.1. Where you should go on the Web 1. The Connectix Quickcam digital camera 1.1. Technical differences between Mac and PC versions 1.2. Technical differences between B&W and color versions 1.3. Can I use the parallel version on a serial port (or vice versa)? 1.4. Now what about that parallel port of my PC? Is it bidirectional? 1.5. Can I connect the Quickcam to a XYZ computer? 1.6. Can I connect more than one camera to one PC? 1.7. Oddments of the serial Quickcam 1.8. Can I connect the Quickcam to a network? (Web-Cam) 2. Home repairs and extra fun with the Quickcam hardware 2.1. The infrared filter / night vision 2.2. The lens / video-microspope 2.3. Disassembling the B&W Quickcam ball 3. Writing software for the Quickcam 3.1. Connectix official developer support 3.2. Is there a driver available for the XYZ operating system (e.g. Linux)? 3.3. The low level programming specs 3.4. How to get the specs 3.5. What mistakes exist in the specs? 4. Troubleshooting 4.1. How to make my PC's parallel port bidirectional? 4.2. Linux Autoprobing: Sometimes, the driver finds the camera, sometimes not. 4.3. There is that clinkering noise in my QC ball. What's wrong? 5. About this text 0. First of all If you are interested in Linux or FreeBSD drivers, read section 3.1, please. Low-level interface specifications for the B&W and Color Quickcams used to be available from Connectix. Logitech has taken these documents offline and shows no interest in making them available to developers. Windows NT drivers also used to be available from Connectix and were removed from the Quickcam web site when Logitech took over development of the Quickcam line. People are still working on Unix drivers for the B&W Quickcam, Color Quickcam, Quickcam VC, and Quickcam Pro. If you wish to join the discussion or support the development, please join the Third Party Drivers mailinglist through http://www.crynwr.com/qcpc/. 0.1. Where you should go on the Web Check the Quickcam Third Party Drivers website at http://www.crynwr.com/qcpc/. This is the main non-official resource for developers. It is mainly intended for people who do write software for OTHER operating systems than Windows or MacOS (but even if you do, you will find a lot of interesting things there). Please join the mailing list to hear the latest discussion. There is a FTP archive available at ftp://ftp.cs.unm.edu/pub/chris/quickcam/ There is a list of third-party drivers at http://www.cs.duke.edu/~reynolds/quickcam/ 1. The Connectix Quickcam digital camera The Quickcam comes in several versions - the original Greyscale Quickcam, the Color Quickcam, the Color Quickcam 2, the Quickcam VC, the Quickcam Home, and the Quickcam Pro. The Greyscale Quickcam and the Color Quickcam are available in Macintosh (serial) and PC (parallel) versions. The Color Quickcam 2 is parallel-only. The Quickcam VC and Quickcam Pro are available in parallel and USB versions. All Mac versions include a microphone; the PC versions do not. The Color Quickcam and the Color Quickcam 2 use the same protocols, so the same drivers work for both. The Quickcam VC, Quickcam Home, and Quickcam Pro use new protocols (clearly the USB version is a new protocol!). The Quickcam VC and Quickcam Pro use one protocol. The Quickcam's main advantages: it's cheap and it's easy to use. While most computer video hardware products need complicated A/D chips to convert an analog video signal to a digital computer bitmap, the QC directly transfers the data of its digital CCD chip to the computer. This results in simple, small hardware and low price. These features have made the Quickcam the most popular digital camera to date. Its main disadvantage: the image quality is okay, but not professional, and it's too slow to take movies with high frame rates. The QC is great for surveillance, videoconferencing or other low bandwidth applications, but not for high quality video processing. But hey - what did you expect for that price? [That's it for a very brief overview. You'll find more technical data at Logitech's website. If you think that I should include a full data sheet table, let me know.] 1.1. Technical differences between Mac and PC versions The Mac version connects to a RS422 serial port and includes a built-in microphone. (With video conferencing, it looks pretty silly when you approach your camera and yell into it...) The PC version connects to a Centronics parallel (printer) port and needs an additional link at the keyboard connector for 5V power supply. There is no built-in microphone. The PC version allows bi-directional data transfers on parallel ports. This feature is not supported by some older PC computers. (The parallel port was originally designed to send data bytes to the printer and receive only a few status bits like "printer online" or "out of paper". Bidirectional ports allow to receive data bytes, too.) This makes the image transfer about 2.5x faster compared to uni-directional transfers. In an earlier version of this text, I assumed that the Mac and the PC versions are basically the same hardware except for a serial to parallel converter in the PC version's connector plug. Here's what William Lewis (wiml@omnigroup.com) had to say about that: "Actually, in the PC version, the only thing in the eyeball itself is the CCD and some power-supply stuff and signal conditioning stuff. Everything else, including the A/D converter, is in the connector shell, which contains a 20-MHz PIC 16C64. The PC camera seems to be a completely new design, not just a Mac camera with a parallel interface; for example, the circuit board in the eyeball says "WCAM100" on it and doesn't appear to have any blank spots where a microphone would have been connected for a Mac version. One consequence of this is the cable between the eyeball and the shell is actually carrying the pixel values as analog voltages. I gather from some postings to this list that it's not too hard to induce noise on this line, which shows up as sparkles in the image. This gets worse if you hack up the camera to extend the cable length." The color version of the camera appears to send digital signals between the eyeball and the shell. The analog-digital conversion and optional compression are taking place in the eyeball. 1.2. Technical differences between Quickcam versions The color Quickcam's firmware implements a new image compression algorithm, VIDEC, that reduces the data size needed for one image frame by about 4:1. This is about as much data per frame as with the B&W version, so the color version can send 15-bit color data at about the same frame rate as the B&W version. VIDEC compression works only on still images (like GIF or JPEG), not on streams of images (like MPEG). There is not enough memory in the eyeball to store multiple frames at once. VIDEC compression is very lossy, though not in a manner similar to JPEG. The color depth is reduced repeatedly, and then bits are shaved using a Huffman table. The processing required is much simpler than for GIF or JPEG; thus compression can be performed real-time by simple circuitry. The algorithm has been patented by Connectix. As of this writing, they have not entered any licensing agreements with 3rd-party free software developers. The color protocols as published by Connectix only describe how to use the camera without compression. The uncompressed protocols use 4 to 6 times as much data per frame as the B&W protocols, and thus the frame rate is much lower. The Quickcam VC and Quickcam Pro support ECP-mode parallel ports in addition to older, SPP-mode ports. Thus transfers are faster. The VC and Pro models also use a new CCD layout and low-level image-transfer protocol. Little is known about either aspect of these cameras. 1.3. Can I use the parallel version on a serial port (or vice versa)? Many people ask if they can connect their QC to the serial port of their IBM PC, using a parallel-to-serial converter or using the Mac version of the camera. This is not possible, due to restrictions of the PC's serial hardware. Why? The QC was originally designed as a serial device and was first built for the Mac. It needs (according to Connectix' Mac programming specs) a speed of 918 kbps. The Macintosh's RS422 serial ports can easily handle this speed. The early PC's RS232 serial ports however had a maximum secure speed of 9600 bps, today's PCs can handle 115200 bps. This is why Connectix had to use the parallel port. Too bad, because parallel ports are a lot harder to program than serial. Third Party Driver developers would be much better off if the PC version was a serial device. (Ok, but you can't blame Connectix for that...) [Is it really easier to write software for the serial QC? Not necessairily - read the comment in section 1.5. for details.] So what you'd need is special additional hardware. You could use high-speed serial ports (RS422 cards are available for the PC). But since there is no Connectix driver support for this kind of hardware, you'd have to write your own drivers from scratch. If you are just concerned about your PC's single parallel port that you need for your printer: buy a mechanical port switch or an additional printer port card. The latter is less hassle, more elegant and even cheaper (<$20, make sure to buy a bi-directional port). 1.4. Now what about that parallel port of my PC? Is it bidirectional? Now let's first explain some details about the parallel port of your PC. There are three kinds of parallel ports: SPP (Standard Parallel Port), EPP (Extended Parallel Port) and ECP (Extended Capability Port). The EPP and ECP ports are extensions to the SPP that permit rapid I/O-Transfer to devices with an EPP or ECP port. The SPP port was designed for doing output to a printer. It wasn't intended for efficient input. However later it was extended to permit higher-speed input in what is called bidirectional mode. Since the advent of EPP and ECP (which also provide fast input) the presence of a bidirectional SPP mode isn't as important, thus computer and CPU board manuals often don't mention the bidirectional SPP capability. Transferring an image through the parallel port takes a relatively long time. To make matters worse the PC has to be involved in the whole transfer (unlike other slow devices on a PC where the transfer is done via DMA or is interrupt-driven). Therefore, reducing the transfer time means that you'll get your images faster and that you'll be able to run other programs while capturing images. You don't want to do image capture as a low priority background task since if you take too long to capture an image it will fade out of the camera's memory. A bidirectional parallel port will permit the data to be transfered through the parallel port nearly three times as fast. The Linux and Freebsd quickcam libraires (that you can find at the Third Party Drivers website) test to see if the parallel port a camera is attached to is bidirectional. You'll probably want to add some code to print out whether the port was found to be bidirectional. If the libraries say that the port is not bidirectional but you're pretty sure it is, then it may be a BIOS setup problem. Check your BIOS setup and see how the parallel port's mode is specified. In one case setting the mode to SPP (from ECP) allowed the port to run in bidirectional mode. Connectix recommends using the EPP mode or the SPP bidirectional mode. Users have reported problems with the ECP mode. One quick note regarding ECP and EPP modes: the features of these modes are a superset of the features provided by bidirectional SPP ports. ECP and EPP have the ability to use interrupts or a DMA channel to make I/O easier on the CPU. However, Connectix chose a proprietary pinout that isn't compliant with either ECP or EPP, so drivers must use the standard bidirectional style of transfer. 1.5. Can I connect the Quickcam to a XYZ computer? If you are trying to connect a QC to a non-Apple and non-Intel platform, check section 1.3. first for some basic information. If your computer has a RS422 serial port (some Unix machines do) or a serial port fast enough for the QC, get the Mac version and the Mac programming specs. Consider yourself lucky: programming is much easier with a serial device. If your computer has a fully PC compatible 25-pin parallel port, the PC version might work. Consider yourself lucky if your hardware allows bi-directional transfers . However, you need to be able to control every single data pin of that parallel port, which might not be easy with your platform. Not all resellers of Unix workstations have the low level programming specs of their parallel hardware available... As I write this, I know of only two non-Apple/Intel drivers: 1) John Bashinski has written a driver for Sun SparcStations running Solaris: ftp://ftp-eng.cisco.com/s2qcam. 2) The cqcam driver, originally for Linux/x86 also works with Linux/Alpha on Alpha-PC hardware and Linux/ARM on the Netwinder. Look at http://www.cs.duke.edu/~reynolds/cqcam/. Other Linux/x86 drivers may work on Alpha hardware, also. 1.6. Oddities of the serial Quickcam With my earlier comments, some developers felt encouraged to try and connect the serial (Macintosh) version of the QC to their PC. But it seems that my comments were more harm than good. While it's certainly true that writing software for a serial device is easier than for one connected to the parallel port, people are still having trouble with the serial QC. I should make clear that currently, there is no third-party serial driver available. If you want to try, you will do pioneer's work. I also have to admit that all my earlier comments were just things I made up reading the serial specs of the QC. First of all, the serial technical specs are rather poor compared to the document describing the parallel version of the camera. Or, as Roy M. Lovejoy III (roy@adeptsolutions.com) notes: "The FAQ was QUITE mistaken when it said that serial is much easier... The Tech notes for the serial cam are a hair less than worthless." Jonathan Laventhol (jonathan@pavilion.co.uk) adds some further technical oddments of the serial Quickcam: "You say (section 1.3) that it uses 918 kbs. This looks unlikely - but possible. Apple's documentation (Technical Introduction to the Macintosh Family, 2nd ed.) says, p154, that 'both ports can be operated up to about 256 kilobaud using the internal clock generator, or somewhat faster using an externally supplied clock. [...] In most Macintosh models, the modem port can use an incoming handshake line as a second external clock source to support synchronous modems requiring separate receive and transmit clocks.'" "Your statement that Mac serial port can 'easily handle that speed' seems suspect: it would be right at the limit, according to the Apple doc just quoted. It also is rather a strange speed." [Note: Jonathan is right - the serial specs of the QC say: "the minimun data clock rate from the camera is 918 kbps... a nonsymetric, bipolar clock output is generated by the camera to supply the external clock input required by the computer to support this rate..."] 1.7. Can I connect more than one camera to one Mac/PC? Yes, if you have the sufficient number of ports or a port switch. The Connectix Windows software "QuickPict" supports using more than one camera, although only the active application polls the image stream and the others show a still image. 1.8. Can I connect the Quickcam to a network? (Web-Cam) There are different approaches. First, you can turn your computer to a camera server. There are a lot of different solutions out there for exactly this kind of thing, software, drivers and scripts for all kinds of operation systems. For still images, you should check the long list of Third Party drivers at http://www.crynwr.com/qcpc/. Most people are interested in drivers for the various unix flavours, (e. g. Linux, FreeBSD) - you'll find it here! If you want to see moving images over the net, a video conferencing software is on your shopping list. Connectix sells it's own, but I'd recommend CuSeeMe. It is available for many platforms and it's shareware. Check http://www.cu-seeme.com. There is a Linux program, Q-SeeMe, that speaks the CuSeeMe protocols. It works by capturing an X window, so an X Quickcam driver such as xcqcam or xqcam is required. See http://www.pangea.org/~mavilar/qseeme/qseeme.html The nv and vic programs also work with the Quickcam. Pointers to these programs, hacked versions, and patches, can all be found at http://www.cs.duke.edu/~reynolds/quickcam/#vc If you do not have a computer to spare and all you want is a plain simple Web-Cam, you can also buy a box that connects your camera on one side and the LAN on the other. There is a commercial product out there called "Network Eye" and you can find more information at http://microplex.com/ne.html. 2. Home repairs and extra fun with the Quickcam hardware You can do a few foolish things with your QC, but maybe this section is also helpful if you hear a strange noise from within your camera after it fell down once too often. 2.1. The infrared filter / night vision The QC has a tendency to follow earth's gravitational field. In other words, it falls down pretty often. One of the first things to break off is the internal infrared filter (if it's loose, you'll hear it rattling when you shake the camera ball). I cannot understand why Connectix used only three drops of glue to attach the filter - a very cheap flaw in an otherwise good design. You can have it repaired and wait a few weeks until the technical support sends your camera back, or you can repair it yourself (at your own risk, of course). Check the section below for that. Some people even want to have the IR filter removed. According to Connectix's specs, the QC's CCD chip is so sensitive to infrared light, that after removing the IR filter, a room lit by the light of a TV remote control can be seen perfectly through the eye of the QC. So if you are interested in night vision, you might want to remove the IR filter intentionally. Michiel de Rond has done this with the Color Quickcam, you can see some interesting images on http://www.rcd-net.com/infrared/index.html. 2.2. The lens / video-microspope The B&W QC has a "fixed-focus" lens. If you want to refocus it (e.g. to make images of very close objects), you will have to open the camera ball. Since you have to set the focus manually, this is probably not the kind of thing you want to do very often. The color camera's lens is not fixed-focus and can be refocused using the ring on the front of the camera. 2.3. Disassembling the B&W Quickcam ball PLEASE NOTE that this is a very delicate procedure and that the QC was not designed to be opened by anyone else but by the Connectix technical support. If you follow these instructions, you will greatly reduce the danger of cracking your camera. If your camera is broken after this procedure, don't blame or sue me - it worked perfectly for me. But even if it doesn't - you will probably only break the exterior plastic shell and not the electronics inside. [Note by William Lewis (wiml@omnigroup.com): "I'd just like to mention that I've ripped my QuickCam apart a zillion times (the first time I didn't know about the paper-clip-in-the-pinhole trick; I think I was one of the first people to mention it here) and have broken off two of the three clips that hold the ball together, but it stays together just fine by friction. So it's not quite the end of the world if you're a little clumsy taking it apart. (I would recommend being careful about static electricity, though, on general principles.)"] On the backside of the ball, there is a little hole behind a sticker. Use a paper clip or a similar small metal stud to gently press in there until you feel resistance. That is the first lock clip. Push it gently forward until it unlocks (you'll hear a little "click"). Don't push too hard or it will break off. There are two other clips above and below the lens' opening. To unlock these, you have to tear apart the two plastic caps of the ball. This is the most dangerous part, so be very careful. (I almost broke one of the clips while doing this, luckily I had some glue to fill the crack.) You will now get the interiour parts of the camera ball: the circuit board, the plastic box that covers the CCD chip, that contains the infrared filter and that holds the lens. You can refocus the lens (B&W camera only) after loosening a small screw - see the section above. You can also remove (or repair) the infrared filter. It is inside the plastic cover box, so you have to take it off the circuit board after loosening two small screws. The filter is attached only by a few drops of glue, so that it comes off pretty easy if the QC falls down. If everything went smoothly, you can reassemble the QC with no visual trace of the opening process. Before you do that, check the three clips and all other plastic parts for any cracks. 3. Writing software for the Quickcam If you want to write software for Apple's MacOS or Microsoft's Windows 3.1x, Windows 95, and Windows NT, you're lucky: the QC comes with drivers that make the camera a "video-in device" to the operating system. You do not need to hassle with the QC's internal structure. Refer to your operating system's programming specs to find out how to handle such a video input device. 3.1. Connectix official developer support Connectix's Quickcam developer support program was discontinued when Logitech bought the rights to the Quickcam. 3.2. Is there a driver available for the XYZ operating system (e.g. Linux)? To find drivers for plain DOS, Linux, FreeBSD and many other platforms, check the Third Party Drivers list on http://www.cs.duke.edu/~reynolds/quickcam/. There is a FTP archive available at ftp://ftp.cs.unm.edu/pub/chris/quickcam/. If your OS isn't there, you need to get the programming specs from Connectix and lock yourself in your office for a few days. Some of the sources for existing drivers is portable; porting a working Linux driver is probably easier than writing one from scratch. If you wish to announce a driver for your OS, please join the mailing list; information regarding the mailing list can be found at http://www.crynwr.com/qcpc/. 3.3. The low-level programming specs Connectix used to hand out their low-level specs with a non-disclosure agreement. This meant that source code written following their specs was not allowed to be freely available. But that's exactly what you need for a project like Linux or FreeBSD. A few brave people started re-engineering the QC to find out on their own. (That way, you are not bound by the NDA.) The first independent drivers were based on the information gathered by that project. Connectix made low-level specifications available for the B&W Quickcam and Color Quickcam, but Logitech removed these documents and has not made specifications available for any newer Quickcams. For programming information for older cameras, examine the source for any of the readily available Linux Quickcam drivers, or contact the Quickcam third-party developers list. 3.5. What mistakes exist in the specs? There exists an errata page for the PC grayscale spec, version 1.11.It gives corrections for two graphs in section 4.2.1.1 and 4.2.1.2 and for two equations. If you got the current version of the grayscale specs, you also have this page at the end of your document. Currently, these mistakes are known for the PC Grayscale spec, version 1.3, Sept 24, 1996: page 31, section 4.3.3.8 correct info is: in 6-bit mode, 0x00 is white and 0x3f is black in 4-bit mode, 0x00 is black, 0x01 is white and 0x02 through 0x0f are a smooth gradient from almost white to almost black 4. Troubleshooting The obvious answer to many questions is: Did you read the Documentation that came with your software? Sometimes it's wise to actually read the README and/or INSTALL files. Some of the software even has man pages. 4.1. How to make my PC's parallel port bidirectional? If you have a very old computer, chances are that you can't. Some older models only support unidirectional parallel transfers. Maybe you want to buy an additional printer port card (available for $20 or less) and plug it in of your PC's extension slots. If your PC is not a stone-aged model, use your PC's BIOS setup to set the parallel port to EPP mode. This worked for most users, though some reported problems. SPP should work, too. Check section 1.4. for details. 4.2. Linux Autoprobing: Sometimes, the driver finds the camera, sometimes not. Don't always autoprobe. Let me explain why. The autoprobe code used by the Linux drivers is not using the method recommended by Connectix. The Connectix method can mess up a printer that is attached to your parallel port, so the author chose a more "polite" method that will try to find your camera without barking at the printer. [ note: This is not the case for all drivers. Some of the color QC drivers use Connectix's method, at least by default. ] Autoprobe was only made to make the first steps easier for you, the user. So that you do not have to check all the hardware port addresses of your parallel connectors, the autoprobe code will check all of them and try to find the camera. Then it tells you at which address the camera was found. Once it is found, you can write this port address into your qcam configuration file. The driver will skip autoprobe and use this address right away. Read the README file for details. Here are some details by Sean Foderaro (jkf@tiger.franz.com): "You have to first understand how the Quickcam works. From the moment the camera is powered on, it cycles between 'picture mode' and 'command mode'. In 'picture mode' the Quickcam measures the light falling on the CCD. Then it copies that picture to its memory and enters 'command mode' where it awaits a command from the PC (such as one to copy the image to the PC). Command mode ends when the Quickcam determines that the last image saved is beginning to fade from its memory at which point to goes back to picture mode. While in picture mode the Quickcam periodically toggles status bits readable by the PC. This is to let the PC know that the Quickcam is still alive. It is these status bits being toggled that tells the autoprobing software that a quickcam is attached to a particular parallel port. The problem with detecting a camera this way is that the duration of picture mode depends on the last brightness setting given the camera (or some random value when the camera is turned on). If the camera stays in picture mode too short a time then the autoprobing code may never see the toggling bits and may not realize there is quickcam attached." 4.3. There is that rattling noise in my QC ball. What's wrong? Uh-oh. There should be NO noise at all when shaking the QC ball. If there is however, this does not really mean trouble. Most of the times, it's just the infrared filter inside that got loose. It's relatively easy to repair this at home (check section 2.). Be aware that you lose any warranty when doing home repairs. 5. About this text This is a proposal. Its first draft version was written by Hanno Mueller of Kabel New Media, Hamburg, Germany. Hanno quietly quit maintaining the document, and so Patrick Reynolds has released an updated version and resumed maintenance. The following people added valuable information. Thanks to... Sean Foderaro (jkf@tiger.franz.com) for parallel port hardware descriptions (1.4.) and for a buglist of the grayscale specs (3.5.). Paul Fox (pgf@foxharp.boston.ma.us) for helping me [Hanno] with my English Charles Henrich (henrich@crh.cl.msu.edu) for further corrections William Lewis (wiml@omnigroup.com) for additional hardware specific information Roy M. Lovejoy III (roy@adeptsolutions.com) for a helpful complaint Chris Snell (chris@cs.unm.edu) for setting up the Third Party Drivers FTP site I'd be more than happy to hear your opinion and to include your additions about this text. Please e-mail to reynolds@cs.duke.edu. Thanks.