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.

3 comments:

  1. Thank you wery much, this was the most usefull how to that I have found on the web. My webcam is now working...
    Thanks

    ReplyDelete
  2. Thank you very much for this post! Exactly what I needed. I spent hours searching information on how to get GC Pro 5000 work on Linux before I stumbled upon your article. Can't believe it was this simple. Thank you!

    ReplyDelete
  3. Nice post. I learn something totally new and challenging on blogs I stumbleupon every day.

    ReplyDelete