Adding Other Devices


Printers, keyboards, and hard drives are just the start of the list of device that people use with their computers. Mice, touch pads, and video capture devices are also common. Unfortunately, hardware support within the open source community is hit-and-miss. Some devices have plenty of support, some have drivers that almost work, and some have no support at all. Adding to this problem, Ubuntu natively supports a much smaller set of hardware options than Linux in general. As a result, some drivers may need to be downloaded and compiled from scratch.

There is a basic rule of thumb when looking for Linux and Ubuntu support. If the device is standard and has been around for a while then it is likely to have support. Proprietary devices and closed technologies are unlikely to have drivers. Similarly, most peripherals that are new and cool either lack support or are supported by standard drivers.

image from book
Almost Compatible

Some vendors provide drivers for Linux in binary format only. Although these will work for a specific platform, they may not work with all platforms.

When choosing new hardware that requires Linux drivers, make sure that they support your version of Linux. A kernel driver for RedHat Enterprise Linux 4.2 may not work with Ubuntu's Dapper Drake, and a device driver for Dapper Drake may not work with Edgy Eft.

In general, the best hardware vendors use standard protocols and do not require specialized kernel drivers. This means that drivers will be around for a long time. Your second choice should be vendors that provide source code. This enables you to recompile the code for use with other kernels and operating system versions. In the worst case, you may need to tweak the driver to work, but at least you will have the source code for tweaking. Finally, if you have no other option, then choose a vendor that has a long track record of Linux support. Hardware that does not support Linux today should not be expected to support Linux tomorrow.

For example, Timex offers a set of watches with USB ports. This enables you to synchronize the alarms with your computer's calendar program. (This is a huge cool factor in geek terms.) Unfortunately, the watches use a non-standard USB protocol. As of August 2006, drivers are only available for Windows. Even though a few open source groups are trying to create drivers for other operating systems, Mac OSX and Linux users are currently out of luck.

NVIDIA is another example of a vendor with proprietary protocols. But instead of USB watches, NVIDIA manufacturers video cards. In contrast to the Timex non- existent drivers, NVIDIA supports Linux by providing proprietary video drivers, including versions that work with Ubuntu (see Chapters 4 and 9). Although source code is not available, NVIDIA has a long history of providing drivers for Linux.

Under Linux, it is generally easier to find drivers for legacy hardware. Few devices have ever been completely dropped. (The notable exceptions are the original 80386 and older CPU architectures due to their lack of a math coprocessor.) Although Windows XP may not have drivers for the Colorado Memory Systems' QIC-80 tape backup system, the Linux ftape driver's source code should be available for decades (although you may need to download, compile, and install them manually).

image from book

Using a Serial Mouse

One of the first problems I encountered when installing Ubuntu was the mouse. By default, Ubuntu only supports a USB mouse, but my mouse uses the serial port. This problem can be quickly resolved by editing the /etc/X11/xorg.conf file, which describes the displays and input devices that should be used with the graphical display.

  1. As root, make a backup of /etc/X11/xorg.conf.

     $ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.original 
  2. Edit the file. You may want to make the window wide enough so lines do not wrap.

     $ sudo gedit /etc/X11/xorg.conf 
  3. Search for the sections titled "InputDevice". One will refer to the keyboard with the title "Generic Keyboard" and the other refers to the mouse ("Configured Mouse").

  4. Add a new section after "Configured Mouse" for the serial mouse. In this example, the mouse is on /dev/ttyS0 (first serial port). Other port options include /dev/psaux (for a PS/2 mouse) and /dev/ttyS1 for the second serial port. The sample configuration also supports three-button emulation, where pressing the left and right mouse buttons acts the same as pressing the middle mouse button. If you have a three-button mouse, then you can choose to leave this line out of the configuration. Other options include specifying the mouse protocol, such as "Microsoft" or "Logitech" for most serial mice, and "PS/2" for a PS/2 mouse.

     Section "InputDevice"         Identifier      "Serial Mouse"         Driver          "mouse"         Option          "CorePointer"         Option          "Device"                "/dev/ttyS0"         Option          "Emulate3Buttons"       "true" #       Option          "Protocol"       "Microsoft" #       Option          "Protocol"       "Logitech" #       Option          "Protocol"       "PS/2"EndSection 
  5. Go down to the "ServerLayout" section. You should comment out the Configured Mouse line (for a USB mouse) and add a line for the serial mouse.

     Section "ServerLayout"         Identifier       "Default Layout"         Screen           "Default Screen"         InputDevice      "Generic Keyboard"         InputDevice      "Configured Mouse"         InputDevice      "Serial Mouse" "SendCoreEvents"         InputDevice      "stylus" "SendCoreEvents"         InputDevice      "cursor" "SendCoreEvents"         InputDevice      "eraser" "SendCoreEvents" EndSection 
  6. Save your changes.

