actionshrimp.com

fun and geekery

13  08 2008

Logitech QuickCam E2500 on Ubuntu Skype

I recently discovered the wonders of skype, and tried to get my new webcam working with it under linux, and of course this proved to be quite tricky. After much fiddling I eventually got it to work, hopefully these steps will work for you too.

The gspca drivers are available from here, I was using a specific version dated 20071224 to work with a patch file I found - many thanks to redeye on the QuickCam team forums. If you use a different version of the drivers, you can just examine the patch file and insert the changes manually.

First, download the drivers and the patch

wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20071224.tar.gz
wget http://forums.quickcamteam.net/attachment.php?aid=86 -O patch.tar.gz

Then extract and apply the patch:

tar -xvf gspcav1-20071224.tar.gz
tar -xvf patch.tar.gz
cd gspcav1-20071224
patch -p1 < ../quickcamE2500.diff

There’s a handy build script included with the drivers so just run that (requires root):

sudo ./gspca_build

This generates the file

gspca.ko

which we use to replace the old gspca module.
Check to see if the old module is loaded, you should see something like:

dave@baracus:~$ lsmod | grep gspca
gspca                 680656  0
videodev               29440  1 gspca
usbcore               146028  9 gspca,snd_usb_audio,snd_usb_lib,usb_storage,usbhid,libusual,ehci_hcd,ohci_hcd

We want to find out where it is, so do the following:

sudo rmmod gspca
sudo modprobe -v gspca

You should see something like:

insmod /lib/modules/2.6.24-20-generic/ubuntu/media/gspcav1/gspca.ko

That is the location of the file we’re looking for, so, replacing where appropriate with what was output for you above, type:

sudo rmmod gspca
sudo rm /lib/modules/2.6.24-20-generic/ubuntu/media/gspcav1/gspca.ko
sudo mv gspca.ko /lib/modules/2.6.24-20-generic/ubuntu/media/gspcav1/
sudo modprobe gspca

This should have loaded the new module in place of the old one. See if you have a video device:

dave@baracus:~$ ls /dev/video*
/dev/video0

You can try and run Skype now, and in fact, if you’re not using the camera for Skype, this may well be enough. But for the Skype users: see if you get any picture by testing in the video devices option menu (be warned, it can take a little while to show up there after skype loads, and a little while for the picture to show when you press the test button, so be patient). If anything show’s up at all that’s a plus.

Originally, I had a black image, so I assumed the camera wasn’t working, but I soon realised that the image was there, just very dark - shining a light on it showed this was the case. I tried fiddling around with gstfakevideo for a while to try and alter the output, but there was a much simpler solution. The gspca driver itself can take options, and an autoexposure setting was ruining my lighting. To fix this, edit the file /etc/modprobe.d/options, and add a line at the bottom:

options gspca gamma=1 autoexpo=0

The gamma=1 may not be necessary, but if it still appears too dark or too light for your taste you can change this parameter as you like. Finally, reload the module:

sudo rmmod gspca
sudo modprobe gspca

and try out skype again. Hopefully it works!

I ran into quite a lot of other problems while I was trying this out, so if you come across any errors, drop a comment below and I’ll try and get back to you asap.

UPDATE: I found a large problem when using the camera in Skype was that CPU usage would shoot up to 100%, causing things to freeze up and conversations to crash after a while. I had played around with gstfakevideo a bit when trying to get the camera to work originally, and it seems using this when the camera already ‘works’ means it uses up far less CPU. I haven’t had a chance to test it for a long period yet but it seems like it should do the trick. Here’s what I did:

First, download gstfakevideo using subversion (you may need to install the subversion package, sudo apt-get subversion probably does the trick, and then the command below will make a directory called gstfakevideo in your current location, so make sure it’s somewhere nice), then compile and install it:

svn checkout http://gstfakevideo.googlecode.com/svn/trunk/ gstfakevideo
cd gstfakevideo
make
sudo make install

gstfakevideo creates a new video stream using your webcam, which is formatted differently and skype seems to get along with it more. The only problem is, it outputs its stream to /dev/video0 which is where our webcam currently lives. So we have to move the webcam, but this is easy enough:

sudo mv /dev/video0 /dev/video1

(Actually, gstfakevideo seems to work for me with lower CPU without moving this - but try it moved first anyway). Watch out though, every time you reboot, your webcam will probably go to /dev/video0 by default, assuming you have no other video devices, so you will have to move stuff about to make a space in video0 each time. Now we see if it works:

gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace

What this does is runs gstfakevideo, telling it that the source we’re using is a v4l source, and its from /dev/video1. The ffmpegcolorspace argument seems to be for making the stream YUV instead of RGB for some cameras so may not be necessary. It then launches skype, with hopefully the output below:

dave@baracus:~$ gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace
gst.c create_pipeline (155): pipeline created
gst.c create_pipeline (159): pipeline linked

If you look in the skype video options now there will be no camera listed. You have to wait a while (it can take 30s or so), until you get some output, ending with something like:

gst.c shim_ioctl (201): request=803c7601 nr 1
gst.c shim_ioctl (208): VIDIOCGCAP
gst.c shim_ioctl (313): result=0 error=0 Success

Now a camera should show up in the video menu in skype, with a name like GStreamer fake video (/dev/video0). Try it out, and compare your CPU performance to before. Also try exiting skype, and moving your video source from /dev/video1 back to video0, and running gstfakevideo again, only with device=/dev/video0, and see if it works (and let me know your findings below!).

Finally if gstfakevideo works, we can clean it up so the command isn’t so long to type. The script should be stored in:

/usr/local/bin/gstfakevideo

(Can check this using):

dave@baracus:~$ whereis gstfakevideo
gstfakevideo: /usr/local/bin/gstfakevideo

So we edit this file (requires root):

sudo gedit /usr/local/bin/gstfakevideo

Now, find the line that looks like this:

export GST_PIPE="videotestsrc is-live=true ! video/x-raw-yuv,width=640,height=480,framerate=10/1 ! videoscale ! ffmpegcolorspace ! vertigotv ! ffmpegcolorspace"

and change it to (remember where you put your webcam source - if you moved it back to /dev/video0, change the device parameter accordingly):

export GST_PIPE="v4lsrc device=/dev/video1 ! ffmpegcolorspace"

and finally look a bit further down, and delete the line:

export GST_PIPE="$*"

Now Skype will launch with your faked video stream, just from the command gstfakevideo. Good luck! Let me know how you get on.


42 Responses to “Logitech QuickCam E2500 on Ubuntu Skype”

  1. Hey,
    you are great man! :-)
    You saved me. I have spent 24 hours before with my Logitech QuickCam E2500. This tutorial worked for me:-)
    Thank You!

  2. Glad it worked! If you’re using skype, have a play with the gstfakevideo stuff too.

  3. Thank You! Works!

  4. Hey this is just great! It worked fine. But there is something that annoyes me: First when i run gstfakevideo with skype “gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace” my webcam worked perfect! it improved the brigthness automatically. after moving video0 to video1 it never worked again within skype. i moved it back but the brightness didnt improve automatically either.
    ps: it still works in cheese!!

    what can i do?

  5. Do you mean it worked the first time with the “device=/dev/video1″ part of the command, but your video was in video0? Also I find that if the autoexp=0 is set, if your room is very light it can really be far too bright in skype. Maybe try playing around with that setting?

  6. Hi,
    Thank you for this helpful site so far. I am somewhat of a beginner in this type of Terminal work. You lost me in the 5th paragraph.
    IOW the zipped tar files gspcav etc were downloaded to my Desktop.
    Do I stay in this directory when I extract the files or move the *.gz files to another directory? If so to which directory?
    (And to save me a lot of reading - how to move the files? )
    Thanks again.

  7. Me again. Re-reading my questions I realise I’ve left out key bits. I did extract both files. It was when I typed “cd gspcav1-20071224″ that things unravelled. I got an error ‘no such file or directory’. Therefore I assumed I had started out in the wrong (Desktop) directory! So (IOW) what now?
    FrankBe44

  8. Nice HowTo,

    Skype works with the webcam now, but this fakevideo stuff not yet, I got an error message when I used make to compile from the source, but I’ll try the next days to find the problem. Actually you saved my day ;-)

  9. u r the best!!! it worked. The only thing is, that it seems now a bit too bright. But i will try to adjust the gamma parameter.

    thanks a lot!

  10. ooops…I posted too early :( - When I wanna compile gstfakevideo I get this:

    ~/gstfakevideo$ make
    gcc -O2 -Wall -m32 `pkg-config gstreamer-0.10 –cflags` -ldl `pkg-config gstreamer-0.10 –libs` -shared -fpic gst.c gstfakevideo.c -o libgstfakevideo.so
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../libgstreamer-0.10.so when searching for -lgstreamer-0.10
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../libgstreamer-0.10.a when searching for -lgstreamer-0.10
    /usr/bin/ld: skipping incompatible /usr/bin/../lib/libgstreamer-0.10.so when searching for -lgstreamer-0.10
    /usr/bin/ld: skipping incompatible /usr/bin/../lib/libgstreamer-0.10.a when searching for -lgstreamer-0.10
    /usr/bin/ld: skipping incompatible /usr/lib/libgstreamer-0.10.so when searching for -lgstreamer-0.10
    /usr/bin/ld: skipping incompatible /usr/lib/libgstreamer-0.10.a when searching for -lgstreamer-0.10
    /usr/bin/ld: cannot find -lgstreamer-0.10
    collect2: ld gab 1 als Ende-Status zurück
    make: *** [libgstfakevideo.so] Fehler 1

    any ideas how to fix that?

  11. hmm, might be a problem with dependencies… try:

    sudo apt-get install libgstreamer0.10-dev pkg-config

    and see what happens.

  12. nope…that doesn’t help. It tells me, that libgstreamer0.10-dev and pkg-config already are the newest versions. Do I have to install any 32bit libaries on my 64bit machine?

  13. ah, it might be a conflict with gstfakevideo and the 64 bit version of the gstreamer package then. I’m afraid I don’t know how you’d go about fixing that! sorry :(

  14. Perfect, my webcam with Skype works perfectly, thank you!!!

  15. Worked like a charm! Thanks.

  16. I followed your method on fc9.
    After I modprobe -v gspca, I can see /dev/video and video0.
    However, when I rrun cheese, there is nothing come out.
    The green light on the camera is not on.

    Any suggestion?

  17. I gave up.
    I bought another Logitech Quickcam Communicate MP
    and it worked well with Fedora 9.
    Just plug in!

  18. Thank you very much! Your tutorial worked properly for my webcam. Where can I find something about tuning light etc.?

  19. Just try adjusting the gamma and autoexp parameters and see what happens.

  20. The patch you provided does work for the Logitech Quickcam E2500 but no other logitech webcam (with product id 0×046d) will work with the gspca driver. This is due to a bad placement of the case for the model id 089d.
    The following patch will let all other logitech webcams work as usual with the gspca driver :
    424a425
    > LogitechQuickCamE2500,
    622a624
    > {LogitechQuickCamE2500,”Logitech QuickCam E2500″},
    836a839
    > {USB_DEVICE(0×046d, 0×089d)}, /* Logitech QuickCam E2500 */
    3353a3357,3361
    > case 0×089d:
    > spca50x->desc = LogitechQuickCamE2500;
    > spca50x->bridge = BRIDGE_ZC3XX;
    > spca50x->sensor = SENSOR_MC501CB;
    > break;

    Thank’s for all the help on this page, which has been of great help.

  21. The last patch is maybe clearer as following, it comes from the debian sources :

    — gspca-01.00.20/gspca_core.c 2007-12-24 17:56:47.000000000 +0100
    +++ gspca-01.00.20-1s1/gspca_core.c 2008-09-16 11:27:26.000000000 +0200
    @@ -422,6 +422,7 @@
    Lenovo,
    LogitechQC4Notebooks,
    PhilipsSPC220NC,
    + LogitechQuickCamE2500,
    LastCamera
    };
    static struct cam_list clist[] = {
    @@ -620,6 +621,7 @@
    {Lenovo,”lenovo MI1310_SOC”},
    {LogitechQC4Notebooks,”Logitech QuickCam for Notebooks”},
    {PhilipsSPC220NC,”Philips SPC220NC PAC207″},
    + {LogitechQuickCamE2500,”Logitech QuickCam E2500″},
    {-1, NULL}
    };
    static __devinitdata struct usb_device_id device_table[] = {
    @@ -834,6 +836,7 @@
    {USB_DEVICE(0×046d, 0×08af)}, /* Logitech QuickCam Cool */
    {USB_DEVICE(0×093a, 0×2472)}, /* PAC207 Genius VideoCam ge110 */
    {USB_DEVICE(0×093a, 0×2463)}, /* Philips spc200nc pac207 */
    + {USB_DEVICE(0×046d, 0×089d)}, /* Logitech QuickCam E2500 */
    {USB_DEVICE(0×0000, 0×0000)}, /* MystFromOri Unknow Camera */
    {} /* Terminating entry */
    };
    @@ -3351,6 +3354,11 @@
    spca50x->bridge = BRIDGE_SPCA500;
    spca50x->sensor = SENSOR_INTERNAL;
    break;
    + case 0×089d:
    + spca50x->desc = LogitechQuickCamE2500;
    + spca50x->bridge = BRIDGE_ZC3XX;
    + spca50x->sensor = SENSOR_MC501CB;
    + break;
    case 0×08a0:
    spca50x->desc = QCim;
    spca50x->bridge = BRIDGE_ZC3XX;

  22. Thanks for writing this, it worked for the most part, I just ran into one problem:

    editing /etc/modprobe.d/options refuses to save, as it’s a root owned file. I tried running a python script to write options gspca gamma=1 autoexpo=0 to, but that failed as well.

    How did you do it?

  23. Hi,
    This fix looks wonderful…
    Do you think it will work for S5500 quick cam..

    I am strugling to make it run…

    Cheers,
    Deeps

  24. logicalyrandom: have you tried editing the file as root?

    sudo gedit /etc/modprobe.d/options

    You should be able to save it like that.

    Deeps: sorry, I’m not sure about the specifics for that camera. Try doing lsusb and see if the camera has the code 046d:089d - that is the one associated with the E2500, and it may mean that the process is compatible somehow.

  25. Hi Dave, this are info about the uvc camera
    System is using:
    Logitech QuickCam S5500
    Release 2008
    ASIC: SPCA522
    Vendor ID:V046d
    Product ID:P09a1
    P/N:8L - 860-106(from box)
    M/N:V-UCR45 (from box)
    PID: LZ821B8 (from box)
    P/N:9L - 960-000245 (from box)
    with uvc driver, I am getting this message
    [170.198614] usb 1-1: new high speed USB device using fsl-ehci and address 2
    [ 170.455745] usb 1-1: device v046d p09a1 is not supported
    [ 170.461521] usb 1-1: configuration #1 chosen from 1 choice [170.486674] USB Host suspended

    Thanks for your time…
    Rgds,
    Deeps

  26. [...] Quickcam E2500 I have installed what i found here actionshrimp.com

  27. [...] the gspca drivers. Ekiga would not recognize the camera. I then followed the directions here: actionshrimp.com

  28. Was having no luck with my Logitech E2500. Also in a double bind as it works fine under Windows XP but I just got newly connected to the net with a cable connection and Windows won’t recognise the connection - nada - just keeps telling me it’s waiting for … something.
    However, Ubuntu and SuSE linux both recognised and dealt with the connection without me having to do anything at all - it just worked out of the box. So I really am not bothered about using Windows at all - but it does mean some gadgets need a lot more work - however your instructions worked perfectly. Haven’t tried the gstfakevideo thing yet, but the fact that I can get it to work in Camorama is a big step forward. Thanks a lot!

  29. Works like a charm! For me the gstfakevideo script also worked with /dev/video0, on Ubuntu 8.10 . Thanks a lot! The tutorial not only gave a great solution, but it saved me a lot of time for trying to make the cam work…

  30. This does not work on Ubuntu Intrepid 8.10. Other’s have had the same problem but no one seems to be able to find the solution. Here’s the output I get:

    REMOVE the old module if present
    ERROR: Module gspca does not exist in /proc/modules

    CLEAN gspca source tree
    rm -r -f *.o decoder/.gspcadecoder.o.cmd decoder/*.o \
    .gspca.o.cmd *.o *.ko *.mod.* .[a-z]* core *.i \
    *.symvers *.err

    COMPILE gspca Please Wait ….!!

    INSTALL gspca in the kernel binary tree
    mkdir -p /lib/modules/`uname -r`/kernel/drivers/usb/media/
    rm -f /lib/modules/`uname -r`/kernel/drivers/usb/media/spca5xx.ko
    rm -f /lib/modules/`uname -r`/kernel/drivers/media/video/gspca.ko
    install -c -m 0644 gspca.ko /lib/modules/`uname -r`/kernel/drivers/usb/media/
    install: cannot stat `gspca.ko’: No such file or directory
    make: *** [install] Error 1

    LOAD gspca in memory
    FATAL: Module gspca not found.

    PRINT COMPILATION MESSAGES if ERRORS look kgspca.err
    make -C /lib/modules/`uname -r`/build SUBDIRS=/home/***/Downloads/gspcav1-20071224 CC=cc modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-generic’
    CC [M] /home/***/Downloads/gspcav1-20071224/gspca_core.o
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:54:27: error: asm/semaphore.h: No such file or directory
    /home/***/Downloads/gspcav1-20071224/gspca_core.c: In function ‘spca5xx_ioctl’:
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:2466: error: implicit declaration of function ‘video_usercopy’
    /home/***/Downloads/gspcav1-20071224/gspca_core.c: At top level:
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:2612: error: unknown field ‘owner’ specified in initializer
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:2612: warning: initialization from incompatible pointer type
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:2614: error: unknown field ‘type’ specified in initializer
    /home/***/Downloads/gspcav1-20071224/gspca_core.c: In function ‘spca50x_create_sysfs’:
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:2772: error: implicit declaration of function ‘video_device_create_file’
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:2783: error: implicit declaration of function ‘video_device_remove_file’
    /home/***/Downloads/gspcav1-20071224/gspca_core.c: In function ‘spca5xx_probe’:
    /home/***/Downloads/gspcav1-20071224/gspca_core.c:4314: error: incompatible types in assignment
    make[2]: *** [/home/***/Downloads/gspcav1-20071224/gspca_core.o] Error 1
    make[1]: *** [_module_/home/***/Downloads/gspcav1-20071224] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-generic’
    make: *** [default] Error 2

  31. I am having the same problem as Permafrost91. I immediately noticed that the gspca module was not loaded in the new 2.6.27-7 kernel, even though most forums seem to indicate that it is included. I tried manually compiling from the original gspca source, but i get the same errors listed above.

    p.s. pulseaudio is giving me hell in ibex as well. upgrading has so far proven to be the wrong choice

  32. I have the same maddening issue.

    Hopefully its a trivial fix :-)

  33. Yeah I’m having the same issue guys, seems to be a kernel problem from what I’ve read and not a lot we can do. Hopefully the camera should just work on its own soon… I grow tired of fiddling around with it.

  34. i grow tired of it too - this is my only fiddly thing on my laptop.

  35. great! your detailed instructions have helped me so much, as you’ve saved me *many* hours and spared me the hassle of returning yet another webcam.)

    i’m using quickcam connect (not e2500), along w/ the patch that was given on forums.quickcamteam.net everything works exactly as you described: the video was really dark at first, so i added the line to the /etc/modprobe.d/options file. with this, it seems over-exposed and bright. also, if i simply use camorama, the colors are ugly and are yellow/blueish. any ideas? please email me. thanks!!

  36. Sorry but….

    ~$ gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace
    gst.c create_pipeline (155): pipeline created
    gst.c create_pipeline (159): pipeline linked
    gst.c shim_ioctl (201): request=80685600 nr 0
    gst.c shim_ioctl (313): result=-1 error=515 Errore sconosciuto 515

    gst.c shim_ioctl (201): request=803c7601 nr 1
    gst.c shim_ioctl (208): VIDIOCGCAP
    gst.c shim_ioctl (313): result=0 error=0 Riuscito

    gst.c bus_callback (105): Error: Impossibile aprire il device «/dev/video1» in lettura e scrittura.

  37. Im running Ubuntu 8.10 now, and I have about the same errors as Permafrost91.

    INSTALL gspca in the kernel binary tree
    mkdir -p /lib/modules/`uname -r`/kernel/drivers/usb/media/
    rm -f /lib/modules/`uname -r`/kernel/drivers/usb/media/spca5xx.ko
    rm -f /lib/modules/`uname -r`/kernel/drivers/media/video/gspca.ko
    install -c -m 0644 gspca.ko /lib/modules/`uname -r`/kernel/drivers/usb/media/
    install: cannot stat “gspca.ko”: No such file or directory finns inte
    make: *** [install] Error 1

    LOAD gspca in memory
    FATAL: Module gspca not found.

    Any clues?

  38. Kubuntu 8.10 upgraded from Hardy. So i have 4 versions of kernel. the only one was working 4 me on hardy and interpid, was 2.6.24-19-generic with my webcam (trust 1400 T something. ) but S…omething happened to my cam :) and i got mikomi 300k (didnt work on interpid any way i tried. I read before about quite good support 4 logitech web cams so i have my Logitech QuickCam E 2500 around 3 hours, and guess what? Interpid dont seems to like her :) so i ended up with 2 webCams (mikomi and Logitech) its middle of the night, and in ireland cant even buy any drink:) (sorry 4 english) I can doo allmost everything i want (if i know how :) ) on kubuntu, russians send a dog into space years ago, and logitech can’t develop a webCam driver? Its in the price of Webcam, for windows, but i paid for it:( where is mine? I know im a bit cranky, but 3rd time same story? i allready sacraficed standard desktop effects because openGl and movies problem.

  39. i could’t get a drink, so i bought same webCam as i had 1st time Trust WB 1400T and it works wiet my old kernel from hardy (2.6.24-19-generic) and gspcav1-20071224. So i have 3 webcams and 1 working… ech, i wont install windows again anyway :)

  40. Got it working! Use the patch you can download in this forum:
    http://ubuntuforums.org/showthread.php?t=966932&highlight=e2500

    so instead of running wget http://forums.quickcamteam.net/attachment.php?aid=86 -O patch.tar.gz,

    do a

    gunzip gspca.patch.gz

    which will create gspca.patch

    cd into your gspca directory

    cd gspcav1-20071224

    and patch

    patch < ../gspca.patch

    gspca should compile now and correctly install when you run

    sudo ./gspca_build

    make sure to remove gspca_main module

  41. thanks sweeper! I even managed to get this to work using the source in the ubuntu gspca-source package on the repos, by patching the code there. Only problem is, it seems like the webcam’s not working at first because of strange permission issues, not quite sure what the problem is. A lot of apps wont work with the webcam giving a permission denied /dev/video0 error, but if you run the apps as root, it works fine. But hey - at least I have video in skype again now using sudo gstfakevideo.

    :)

  42. SWEEPER - You are awesome- Thanks.

Leave a Reply

Other posts:
« jsvi and TiddlyWiki |