Webcam Setup

From ArchWiki

Jump to: navigation, search


i18n
English
简体中文

Contents

[edit] Introduction

This is a guide to setting up your webcam in Arch Linux.

[edit] Identify your webcam

Identify the name of your webcam and find a proper driver. Below is a list of webcams, and what drivers they work with. Click on the link to the right of the device name for information on compiling modules and other information. If you get your webcam to work, add the name of the webcam and the driver you used to the list!

[edit] pwc

  • Creative Labs Webcam Pro Ex
  • Logitech QuickCam Notebook Pro (only the "Pro" models)
  • Logitech Quickcam Pro 4000
  • Philips ToUCams (not confirmed at the moment, but it's using the pwc driver if I remember correctly)

[edit] qc-usb

  • Dexxa Webcam
  • Labtec Webcam (old model)
  • LegoCam
  • Logitech Quickcam Express (old model)
  • Logitech QuickCam Notebook (not the "Pro" models)
  • Logitech Quickcam Web

[edit] qc-usb-messenger

  • Logitech Quickcam Messenger
  • Logitech Quickcam Communicate

It is now in the community repo.

Note: If qc-usb-messenger does not work use the gspca module, by installing the gspcav1 package.
Note: Now this driver is a module included in kernel 2.6.27

[edit] zr364xx

This driver can be used for many webcams like:

  • Aiptek PocketDV 3300
  • Creative PC-CAM 880
  • Konica Revio 2
  • Genius Digital Camera
  • Maxell Maxcam PRO DV3

You can find the full list of supported devices here. You can find a PKGBUILD for this driver on the AUR.

[edit] sn9c102

  • Trust Spacecam series
  • Maxell Smartcam (for notebooks): 352x288 max. resolution @ 3fps

[edit] spca5xx

An extensive list of supported webcams is available here.

  • Logitech QuickCam IM
  • Logitech QuickCam for Notebooks Deluxe
  • Logitech QuickCam Express
  • Labtec Webcam Pro
  • Trust Mini Webcam WB-1200p

Kernels >= 2.6.11 would now use the gspca module, by installing the gspcav1 package.

[edit] stv680

Many cheap no-name cameras that came out Asia in the last couple of years use the stv680 chipset. Most of these cameras were novelty items (i.e. Pencam, SpyC@m and LegoCam).

  • Aiptek PenCam series
  • Digitaldream series
  • Dolphin Peripherals series
  • Lego LegoCam
  • Trust SpyC@m series
  • Welback Coolcam

A more-complete list of webcams that use the stv680 chipset is available here.

[edit] linux-uvc

  • Logitech Quickcam Pro 5000
  • Logitech Quickcam Pro 9000
  • Logitech Quickcam Orbit MP
  • Microdia Pavilion Webcam (on MSI PR200)

You can find a full list of supported UVC devices here.

The package linux-uvc-svn-all is available in AUR.

Note: This driver does not have V4L1 support.

[edit] ov51x-jpeg

  • Sony EyeToy
  • Chicony DC-2120
  • Chicony DC-2120 pro
  • Trust Spacecam 320
  • Hercules Webcam Deluxe
  • Hercules Webcam Classic
  • Creative Live! Cam Notebook Pro VF0400
  • Creative Live! Cam Vista IM
  • Creative Live! Cam Vista IM VF0420
  • Creative Vista Webcam VF0330
  • ASUS webcam Model?
  • Philips PCVC820K/00
  • NGS showtime plus
  • HP VGA Webcam with Integrated Microphone

This is a kernel module found in the AUR with some additions to the original driver that provide jpeg decompression. See the webpage

For me to get my "Creative Live! Cam Vista IM" working with Skype I had to add this line to /etc/modprobe.conf

options ov51x-jpeg forceblock=1

[edit] r5u870 (Ricoh)

  • HP Pavilion Webcam
  • HP Webcam 1000
  • Sony VAIO VGP-VCCx

The Ricoh webcam is built into most new Sony laptops. There are packages for the firmware (install first) and driver in AUR.

kernel26 dependency The r5u870 driver is currently broken for kernel 2.6.26 and later. For kernel 2.6.26 and later, just remove r5u870 and r5u870-fw, install from aur this userspace tool (provides firmware too) and run loader command.

[edit] stk11xx (Syntek)

  • Integrated camera in lot of Asus laptops
  • Asus A8J, F3S, F5R, F9E, VX2S, V1S, A6T

Just install this AUR package. It contains the right kernel module.

[edit] Make sure to load the needed module for your webcam

The easiest way is to let rc.conf load the needed module at boot. Edit rc.conf. In the MODULES array, add the module of your webcam. This will load your webcam module into the kernel at bootup.

Note: If your webcam is USB, the kernel should automatically load the proper driver. In that case, after you plug your webcam in, see what dmesg says. You should see something like that:

$ dmesg|tail
sn9c102: V4L2 driver for SN9C10x PC Camera Controllers v1:1.24a
usb 1-1: SN9C10[12] PC Camera Controller detected (vid/pid 0x0C45/0x600D)
usb 1-1: PAS106B image sensor detected
usb 1-1: Initialization succeeded
usb 1-1: V4L2 device registered as /dev/video0
usb 1-1: Optional device control through 'sysfs' interface ready
usbcore: registered new driver sn9c102

[edit] Permissions

In order to use your webcam you need to have permission to use /dev/video0.

[edit] udev

If you use udev (which is default as of kernel 2.6.13) you only need to be in the group video. You can check it with:

$ groups

To add a user to the group run under root:

# gpasswd -a <username> video

[edit] devfs

Add the following to your /etc/devfsd.conf. This will give normal users permission to use /dev/video0 (your webcam).

# Give normal users access to webcam
REGISTER        video0       PERMISSIONS     root.users 0660

[edit] Get software to use your webcam

With version 2.6.27 many new webcam driver is supported by the kernel. But with the merge, the legacy Video4Linux API has been dropped, these driveres only support V4L version 2. In V4L2 there is no kernel space decoding for any pixelformat (rgb,yuv,jpg and so on) so every application have to support it on its own. To prevent this, a new library called libv4l has been created and in the feature most programs will use this, and the webcams will work fine. Till then, compatbility layers are available.

If your device is created but you image looks strange (mine was nearly completely green), you probably need this.

If the application has V4L2 support but no pixelformat support (eg: cheese) then use the following command:

 LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so cheese

If the application only supports the older version of V4L (skype is the most popular of this kind of software) then use this command:

 LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

Hint: You also might want to put a line like the following into your .bashrc or .xinitrc so you don't have to type that long command all the time:

 export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so

or

 export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so

[edit] Cheese

Cheese is the GNOME photo/video taking client. It is similar to Photo Booth in Mac OS X. It is now in extra and is also part of the gnome-extra group

[edit] GTK+ UVC Viewer (guvcview)

guvcview is a simple GTK interface for capturing (with sound!) and viewing video from devices supported by the linux UVC driver. Available in the AUR.

[edit] Kopete

Kopete is the KDE instant messaging (IM) client. As of KDE 3.5, it has support for MSN and Yahoo! webcams, but not every cam works yet. It is included in the kdenetwork package.

[edit] xawtv

This is a basic v4l device viewer, and although it is intended for use with TV tuner cards, it works well with webcams. It will display what your webcam sees in a window. Install it using

# pacman -S xawtv

Run it with

$ xawtv -c /dev/video0

If you're using a nVidia graphic card, and you get an error like

X Error of failed request:  XF86DGANoDirectVideoMode
 Major opcode of failed request:  139 (XFree86-DGA)
 Minor opcode of failed request:  1 (XF86DGAGetVideoLL)
 Serial number of failed request:  69
 Current serial number in output stream:  69

you should instead run it as:

$ xawtv -nodga

[edit] VLC

VLC can also be used to view and record your webcam. In VLC's file menu, open the 'Capture Device...' dialog and enter the video and audio device files. Or from the command line, do:

$ vlc v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2"

This will make VLC mirror your webcam. To take stills, simply choose 'Snapshot' in the 'Video' menu. To record the stream, you add a --sout argument, e.g.

$ vlc v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2" --sout "#transcode{vcodec=mp1v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=file,mux=mpeg1,dst=/tmp/test.mpg}}"

(Obviously a bit overkill with regard to the bitrates but it's fine for testing purposes.) Notice that this will not produce a mirror on the display - in order to see what you're recording, you would need to add the display as a destination to the argument:

... :duplicate{dst=display,dst=std{access= ....

(Though this can tax older hardware somewhat...)

[edit] ekiga

This is very similar to Microsoft NetMeeting. Get it with

# pacman -S ekiga

The configuration druid will set everything up for you.

[edit] Sonic-snap

Sonic-snap [1] is a viewer/grabber for sn9c102-based webcams only. Available in AUR.

[edit] Skype

The newest version of Skype has video support. Check Video Devices in the options for a test image which you can double-click to make full screen. You can install Skype with:

# pacman -S skype

If you get green/disorted picture with skype read the section Webcam_Setup#Get software to use your webcam above.

Personal tools