Now you can restart the X-server by pressing Ctrl+Alt+Backspace. This immediately logs you out and closes all running processes. When the system comes back (after a few seconds) you will be at the login screen. Moving the serial mouse should work.

Debugging Xorg.conf

There are a few things that could go wrong here. First, you could have entered the wrong information for your mouse (for example, specifying /dev/ttyS0 instead of /dev/ttyS1) or the wrong protocol (for example, Microsoft instead of Logitech). This appears as a mouse pointer that does not move. You can press Ctrl+Alt+F1 to get to a command prompt and re-edit your /etc/X11/xorg.conf file. Pressing Alt+F7 returns you to the graphical window and you can reset the server again using Ctrl+Alt+Backspace.

Note 

At the text command prompt, you will need to use a text editor such as vi or emacs. For example, sudo vi /etc/X11/xorg.conf.

The other bad result is a black screen (maybe with a cursor blinking). This means that you did something wrong and the server failed to start. Use Alt+F1 (or Ctrl+Alt+F1-both key combinations work) to get to a command prompt where you can edit the /etc/X11/xorg.conf file. Look in the /var/log/Xorg.0.log file for error messages. Common things that can go wrong include:

  • Typo-A mistake when entering the configuration file can stop the server from booting.

  • Driver conflict-If you forgot to disable the USB mouse, then there is a driver conflict with the serial mouse. That will block the server.

Unfortunately, if the server crashed, you will be unable to restart it with Ctrl+Alt+Backspace. Instead, run startx to bring up the X server. If the server fails, it will display a lot of debugging information that you can use to resolve the problem. In the worst case, copy the backup back (sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf) and try again. When you finally have a working X-server, you can reboot the system to restart the login screen.

Supporting a Touch Pad

The other type of pointer device that you will likely come across is a touch pad. Touch pads are very common with laptops. Normally, these are identified by the mouse driver and used without any additional configuration.

The default mouse driver does not support special features such as double tapping the pad in place of double clicking, or hot corners in place of shortcuts. These features can be added through the Synaptics mouse driver.

 sudo apt-get install xserver-xorg-input-synaptics 

The full list of configuration options and requirements can be found at http://web.telia.com/˜u89404340/touchpad/index.html. As with other devices, you will need to install the devices driver, configure /etc/X11/xorg.conf, and restart the X-server. The basic "InputDevice" section will look something like this:

 Section "InputDevice"   Identifier "Synaptics Touchpad"   Driver "synaptics"   Option "SendCoreEvents" "true"   Option "Device" "/dev/psaux"   Option "Protocol" "auto-dev"   Option "HorizScrollDelta" "0"   Option "SHMConfig" "on" EndSection 

You will also need to add InputDevice "Synaptics Touchpad" to the "ServerLayout" section of /etc/X11/xorg.conf and restart the X-server.

After installing the device, you can install qsynaptic. This application enables you to graphically configure the touch pad.

 sudo apt-get install qsynaptics qsynaptics 

Configuring USB Devices

Ubuntu supports many types of USB devices. Some devices are recognized instantly and are very usable, but others need additional drivers and some configuration. The first step for configuring a USB device is simple enough: plug it in. The core USB kernel driver should immediately recognize that a USB device has been connected. You can check this with the lsusb command.

 $ lsusb Bus 005 Device 003: ID 0781:5406 SanDisk Corp. Bus 005 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 001 Device 001: ID 0000:0000 Bus 004 Device 003: ID 056a:0014 Wacom Co., Ltd Bus 004 Device 001: ID 0000:0000 Bus 002 Device 002: ID 05ac:0301 Apple Computer, Inc. iMac Mouse Bus 002 Device 001: ID 0000:0000 

You should also see the device listed at the end of /var/log/messages.

 $ dmesg | grep usb [17183135.308000] usb-storage: device found at 3 [17183135.308000] usb-storage: waiting for device to settle before scanning [17183135.308000] usbcore: registered new driver usb-storage [17183140.348000] usb-storage: device scan complete [17183277.088000] usb 4-1: USB disconnect, address 2 [17183279.400000] usb 4-1: new low speed USB device using uhci_hcd and address 3 [17183279.644000] usbcore: registered new driver wacom [17183279.644000] drivers/usb/input/wacom.c: v1.44:USB Wacom Graphire and Wacom Intuos tablet driver 

Making Static USB Devices

USB supports hot-plug devices. This means that USB devices can be disconnected and reconnected without advanced notice for the operating system. The operating system will not crash or become unstable just because a USB device is suddenly unplugged.

Warning 

Although the core USB subsystem permits disconnects at any time, other systems can have problems. Disconnecting a USB thumb drive while it is being written to can corrupt the thumb drive's partition, and disconnecting an X-Windows input device can crash the computer.

Every device on the system needs a device handle in the /dev directory. This can lead to problems with hot-plug devices: each time a device is connected, it may be assigned a different device handle. One time the tablet may be on /dev/input/event0 and the next time it could be /dev/input/event3. The maintenance of these devices is handled by udev, the dynamic device management system. The udev daemon (udevd) is actually a process started by init. You can configure udev to assign a static name to a device. For example, if you have a Wacom USB drawing tablet, you can have it automatically assigned to /dev/wacom rather than using the dynamic device driver handle.

Tip 

The same approach for assigning the tablet to /dev/wacom can be used for assigning a mouse, scanner, or other USB device.

Note 

The Wacom graphic tablet is used throughout this example because it requires each of the configuration steps. Other USB devices may need some or all of these items.

  1. Determine the event driver(s) assigned to the device by looking in /proc/bus/ input/devices. In this example, the device is a Wacom Graphire3 6x8 tablet and it uses the device handlers /dev/input/mouse0, /dev/input/event2, and /dev/input/ts0 for the mouse, stylus, and touch screen, respectively.

     $ more /proc/bus/input/devices ... I: Bus=0003 Vendor=056a Product=0014 Version=0314 N: Name="Wacom Graphire3 6x8" P: Phys= S: Sysfs=/class/input/input3 H: Handlers=mouse0 event2 ts0 B: EV=f B: KEY=1c43 0 70000 0 0 0 0 0 0 0 0 B: REL=100 B: ABS=3000003 ... 
  2. Determine the driver attributes using the event driver (event2 in this example) identified in /proc/bus/input/devices. The udevinfo command will traverse the chain of USB device drivers, printing information about each element. (There will be similar entries for /dev/input/mouse0 and /dev/input/ts0.)

     $ sudo udevinfo -a -p 'udevinfo -q path -n /dev/input/event2' ... device '/sys/class/input/input3/event2' has   looking at class device '/sys/class/input/input3/event2':     KERNEL=="event2"     SUBSYSTEM=="input"     SYSFS{dev}=="13:66" follow the "device"-link to the physical device: looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.3/usb4/4-1/ 4-1:1.0':     BUS=="usb"     ID=="4-1:1.0"     DRIVER=="wacom"     SYSFS{bAlternateSetting}==" 0"     SYSFS{bInterfaceClass}=="03"     SYSFS{bInterfaceNumber}=="00"     SYSFS{bInterfaceProtocol}=="02"     SYSFS{bInterfaceSubClass}=="01"     SYSFS{bNumEndpoints}=="01"     SYSFS{modalias}=="usb:v056Ap0014d0314dc00dsc00dp00ic03isc01ip02" ... 

  3. As root, create (or edit) the /etc/udev/rules.d/10-local.rules file. This is where udev will look when determining how to handle the device. Rules can consist of comparisons (for example, == or !=) and assignments. Rules can use any of the fields displayed by udevinfo. There are other rules files in the same directory if you need additional examples. The manual for udev (man udev) is also very informative.

  4. Add the following line to the /etc/udev/rules.d/10-local.rules file. Be sure to use the name found in /proc/bus/input/devices and the driver name and fields found from the udevinfo command.

     BUS=="usb", DRIVER=="wacom", KERNEL=="event[0-9]*", SYMLINK="wacom" 

    This says to match any device where the bus is usb, the driver is wacom, and the kernel is the string event followed by some digits. Any match will be assigned to the link /dev/wacom.

    Note 

    Try to make the rule as specific as possible, but be aware that fields like ID and SYSFS{dev} can change each time the device is plugged in. For example, if we don't specify the KERNEL, pattern, then the mouse0 and ts0 devices will also match the rule. But, if we add in SYSFS{dev}=="13:66", then it may not match if we plug the device into a different USB port.

  5. Restart the udev system.

     sudo /etc/init.d/udev restart 

    If your tablet is already plugged in, you may also need to unplug the tabled from the USB socket and then plug it in again; otherwise, its device driver may not be recognized.

  6. Check to see if the device appears.

     $ ls -l /dev/wacom lrwxrwxrwx 1 root root 12 2006-08-16 21:45 /dev/wacom -> input/event2 

With these changes, every time the tablet is plugged in, it may still be assigned a dynamic device handle, but the well-known symbolic link will always point to the correct place. When the tablet is disconnected the symbolic link will be removed.

Associating Applications with USB

By default, all new device handles created by udev are only accessible by root. You can change the default ownership and permissions by including an OWNER, GROUP, or MODE assignment in your udev rule. For example:

 SYSFS{idVendor}=="e2e3", SYSFS{idProduct}=="0222", MODE="664", GROUP="floppy" 

The udev rules can also run commands. For example, /etc/udev/rules.d/85-hal.rules contains a command to unmount any mounted USB drives when they are disconnected.

 SUBSYSTEM=="block",ACTION="remove", RUN+="/usr/lib/hal/hal-unmount.sh" 

A similar rule could be added to start a specific program when a specific USB device is connected. For example, when you connect a scanner, you may want the drawing program gimp to start automatically. This way, you can immediately use Gimp to scan in images.

All commands executed by udev are run as root. This can be a security risk for multi-user systems and a problem for interactive applications. For example, if you start the gimp drawing program whenever a scanner is connected, then it will try to run as root; it will also try to connect to the X display and fail. To resolve both of these problems, we can create a /usr/bin/ run_gimp command to always run the program as the user who owns the display (see Listing 3-4). We can then add this script to the scanner's run line in /etc/udev/rules.d/45-libsane.rules. For example, to run Gimp when an HP ScanJet 4100C scanner (USB vendor 03f0, product 0101) is plugged in, you can use:

 SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="0101", MODE="664", \     GROUP="scanner", RUN="/usr/bin/run_gimp" 

Note 

Don't forget to make the script executable by using chmod a+x /usr/bin/run_gimp.

Now, every time the scanner with the USB identifier 03f0:0101 (as seen by lsusb) is connected, the driver will be added to group "scanner" and gimp will be started with the right permissions.

Listing 3-4: /usr/bin/run_gimp

