Configuring a USB digital still camera on Debian
I obtained a Kodak DX-4900 digital camera in 2002 and discovered it would not work “out of the box” on my Debian installation. Getting it to work involved messing around with the kernel’s USB configuration, but turned out to be a fairly straightforward process.
For the benefit of anyone else who may be stuck with this, here is a quick guide. Note: This guide was written in October 2002 and may be obsolete now. Since I do not have a working Debian installation currently, this guide is updated using reader feedback. Please tell me if you notice something incorrect.
| 1 |
Before we start, please check that you have: |
| 2 |
If you need to upgrade your kernel, try issuing this command as the root user: # apt-get install kernel-image-2.4.18-bf2.4 That build is standard with Woody and includes the needed support for USB. Installing a new kernel requires you to reboot for the change to be effective. |
| 3 |
Install the required programs: # apt-get install gphoto2 gtkam usb-perms Note: Since usb-perms is now an obsolete package, replaced by the hotplug package (September 2003), it is not available in Debian anymore. However, it is still available from the Xandros support site: # wget http://support.xandros.com/downloads/desktop_1.x/cameras/usb-perms_0.1-3_i386.deb # dpkg -i usb-perms_0.1-3_i386.deb # rm usb-perms_0.1-3_i386.deb hotplug appears to be a drop-in replacement for usb-perms, so you may be able to progress using that instead. When you are done installing either, check if your camera is in gphoto2’s supported list. You should see an output similar to that below.
$ gphoto2 --version
gPhoto (v2.1.0) - Cross-platform digital camera library.
Copyright (C) 2000-2002 Scott Fritzinger and others
Licensed under the Library GNU Public License (LGPL).
$ gphoto2 --list-cameras
Number of supported cameras: 225
Supported cameras:
"AEG Snap 300" (TESTING)
"Agfa CL18"
...
"UMAX AstraPen" (TESTING)
"USB PTP Class Camera" (TESTING)
"WWF"
If your camera is listed, you are in luck. |
| 4 |
To actually access the camera, the kernel must first be configured for USB. Issue this command: $ ls /proc/bus/usb 001 devices drivers If you didn’t see a similar output (i.e. there is nothing in the directory), you need to configure USB first. Edit the /etc/fstab file and add this line to the end of the file: usbdevfs /proc/bus/usb usbdevfs defaults 0 0 Then again as root, issue this command: # mount /proc/bus/usb Now look at the directory again and you should see some files in it. |
| 5 |
Connect your camera to the USB port now, power it on, and issue this: # gphoto2 --auto-detect Model Port ---------------------------------------------------------- Kodak DX-4900 usb: That’s the output I get. You should see something similar. If yes, your camera is ready to be used! |
| 6 |
But before you stop reading this and run off to play with your camera, there is a final issue to be tackled: with the current configuration, only the root user can access the camera. If you want to access it as a normal user, you will need to configure the usb permissions daemon. Issue this as root and look for similar lines: # cat /proc/bus/usb/devices ... P: Vendor=040a ProdID=0550 Rev= 1.00 S: Manufacturer=Eastman Kodak Company S: Product=KODAK DX4900 Zoom Digital Camera ... Then edit /etc/usb.permissions and add a similar line to the bottom: 040a 0550 0664 44 …replacing the 040a and 0550 with the vendor id and product id from your camera. Next, issue these: # /etc/init.d/usb-perms restart Stopping USB permissions manager: usb-perms. Starting USB permissions manager: usb-perms. If you installed hotplug instead of usb-perms, use this instead: # /etc/init.d/hotplug restart And now check the file permissions: # ls -l /proc/bus/usb/001/ total 0 -rw-r--r-- 1 root root 18 09-14 01:44 001 -rw-r--r-- 1 root root 18 09-14 01:44 002 -rw-rw-r-- 1 root video 18 09-14 02:04 004 If you see a file owned by root:video, it worked! One final step now: edit /etc/group and look for an entry for video, then add yourself to it like this: # grep video /etc/group video:x:44:jace And we’re all done! Note: It appears that Sarge uses camera instead of video. If your /etc/group has camera, use that and replace the 44 in /etc/usb.permissions with camera’s group id. |
| 7 |
gphoto2 is a command-line only tool and probably not the best thing for you. Luckily, there exists another tool, gtkam, which provides an easier graphical user interface. gtkam should already be installed on your machine. It looks like this:
Note that some GUI clients may fail to list your camera unless you logout and login again to your desktop environment. |
