First, download the drivers and the patch:
Code:
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:
(UPDATE: For Ubuntu 8.10 users, this patch may no longer work. Try downloading the patch here instead, and then extract it using gzip -d gspcapatch.gz. Apply the extracted file in the same was as below, just neglect the -p1 switch, (so do: patch < gspcapatch), you can just ignore the tar -xvf patch.tar.gz command).
Code:
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):
This generates the file
which we use to replace the old gspca module.
Check to see if the old module is loaded, you should see something like:
Code:
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:
Code:
sudo rmmod gspca
sudo modprobe -v gspca
You should see something like:
Code:
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:
Code:
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:
Code:
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. (UPDATE: If you’re using Ubuntu 8.10, and have used the alternative patch I posted in the other “UPDATE:” bracket above, the webcam may still not work in Skype at this point. There seems to be some issue with permissions in this version of the driver, so you may need to run skype as root if it doesn’t appear to be working. In a terminal type “sudo skype” and hit enter. It’ll ask for your root password, then launch skype. See if the webcam works now).
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:
Code:
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:
Code:
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:
[/code]svn checkout
http://gstfakevideo.googlecode.com/svn/trunk/ gstfakevideo
cd gstfakevideo
make
sudo make install[/code]
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:
Code:
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:
Code:
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:
Code:
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:
Code:
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:
Code:
/usr/local/bin/gstfakevideo
(Can check this using):
Code:
dave@baracus:~$ whereis gstfakevideo
gstfakevideo: /usr/local/bin/gstfakevideo
So we edit this file (requires root):
Code:
sudo gedit /usr/local/bin/gstfakevideo
Now, find the line that looks like this:
Code:
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):
Code:
export GST_PIPE="v4lsrc device=/dev/video1 ! ffmpegcolorspace"
and finally look a bit further down, and delete the line:
Code:
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.
Bookmarks