Showing posts with label webcam. Show all posts
Showing posts with label webcam. Show all posts

Friday, August 7, 2009

Skype with the Logitech Quickcam Pro 5000

Some owners of this webcam face problems and report that it does not work with Skype for Linux. It does work. It is a problem with Skype and the solution in this post applies to many other cameras.

A previous post shows how to install the camera under Linux (openSUSE 10.3 and 11.0).

The latest Skype for Linux (version 2.0.0.72) dates from June 2008. Skype did not release any updates. A post in January 2009 announced that Skype for Linux is definitely not dead [...] Stay tuned for more developments. The next post on 31st of July 2009 says: can’t make any promises about when it’ll be released, but watch this blog for further updates. How many popular open source projects get no updates during an entire year? Skype is not open source and no one can fix even simple bugs. That's why.

[Update: Also works under SuSe 11.2 and the new skype version 2.1.0.47. For microphone issues see here]

How to solve it

The solution only takes one command but a detailed explanation could be useful for beginers:

  1. Install or test the webcam (see the previous post).

  2. Close skype if it is running (CTRL-Q)

  3. Open konsole, xterm or any terminal (e.g. from the menu under System->Terminal).

  4. Start skype from the terminal (so that any error messages appear there)

    user@host:~> skype
  5. In Skype select Options -> Video Devices.

     
  6. Confirm that your webcam is selected. If you have several devices select the webcam.

  7. Press "Test"

    If you see the image from the camera, great. Most likely you see only black, green, white or something else that you do not regard as a success. The terminal might also show errors such as:

    Skype V4L2: Could not find a suitable capture format

    Skype Xv: No suitable overlay format found

  8. Quit skype (or simply use CTRL-C in the terminal)

    What is the problem?

    The newer Linux kernels support many webcam drivers but the legacy Video4Linux API has been dropped and only Video4Linux version 2 is supported. Since skype 2.0.0.72 uses Video4Linux version 1, there is an incompatibility.

    What is the solution?

    The solution is to dynamically load a shared library that provides compatibility between version 1 and 2. Theses libraries are now in your system but the paths depend on the distribution (try "locate v4l2convert.so" or use a find utility to locate v4l2convert.so and v4l1compat.so). If you run a 64bit system use the 32bit version of the library with skype.

  9. Start skype from the terminal with one of the following commands (these are paths for SuSE. Both worked.):

    me@host:~> LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

    me@host:~> LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype

    Repeat steps 5-7 and it should work.

Increase your confort

Here are three possibilities to avoid having to type the command. The first method is the favorite and incidentally the only one which works in any normal circumstance (the others fail if you leave to your window manager to restore the last session on login).

  • Add the following line to either one of .bashrc or .xinitrc in your home directory (if there is no .xinitrc, you can make a copy of .xinitrc.template and edit the section "# Add your own lines here...").

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

    Or if your LD_PRELOAD variable is already set:

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

    Since either with .bashrc or .xinitrc the variable will be set before the session is restored, Skype will start with the compatibility library in place :-).

  • If you start skype from a shell, an alias can be crated by adding a line such as the following to .bashrc.

    alias skype='LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype'

    Next type you type skype the alias will be used.

  • If you launch Skype from the KDE menu, locate the icon in the application menu and right click on it. Choose "Edit Item" and replace "skype" with:

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

    Do not forget to save the change. If there is a Skype button in the Pannel, just edit it and also replace the command there.

Wednesday, August 5, 2009

Logitech Quickcam Pro 5000 on SuSE Linux

To replace a Phillips ToUcam Pro which broke after being squeezed too hard into its "egg case" we got an unidentified second-hand webcam. With a flexible mount, it fits easily any screen but did not work out-of-the box either under Linux or XP.

This post describes the steps to install the camera under Linux and the next post explains a trick to make it work with the "latest" skype video (version 2.0.0.72).

Logitech Quickcam Pro 5000

We use openSUSE (tested on 10.3 and 11.0) but it is trivial to make it work with other popular distributions (e.g. Ubuntu, etc) by using their package installation tools.

[Update: Tested also on SuSE 11.2]

1. Does the device connect to a USB bus?

USB devices may be listed with the command lsusb. After the webcam is connected to a usb port the result of lsusb should include one more line. In my case:
Bus 003 Device 005: ID 046d:08c5 Logitech, Inc.
So, this webcam identifies itself as 046d:08c5. From this it was possible to identify the model of the our webcam. Many people have a version of the Quickcam Pro 5000 reporting another ID:
Bus 001 Device 003: ID 046d:08ce Logitech, Inc. QuickCam Pro 5000
Anyway, if you see one of these your webcam is connected.

2. Installing the UVC drivers

As can be seen from the devices page from the Quickcam Team, the Quickcam Pro 5000 is a USB Video Class (UVC) compatible camera device (there are compatibility issues with some USB controllers).

[You might need to select a repository of drivers for webcams. In YaST->Community Repositories, select "openSUSE BuildService - Drivers for webcams"]

To install the driver in SuSE open YaST->Software Management (search with "uvc" for convenience) and install packages uvcvideo (choose the one for your kernel, usually uvcvideo-kmp-default) and luvciew (useful to test the camera). You will also need packages related to Video4linux. We have libv4l and v4l-conf installed (in YaST search "v4L" and install if necessary):

3. Testing

After rebooting, connect the webcam and run luvcview from a terminal. You should see a window such as this (after removing the lens cap and pointing the webcam to a postcard from London :-)

Photo of the luvcview window (not true image quality).

That's it! The Logitech Quickcam Pro 5000 is now working.