Logitech Webcam & Skype under Ubuntu

  • Digg
  • Twitter
  • Facebook
  • Delicious
  • StumbleUpon

This should help solve the green screen webcam problem in skype.

NOTE: koen in the comments linked to this blog post, with a much cleaner solution to the problem than the one presented below. I haven’t tested it myself but it looks solid. Check it out!

Why

With the release of the new version of Ubuntu this week I was unable to contain the urge to wipe my hard drives clean and do a fresh install. After backing-up everything I could think of, I proceeded to format my drives, and install Ubuntu 9.04.

Needless to say, I had completely forgotten about all the customisations I had done previously, including that to make Skype play nice with my webcam (Logitech Quickcam for Notebooks). Much to my surprise when I re-installed Skype I found a lovely green screen in the webcam test window rather than my ugly mug.

It took me a while to route out how this was solved before.

The reason for the green screen is that Skype which is a v4l-1.0 application is trying to talk to a v4l-2.0 device. And they just don’t play nice together… along with most other applications that make use of webcams in Linux.

A nice work around that I found worked was, rather than running skype directly, get v4l1compat.so preloaded first. v4l1compat.so provides a compatibility layer allowing Skype and the device to get along.

I have seen some people doing this next bit by renaming skype to skype.real and then creating a new skype in its place, but I prefer the solution below.

Preloading v4l1compat.so

Create a new file: /usr/local/bin/skype

#!/bin/bash
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so /usr/bin/skype

You will need to make it executable (Thanks Tim!)

sudo chmod a+x /usr/local/bin/skype

/usr/local/bin/skype supercedes /usr/bin/skype, so when the command skype gets called, it is in fact our script /usr/local/bin/skype that will be called.

Be sure to have /usr/bin/skype rather than just skype in your new file, because if you just had skype your computer would come crashing down in an infinite loop!

Note: I am using 64-bit Ubuntu so I installed the skype package from here.

Error

I was getting the following error when launching skype

ERROR: ld.so: object '/usr/lib/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.

and had to install the 32-bit v4l libraries.

sudo apt-get install lib32v4l-0

As a result I had to modify /usr/local/bin/skype to reflect this. So rather than this:

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

I had this:

LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so /usr/bin/skype

Well there you have it. I hope this helps.
I know that this being here will help me remember how to fix it the next time I do a clean install.

18 Responses to “Logitech Webcam & Skype under Ubuntu”

  1. stlouisubntu says:

    Thanks for the tip, friend. However, I am running 64-bit hardy with a Logitech QuickCam S 5500 for Business. I installed the drivers using easycam. The camera works fine with cheese and works fine in testing mode in Skype (installed 64-bit Skype from medibuntu repos), but not during a call. During a call my transmitted video is snow with a green bar or two. The received video is fine and the audio is fine. The one time I did happen to get the transmitted video working ok, then the transmitted audio wouldn’t work. Any further ideas. I tried fakegstreamer and it wouldn’t compile right for me (maybe a 64-bit issue.) Tried your above tip and I do not have a /user/lib/libv4l/ directory at all.

    Thanks.

  2. Thanks for this – a handy reference which I won’t hesitate to point people to if they run across the same problem :)

  3. eoin says:

    Hi,

    I’m not sure what is wrong since you said you have video in your skype webcam preview window but not in your calls.

    The only thing I could suggest is that you install the libv4l packages and see if that helps.

    sudo apt-get install libv4l-0 lib32v4l-0

    After that the folders mentioned above should be present.

    Hope it helps.

    @PeterParkes Thanks!

    eoin

  4. Tim says:

    Hi,
    This didn’t work for me. Without the new file, I get a flickering green screen. With the new file, it flickers for just a second and then Skype crashes.
    Any ideas? I have updated to Jaunty, use Skype 2.0.0.72 and a Logitech Quickcam Comunicate STX webcam. The webcam works with other apps.
    Thanks,
    Tim

  5. Tim says:

    Hi I just found this http://forum.skype.com/index.php?s=&showtopic=252681&view=findpost&p=1512731
    which is the same as yours, but it adds a command
    sudo chmod a+x /usr/local/bin/skype

    Works great now.
    Guess I’m showing off my newbieness.

    Thanks again,
    Tim

  6. eoin says:

    Hi Tim,

    I just saw both your comments now.
    No, no. I honestly forgot to add those steps. I’ll go ahead and add it in now and give you credit :)

    Sorry, and thanks!

  7. e.m.fields says:

    you’re the bomb.

  8. koen says:

    or you can configure to preload the compat library system wide, as easy as : http://blog.export.be/?p=263

  9. Tink says:

    Hi Eoin,
    Thanks to you I now seem to have my logitech camcorder working..at least I can see myself!!, but I have no sound. When I try to get it going I get this message bt_audio_service_open: connect() failed: Connection refused (111)
    Obviously I have problem in set-up but being not only a newbie, but a very old one, its beyond me. Can you help?
    Tink

  10. Dean says:

    This problem had me stumped for ages. Your advice here was invaluable. Well done!

  11. As Dean said… THANKS A LOT !!!

  12. lleming says:

    Thanks Eoin
    This is greate my camera work with skype.
    In entire internet only this page realy helped me.
    Why nobody mention that skype build to use v4l1
    I try everything gspca and v4l2 and a lot of other recomendation
    and couldnt understand wats wrong. And in reality just need preload v4l1 driver

    I think this should be on skype.com on download page deb package

    :)

    Thanks Thanks Thanks !!!!!!

  13. Igor says:

    Thank you. Worked as a charm for Ubuntu 9.10 on 64-bit.

  14. crocuz says:

    Here its right now: Great workaround, mate!!! I got stuck with my STX in Jaunty and had to install VirtualBox to run it under XP, which was just slow and everything but nice…now its working perfectly!! Thanx so much, man…

  15. Thanks, man!

    I am try to fix this problem for weeks now – but no tutorial told about the difference between 32 to 64bit Ubuntu and as I am only a beginner…

    Thanks once again – you made my day!
    (Will link here from my blog!)

  16. eoin says:

    No problem Sven,

    believe me, I was very happy too when i figured this out :-)


    eoin

  17. DJ_Cripple says:

    Awesome! this worked for me, only solution I’ve found that works under 64-bit linux um-bongo (karmic)

  18. haitham says:

    this worked on me on jaunty 64 bit.
    thanks

Leave a Reply