Linux Step By Steps

Configuring & Using Philips USB Webcams

Updated by Net Llama! on 25-November-04.

Maintanence of the kernel module for Philips USB webcams has been resumed by Luc Saillard.  Kernel and standalone patches are available here.  The content below in green is being kept here for historical reasons, however much of it is no longer accurate.

Please note that a great deal of the information on the page was gleaned from this site maintained by the author of the Linux kernel driver for the Philips webcam.  
I strongly urge you to look over the site, as it covers alot of details that I've glossed over in the interest of simplicity or brevity.

The Philps brand line of USB webcams are some of the most fully featured & best supported webcams in Linux today.  They work well on both x86 and PPC based boxes, and the range of available software allows you to do everything from taking snapshots, to performing astronomy experiments, to making movies with sound!  However, the path to getting them fully functional is far from simple or obvious.  Thus, I am providing what worked for me.

Requirements before you can even begin to setup your computer to use the Philips webcam:
  1. The first requirement is to have a computer (or laptop) with a USB port, and a Philips (or compatible, see the above referenced website for some of the other compatible cameras) USB webcam.  Make sure that USB is activated in your computer's BIOS (if applicable).
  2. You must be running a 2.4.x or 2.6.x kernel.  Yes, there is very limited support under the 2.2.2x kernels, however it is so limited that you'll never be able to access the wide range of features that the camera provides.  You can determine the kernel version you're running with the command "uname -r ".  If you find that you're not running a 2.4.x kernel, then you will need to build a new kernel.  As of this writing, the latest stable 2.4.x kernel is 2.4.18.  If you're unfamiliar with how to build your own kernel, please see the kernel building SxS.  Yes, some vendor supplied 2.4.x or 2.6.x kernels might work, but I certainly can't guarentee it, and anyway, I build my own kernels and you should too!  Additionally, make sure that your  kernel works before you start attempting to get the camera working.  Troubleshooting camera problems will be alot more difficult if the functionality of your kernel is questionable.
  3. You must be running version 4.x of XFree86 or version 6.7.x of X.  Previous versions of XFree86 (3.3.x or older) do not utilize the architecture or modules needed to support what is known as "video4linux", which is required to use the webcam.  Usually the easiest way of determining if you're running 4.x.x of XFree86 is to look in /var/log for a file called XFree86.0.log and if your'e running Xorg, look in /var/log/messages for Xorg.0.log.  If you have it, you're definitely running the 4.x series.  If you don't, then odds are, you're not, and you've got some upgrading ahead of you.  The XFREE SxS section is most likely what you're looking for.
The Steps:
1) Make sure that your kernel has support for USB, video4linux and the Philips Web Cam.  I've compiled support for these items as modules by saying "M" to the following:
Boot into this kernel.

) Next configure X so that it has video4linux support.  You acomplish this by editing the Modules section of /etc/X11/XF86Config so that it has a line like this:
Load    "v4l"

Additionally, in the same Modules section, make sure that you have a line like this:
Option    "xfree86-dga"

In order for these changes to take effect, you need to restart X by either rebooting or hitting Control-Alt-Backspace. In either case, you probably will want to log out first.

3) All the steps from here on assume that you have booted into the kernel with the neccesary support noted above, your webcam is plugged into the USB port, and that you've configured X properly (also as noted above).  It might be beneficial to monitor your messages log in a separate terminal window, so that you can see what is happening behind the scenes.  You can do this with the command "tail -f /var/log/messages".

4) Add the following lines to the bottom of /etc/modules.conf:
alias video0    pwc size=qcif fps=15 power_save=1
post-install pwc /sbin/insmod --force /lib/modules/usb/pwcx-i386.o >/dev/null 2>&1 || :
alias usb       usb-uhci