image from book
     #!/bin/sh     # Get the username of the person running the X-window on tty :0     NAME='/usr/bin/who | /bin/grep " :0 " | /usr/bin/awk '{print $1}''     # Udev runs as root but this needs to run as the user     # Run as the user and set the display     /bin/su - "$NAME" "/usr/bin/gimp --display :0" 
image from book

image from book
When Programs Run

There are many different places where a program can be told to run automatically. Some are easy to find, but others can be more difficult to hunt down. More importantly, there is no single right place to install a program. For example, if you want to start a program when a scanner is plugged in, you can either modify /etc/udev/rules.d/45-libsane.rules, or you can run gnome-volume-properties (System image from book Preferences image from book Removable Drives and Media) and change the program that Gnome runs when a scanner is detected.

The main difference between these different options is flexibility. Although Gnome knows about scanners and cameras, only udev knows about other types of devices. In contrast, Gnome is generally easier to configure since udev has no graphical interface. Chapter 7 covers other ways for programs to start automatically.

image from book

Enabling Drawing Tablets

Ubuntu supports the many types of drawing pads, but the Wacom drawing pad has drivers installed by default. Even though the drivers are installed, they are not completely configured. To complete the configuration, you will need to follow a few steps.

  1. Follow the steps mentioned in the "Making Static USB Devices" section to create the /dev/wacom driver handle.

  2. By default, the /etc/X11/xorg.conf contains three "InputDevice" sections for the Wacom driver. It also has these input devices listed in the "ServerLayout" section.

  3. Plug the Wacom drawing pad into the USB port and restart the X-server by pressing Control-Alt-Backspace.

The mouse cursor on the screen should now be controllable by the mouse or drawing pad.

Note 

Tablets and drawing pads may not be common, but installing them requires all of the device configuration steps. This is a fairly long example, but if you have troubles with any new device then you can use this example to help debug the problem.

Debugging the Wacom Tablet

If the tablet does not work, start with the xorg.conf debugging instructions for configuring a serial mouse. This will resolve any problems with the graphical display not starting.

You can also install the wacom-tools. These are a set of diagnostic applications.

 sudo apt-get install wacom-tools 

After installing these tools, you can see the list of supported tablets as well as run the diagnostics program (see Figure 3-6). As you move the tablet's mouse or stylus, the diagnostics program should register movement and any tablet button presses.

 $ wacdump -l art     wacom    serial  "ArtPad" art2    wacom    serial  "ArtPadII" dig     wacom    serial  "Digitizer" dig2    wacom    serial  "Digitizer II" pp      wacom    serial  "PenPartner" gr      wacom    serial  "Graphire" pl      wacom    serial  "Cintiq (PL)" int     wacom    serial  "Intuos" int2    wacom    serial  "Intuos2" c100    acer     serial  "C100" pp      wacom    usb     "PenPartner" gr      wacom    usb     "Graphire" gr2     wacom    usb     "Graphire2" gr3     wacom    usb     "Graphire3" gr4     wacom    usb     "Graphire4" int     wacom    usb     "Intuos" int2    wacom    usb     "Intuos2" int3    wacom    usb     "Intuos3" ctq     wacom    usb     "Cintiq (V5)" pl      wacom    usb     "Cintiq (PL)" ptu     wacom    usb     "Cintiq Partner (PTU)" vol     wacom    usb     "Volito" vol2    wacom    usb     "Volito2" $  sudo wacdump -c usb /dev/wacom 

image from book
Figure 3-6: The text-based wacdump diagnostics program

Warning 

Disconnecting a USB device that is used by the X-server can crash the computer.

Not all removable devices can be removed safely. Removing a USB device that is in use by the X-server can only create problems. In the best case, the device will not function until you restart the X-server. In the worst case, the X-server can hang or the entire computer may crash. If you want to disconnect the Wacom graphics tablet, first log out, then disconnect it, and then immediately restart the X-server by pressing Ctrl+ Alt+Backspace.

Tuning the Tablet

Depending on the tablet model, the coordinates on the tablet may not match your screen resolution. You can resolve this by adding the following options to each of the Wacom "InputDevice" sections in the xorg.conf file.

To automatically set the coordinates on your tablet to match your screen resolution, you can use:

     Option "KeepShape" "on" 

The KeepShape option scales the active area of the tablet so it matches the screen. For example, the tablet likely has a 4:3 aspect ratio. If your screen is 16:9, then the active area on your tablet will start at the top left corner and scale to match a 16:9 region. The bottom of the active area on the tablet will not be usable since it is outside of the 16:9 ratio.

To manually set the coordinates on your tablet, you can use:

     Option "TopX" "0"     Option "TopY" "0"     Option "BottomX" "16704" # match wacdump resolution     Option "BottomY" "12064" # set to match wacdump resolution 

The Wacom tablets have very high resolutions. For example, the Wacom Graphire3 (6 × 8) has a maximum resolution of 16,704 × 12,064. The Wacom driver scales the tablet's range to match the screen resolution. If you set the bottom coordinates to something small, like 1024 × 768, then only a very tiny area of the tablet will be active.

Using Other Tablets

Although support for the Wacom tablet is included by default, other tablets have available drivers. Use apt-cache search tablet to display the list of available drivers. In addition, some tablets may be compatible with other drivers or have drivers available for download from other sources. Your best bet is to research the tablet first and select one that has Linux, and preferably Ubuntu, support.

Each different tablet model will likely have different configuration requirements. Some of the requirements may be automated, while others may require manual modifications. Regardless of the specific requirements, they will all have the same basic steps:

  1. Install a device driver, if one is not already installed.

  2. Create device handle if one is not created automatically.

  3. Load any required software drivers and configuration parameters.

  4. Configure /etc/X11/xorg.conf.

  5. Restart the X-server using Ctrl+ Alt+Backspace.

Tuning TV Cards

TV capture cards are a must-have for any power user. These add-on cards allow you to watch TV through your computer and configure a video recorder such as MythTV (an open source version of the TiVo video recorder system). The driver for video devices is called video4linux (v4l). The v4l driver supports bt848 and bt878 TV cards.

Note 

Most TV cards use the bt848 or bt878. If you look at the card, you should see a quarter-sized chip with "848" or "878" printed on it.

Configuring TV cards is relatively easy.

  1. Install the video card and hook up the TV cable to it. Most TV cards support both broadcast and cable TV signals.

  2. Install the v4l driver.

     sudo apt-get install xserver-xorg-driver-v4l 
  3. Edit /etc/X11/xorg.conf and add v4l to the "Modules" section so X-Windows knows about the video driver.

     Section "Module"         Load    "i2c"         Load    "bitmap"         Load    "ddc"         Load    "dri"         Load    "extmod"         Load    "freetype"         Load    "glx"         Load    "int10"         Load    "type1"         Load    "vbe"         Load    "v4l" EndSection 
  4. Restart the X-server using Ctrl+ Alt+Backspace.

  5. Test the video configuration. The xsane program has a scan option and menu for selecting the TV as input (Figure 3-7). If you see a picture (or static) then the v4l driver is working properly.

image from book
Figure 3-7: Using xsane to test the v4l driver. Since the channels are not configured, only static is captured.

Now that the v4l driver is working, you can install capture, recording, and viewing programs that can configure and use the video card. My favorite is xawtv. This is a simple program for tuning the TV, watching channels, capturing images, and recording shows.

 sudo apt-get install xawtv xawtv-plugin-qt tv-fonts xawtv-tools 

When you first start xawtv it will display the TV screen but may need a little configuration. Right-clicking the TV window will bring up the configuration menu. Be sure to set the norm (PAL, NTSC, and so on), type of signal (for example, us-cable), and the input source (Television). Use the up and down arrows to change channels. When you find a configuration that works for you, save it using E. This option is actually used to set channel names, but saves the entire configuration in $HOME/.xawtv. Listing 3-5 shows a sample configuration. At this point, xawtv should be working for you and the TV card is fully configured (see Figure 3-8).

image from book
Figure 3-8: The xawtv program showing the TV in a window

With a working TV card you can also configure your screen saver to grab pictures from the TV.

Tip 

If you change the screensaver from the default gnome-screensaver to xscreensaver (see Chapter 9), then you can configure some of the screensavers to use the TV card. You will find this option in xscreensaver's preferences as Grab Video Frames under the Advanced tab settings. Screensavers such as Distort and Flipscreen3D will manipulate TV captures.

Using Digital Cameras, Scanners, and Web Cameras

Although TV cards are cool, they are not as common as digital cameras, scanners, and web- cams. Unfortunately, this is where hardware support really becomes hit-and-miss. My eight- year-old SCSI scanner is supported, whereas my newer USB scanner is not. And although both of my digital cameras can work as webcams under Windows, neither can work as webcams under Linux.

Note 

Not every camera provides the same compatibility. If your camera does not support a capture mode, then you cannot use the computer to take pictures with it and you cannot use it as a high- resolution webcam.

A tool that you may want to consider installing is gphoto2. This program provides support for over 700 different camera models. It enables you to scan for compatibility with the camera and query supported functionality.

  1. Install gphoto2 as well as the graphical front end (gtkam) and the gimp plug-in to allow captures from cameras.

     sudo apt-get install gphoto2 gtkam gtkam-gimp 
  2. Plug your camera into the USB port. There is no need to restart the X-server in order to load the drivers. If any windows, such as the camera import applet, pop up with prompts to import images or show the camera's contents, just close them.

  3. Determine if the camera is supported. If the gphoto2 command does not auto-detect your camera, then the camera is not supported. You may need to use a different driver if one is available. If the camera is mounted as a disk, then it will not be listed as a camera device.

     $ gphoto2 --auto-detect Model                           Port ---------------------------------------------------------- HP PhotoSmart 618               usb: 
    Note 

    Depending on your camera model and capabilities, you may see multiple lines of output from the gphoto2 –auto-detect command.

  4. List the camera's capabilities. Most digital cameras have two PC-connect modes. The first mode is usually called something like digital device and makes the camera appear as an actual USB camera. The second mode makes the camera appear as a USB drive. The different camera modes provide different attributes. For example, here are the attributes for the HP PhotoSmart 618 in digital device mode.

Note 

The ability to switch PC-connect modes depends on the camera. You will need to hunt through the camera's configuration menu to see if mode selection is supported and to change modes.

 $ gphoto2 --abilities Abilities for camera             : HP PhotoSmart 618 Serial port support              : yes USB support                      : yes Transfer speeds supported        :                                  : 9600                                  : 19200                                  : 38400                                  : 57600                                  : 115200 Capture choices                  :                                  : Capture not supported by the driver Configuration support            : no Delete files on camera support   : yes File preview (thumbnail) support : yes File upload support              : no 

For a comparison, here are the attributes for the same camera in USB disk drive mode.

 $ gphoto2 --abilities Abilities for camera             : USB PTP Class Camera Serial port support              : no USB support                      : yes Capture choices                  :                                  : Capture not supported by the driver Configuration support            : yes Delete files on camera support   : yes File preview (thumbnail) support : yes File upload support              : yes 

Depending on your supported capture modes, you may be able to use the camera with scanner software such as Gimp and xsane, or with VoIP and teleconference software like WengoPhone (see Chapter 5). Even if the camera does not support captures or webcam mode, you can still access the device as a USB drive and copy (or move) off images. In USB disk drive mode, the camera appears no different than a USB thumb drive. You can transfer files by opening the drive via Nautilus and copying off the files. In digital device mode, use gtkam to view the photos and copy them to the desktop.



Hacking Ubuntu
Hacking Ubuntu: Serious Hacks Mods and Customizations (ExtremeTech)
ISBN: 047010872X
EAN: 2147483647
Year: 2004
Pages: 124
Authors: Neal Krawetz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net