15
Nov
2009
quinox

Getting my webcam to work on Linux 2.6.31

  1. # udevadm monitor
  2. Plug webcam into USB port
  3. See the following from udevadm:

    KERNEL[1258313701.178493] add /kernel/uids/1006 (uids)
    UDEV [1258313701.178517] add /kernel/uids/1006 (uids)
    KERNEL[1258313701.829976] add /devices/pci0000:00/0000:00:02.0/usb2/2-4 (usb)
    UDEV [1258313701.831655] add /devices/pci0000:00/0000:00:02.0/usb2/2-4 (usb)
    KERNEL[1258313701.833268] add /devices/pci0000:00/0000:00:02.0/usb2/2-4/2-4:1.0 (usb)
    UDEV [1258313701.834303] add /devices/pci0000:00/0000:00:02.0/usb2/2-4/2-4:1.0 (usb)
  4. # udevadm info --query=all --attribute-walk --path /devices/pci0000:00/0000:00:02.0/usb2/2-4

    looking at device '/devices/pci0000:00/0000:00:02.0/usb2/2-4':

    ATTR{idVendor}=="046d"
    ATTR{idProduct}=="092f"

    ATTR{manufacturer}==" "
    ATTR{product}=="Camera"

    looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2':

    looking at parent device '/devices/pci0000:00/0000:00:02.0':

    looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

  5. Google 046d:092f and find out it's a Logitech QuickCam Express. Google some more and discover its driver is GSPCA, which is no longer a separate module but an in-kernel one.
  6. # cd /usr/src/linux && make menuconfig
    Enable:
    Device Drivers -> Multimedia Support -> Video For Linux
    Device Drivers -> Multimedia Support -> Video capture adapters -> V4L USB Devices -> GSPCA based webcams -> Enable all SPCA5xx camera drivers. (Once the camera worked I found out by using lsmod that only SPCA561 was needed)
  7. modprobe the new modules or reboot the computer
  8. # udevadm monitor
    After plugging in the camera:

    KERNEL[1258315384.769022] add /devices/pci0000:00/0000:00:02.0/usb2/2-3 (usb)
    UDEV [1258315384.770643] add /devices/pci0000:00/0000:00:02.0/usb2/2-3 (usb)
    KERNEL[1258315384.771997] add /devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0 (usb)
    KERNEL[1258315384.810075] add /module/gspca_main (module)
    UDEV [1258315384.810481] add /module/gspca_main (module)
    KERNEL[1258315384.821031] add /module/gspca_spca561 (module)
    UDEV [1258315384.821191] add /module/gspca_spca561 (module)
    KERNEL[1258315384.993956] add /devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/video4linux/video0 (video4linux)
    KERNEL[1258315384.994056] add /bus/usb/drivers/spca561 (drivers)
    UDEV [1258315384.994171] add /bus/usb/drivers/spca561 (drivers)
    UDEV [1258315384.994277] add /devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0 (usb)
    UDEV [1258315385.011577] add /devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/video4linux/video0 (video4linux)
  9. $ camorama
    The LED on the camera blinked and camorama reported "Cannot capture"
  10. Google gspca_spca561 and come across http://lists.zerezo.com/video4linux/msg24804.html
  11. # emerge -avt libv4l
  12. $ LD_PRELOAD=/usr/lib64/libv4l/v4l1compat.so camorama

And then it worked, yay.

Note: all commands starting with # are run by root, with $ are run by my own user.

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <hr> <img>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.