QCAM 0.1 now available
I've just uploaded the second release of my QuickCam driver program.
For the impatient, it can be found at
This version is much faster than the previous release, and has been
reorganized to make it easier to include in other programs. See the
README for a more complete list of changes.
I'm a little bit concerned about one of the changes I made and how it
will impact QCAM's performance on other people's systems so *please*
tell me how this release works on your system.
What I discovered was that the last version was spending way too much
time in a usleep call. I discovered that on my system (P5/90) a
usleep(1) takes ~20 _milli_seconds while usleep(0) only takes a few
microseconds. Time it -- you can only do 50 usleep(1)'s per second.
You *have* to have pauses at a few places when talking to the QuickCam,
so I wrote a hard-wired delay loop, and set the loop timer to about 50
times what it needs to be on my system. I'm sure there's a better way
to do this, but I don't know what it is. Yes, I tried using select,
and it performed the same as usleep. Big suprise, huh? Does anyone
have any suggestions?
Anyway, here's the README:
---------------------------- snip -----------------------------
This is the second alpha-test release of my control program for the
Connectix QuickCam parallel port video camera. It enables you to take
pictures with the camera at 320x240, 160x120, or 80x60 using 4 or 6
bits per pixel. This program may not work with your camera, and may
damage your system if used improperly. Use at your own risk.
The program is now much more modular, and should be easy to embed in
other programs. A library, libqcam.a is created by default and should
contain everything needed to use the program. The program in qcam.c
now uses the library and a simplier qcam-simple.c file is included to
show how to use the library without all of the options included in
I've tried to isolate all of the Linux-specific code in one file, so
it should be trivial to port to *BSD and other Unix-like systems. Any
The program should be about 4 times as fast. I've made a few
optimizations. The qcam program now outputs PGM files in raw format
as a side-effect of these optimizations.
There's now a configuration file (/usr/local/etc/qcam.conf) that holds
default settings for the program.
qcam [options] [filename]
-x width Set width
-y height Set height
-p port Set port
-B bpp Set bits per pixel
-c val Set contrast
-w val Set white balance
-b val Set brightness
-V Print version
The program returns one image from the camera on standard output in
PGM format. The default resolution is 160x120, and the default port
is 0x378 (LPT1). There are command-line arguments to change these as
well as a configuration file. If your camera is on your first
parallel port (0x378 or /dev/lp1), then your should be able to run the
program with no options and get a picture.
This program *must* be run as root to allow access to the parallel
port. This program should *not* be run SUID root, as it does very
little error checking.
A lot of people have contributed to this, including Russell Nelson,
Thomas Davis, and Simon Jones.
I've placed this program under the same copyright the X Consortium
uses. Basically, it's free for any use whatsoever. If this manages
to cause great problems for anyone (?) let me know and I suspect we
can arrange something.
Here's the notice:
Copyright (C) 1996 by Scott Laird
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL SCOTT LAIRD BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
There is a mailing list for discussing the QuickCam and Linux at
email@example.com. Send mail to
firstname.lastname@example.org to be added to the list.
January 2, 1996.
---------------------------- snip ---------------------------
I hope this works for everyone.
Scott A. Laird | "But this goes to 18,446,744,073,709,551,615"
email@example.com | - Nigel on his new 64-bit computer