The Kodak DC290 Camera and Linux
(In contrast to what this image might suggest, the Kodak DC290
is not
mouse-controlled)
The Kodak DC290 camera is quite well supported on Linux. However,
finding all the tools is a bit difficult. I created this page to
collect some links and information. Some of it is specific to the
DC290, some will work with other Kodak cameras, and some information
might be useful for other cameras, too.
I don't think I'm a real expert on this, but I have a working setup,
so the information will be useful for someone who is trying to get
it up and running.
It will probably be incomplete, since I tend to forget what I did to
get things going as soon as they start working without playing
around with the config files...
Basic USB-setup
I found about everything I needed to know on
David Brownell's
page (unfortunately, this page no longer exists).
I use it with a Redhat 7 and a SuSE 6.2 system, which
was updated to SuSE 7.3 recently.
Redhat 7
This comes with USB installed and configured. The core modules will
be loaded at system boot, so you have to load the dc2xx module only.
This can be done by hand with /sbin/modprobe dc2xx (as
root). You can also make it happen automatically by adding the
following line to /etc/modules.conf:
above usb-uhci dc2xx
SuSE 6.2
This doesn't have USB support, so I applied the USB backport.
Unfortunately, the kernel is not exactly the version the patch
expects, but I figured out how to apply the missing pieces by hand.
Since this is a laptop that is rebooted quite often, I don't want to
start the USB system in the boot scripts. Instead, I added some
bits to /etc/conf.modules. At the very beginning, it
needs
keep
path[usb]=/lib/modules/2.2.10/usb
to find the USB modules. At the end of the alias char-major...
part, I added
alias char-major-180 usb-uhci
above usb-uhci dc2xx
This will load the USB modules if the camera-device is accessed.
Well, the first time I start the software, it complains that it
can't open the device, but it works when I try a second time.
There's probably a better solution.
A bug in the dc2xx module
With the USB backport, my computers couldn't talk to the camera if I
disconnected and reconnected it. I had to reload the dc2xx and/or
the usb-uhci modules using rmmod and modprobe to make it find the
camera again.
Dothory Cao Nguyen send me the tip to edit the source code of the
dc2xx module and change a few lines in the function
camera_release(). It should look like this:
static int camera_release (struct inode *inode, struct file *file)
{
struct camera_state *camera;
camera = (struct camera_state *) file->private_data;
if (camera->buf) {
kfree(camera->buf);
camera->buf = NULL;
}
...
You then have to compile and install the modules (or at least the
dc2xx module).
SuSE 7.3
After upgrading my 6.2 system, I plugged in my DC290 and tried to
talk to it. I had to load the modules by hand, but then it worked
immediately. To load the modules automatically, I added the
following to /etc/modules.conf:
alias char-major-180 usb-uhci
above usb-uhci dc2xx
With the new kernel, even the Infrared-connection to the camera
works (if the computer has an IrDA port, of course). To start it, I
entered (as root)
irattach /dev/ttyS1 -s
This tells the system that the second serial port is connected to
the IrDA port. Then, irdadump showed that there is a
Kodak DC290. To talk to the camera, I used "ks -d /dev/ircomm0"
(ks is part of the Open Digita Services, see below).
I tried to download some pictures, which worked, but at an
incredibly low speed.
Talking to the camera
So, if the USB system is running, you need some software to talk to
the camera and transfer pictures.
I tried gPhoto,
but the DC290 is supported in the CVS version only. I managed to
get and compile it, but it crashed immediately when I tried to start
it, so I decided not to use it.
The easiest way is to use this python script
(at least if python is already installed).
However, this is not really user-friendly and not very versatile.
A better approach are the
Open Digita Services. The version on their
download page
is able to download thumbnails and full images, and can do some less
useful things like switching the camera off. The version in CVS
(which is also available to everyone) seems to be able to do more,
but it doesn't compile out of the box.
The python-script usually creates larger files than ks, but they are
identical to the end of the shorter file. I think this is caused by
some padding the camera does during the transfer. This should
probably not be written to the file, but the python-script does it
anyway.
Looking at the pictures
The easiest way to look at pictures on Linux is
xv, of course.
However, it is simply too old to know about the new EXIF-data that
is hidden in the pictures created by digital cameras.
Furthermore, the DC290 can record short audio clips which are
embedded in the image file. Some utilities to extract these
informations:
- jhead is a
simple program to display the EXIF-data in the file. It can
also re-insert the data after applying some command to it.
It even can remove the thumbnail embedded in the image, but I
don't know why one should worry about the space wasted by a 10
KByte thumbnail in a 300000 KByte image.
- The Exif-Tools
are useful to extract the audio-clip from the images. They
should be able to dsplay all kinds of data about the structure
of the JPG-file, but I couldn't compile all of them.
- The
EXIF utilities became available recently as binary for
Redhat 6.2. The author considers them beta, he plans to make
the source code available once they are finished.
- JExif
uses Java, so it should run on Linux, but I don't have the right
JDK version, so I don't know if it works.
- Finally, if you want to invent a better wheel, you can get the
description of the Exif file format. (Thanks to Bill Marr
for the new URL of this page).
Image processing
There are zillions of programs out there to manipulate images, but
you should be aware that you will lose details and add more
artifacts every time you save it in JPEG format. However, it is
possible to perform simple operations like rotation and some special
cases of cropping without uncompressing and recompressing the image.
Some information about this can be found on
"Guido's Tech' Corner"
He also wrote a patch to properly preserve the Exif data in JPEG
images.
Rainer Köhler