NOTE: The second of the 3 lines refers to a pwcx-i386.o module which provides optional data compression support.  This module is not part of the official Linux kernel, and needs to be downloaded separately from the website noted at the top of this page.  This is due to the fact that the module is only available in binary format.  If you are not comfortable using software that isn't open source, then this module isn't for you, and omit the 2nd line from your modules.conf file.  You can still use your webcam, however you will not be able to use it under higher resolutions or larger frames per second (fps).

5) Let's load all the modules needed to make the camera work, with these commands (as root):
modprobe usbcore
modprobe pwc
size=qcif fps=15 power_save=1
modprobe audio
modprobe usb-uhci

NOTE: replace usb-uhci with usb-ohci if your box uses an ohci USB controller.

Once you've done this, the output from "/sbin/lsmod" should include the following:
Module                  Size  Used by    Tainted: PF
usb-uhci               20964   0  (unused)
audio                  37920   0
pwcx-i386              87104   0
pwc                    38944   0  [pwcx-i386]
videodev                2912   1  [pwc]
usbcore                48000   1  [usb-uhci audio pwc]

6) After all this work, your camera should be ready for action.  There are many packages out there that will allow you to play with the camera in different ways.  In my opinion, the most user friendly is CamStream , which is written by the same guy who writes the pwc module for the camera.  CamStream is designed to take advantage of all the unique features that Philips webcams have.  It is lacking support for creating movies, however it does allow you to take timed snapshots with varying resolutions and fps, all with the click of a button.  So, at the very least, it will allow you to verify that you've set up your camera correctly.  So, play with CamStream for a bit.  If it meets your needs, great.  If not, then keep reading.

7) The so-called 800lb gorilla in the webcam world is XawTV .  It has more features and functionality than any of the other choices out there, however the interface is incredibly unintuitive (in my opinion), its lacking in user-friendly documentation, and getting it setup can be a painful & frustrating experience.  However, it does what i need it to do, namely, create movies from the camera stream.  XawTV comes with a lot of Linux distributions, so you might already have it installed, or at the very least, have the package on the distro CD(s).
If you just run "xawtv", you'll get the basic camera window, and nothing else, which will leave you wondering what to do next.  What you can do is right click in the window, and you'll get a menu to play with.  However, I've found that menu to be basically useless when it comes to creating a movie, as the "Movie" button doesn't work at all for me. Part of XawTV is a command line utility called streamer, which allows you to create sound, image and movie files from you camera's video stream.  This is what I've had great success in using to create AVI format movies with sound.  However in order to do this, you will first need to determine which audio devices your camera has been bound to:
  1. Look in /var/log/messages for entries similar to these:
  2. usbaudio: registered dsp 14,35
    usbaudio: registered mixer 14,16

  3. What you want to pay attention to are the two numbers after dsp, which are the major and minor numbers of the /dev/dsp device that your camera is using.  You can normally look these up in /usr/src/linux/Documentation/devices.txt, however for convenience, here are what they correspond with:
  4. crw-rw-rw-    1 netllama root      14,   3 Feb  9 09:36 /dev/dsp
    crw-rw-rw-    1 root     root      14,  19 Feb  9 09:36 /dev/dsp1
    crw-rw-rw-    1 root     root      14,  35 Apr 25 19:05 /dev/dsp2

    So on my box, its using /dev/dsp2.  If you don't already have a /dev/dsp2, you can create one with this command:
    mknod /dev/dsp2 c 14 35
  5. Once you know which dsp device your camera is using, you should be ready to create your first movie with this command:
  6. streamer -F mono8 -f jpeg -r 15 -s 352x288 -t 0:05 -C /dev/dsp2 -o test.avi
    Please note that this command makes several assumptions:

    At any rate, the above command will produce an AVI movie that runs for 5 seconds, with sound.
    streamer has many, many other features, and the best way to view them is with the command "streamer -h".

  7. You can watch the movies you create with MPlayer.  If you don't already have MPlayer, check out my guide for getting it working here.

The world of video creation & editing is quite broad, even under Linux.  This material should allow you to get your feet wet.  For additional reading material, I recommend the following: