Re(2): Quickcam device driver for Linux

jkf@tiger.franz.com,Internet writes:
> While writing a quickcam driver is an interesting exercise, I think
>that it's the wrong w
>ay to provide access to the camera.
> I feel that the best solution is to write a simple c
>amera server process.
>The server opens a socket, listens for picture requests, takes
>the p
>ictures and returns the bytes to the caller.   
>The advantages:
>    1. The camera server 
>is the only process that has to run as root.
>    2. The camera server can serialize reques
>ts from multiple clients.
>    3. The clients can be running on other machines, thus you can overlap
>       picture 
>taking with picture processing.
>    4. It's much easier to experiment with and debug a use
>       server program than a device driver.
>    5. A user-level program is much m
>ore portable across operating
>       systems than a device driver.

I agree that this is a very good method of presenting the final output from
the camera, although, I think you still need a device driver as well to
provide a unix style interface to the device (/dev/camera for example) in
the normal way, using ioctl() to set modes and so on. The device driver
should be no more than an I/O device however. The device driver itself
should do no processing of the data, but rather just have the capabilities
of setting operating modes and retrieving *raw* image data (and perhaps
doing some caching). The network deamon you speak of would simply then,
ioctl() the device driver to set the modes, then read() the device data and
feed it to the socket connections or optionally pre-process the image data
first to provide .gif, .jpg format or whatever. I think this would be
inline with the traditional unix way. You will have to make some kind of
device driver for other platforms anyway either in user space or kernel
space, since the parallel ports operate differently from platform to
platform, but once you have a kernel driver written for a particular
platform, you can access the device in the normal unix way, besides, you
can write the bulk of the kernel driver in cross platform style if you plan
it carefully enough where you just neen to rewrite the specific interface
routines for different platforms.

Mike Sharkey
X11 Development
SoftArc Inc.

Follow-Ups: References: