Tip: Getting Your Webcam To Work In Ubuntu
----
I have an old noname cheapo webcam, that I dusted out of my junk (why? More on that in a post coming soon). I hoped that it would work in my Ubuntu setup out of the box like most of my other hardware. I connected it to my laptop's usb port. dmesg gave the following output:
[21328.211333] usb 1-1: new full speed USB device using ohci_hcd and address 2
[21328.319698] usb 1-1: configuration #1 chosen from 1 choice
[21328.439705] Linux video capture interface: v2.00
[21328.458509] zc0301: V4L2 driver for ZC0301[P] Image Processor and Control Chip v1:1.05
[21328.459113] usb 1-1: ZC0301[P] Image Processor and Control Chip detected (vid/pid 0x0AC8/0x301B)
[21328.520576] usb 1-1: PB-0330 image sensor detected
[21328.870287] usb 1-1: Initialization succeeded
[21328.870919] usb 1-1: V4L2 device registered as /dev/video0
[21328.871001] usbcore: registered new interface driver zc0301
[21328.913737] usbcore: registered new interface driver gspca
[21328.913811] ubuntu/media/gspcav1/gspca_core.c: gspca driver 01.00.12 registered
Great! Everything set up, I thought. But running various programs, camorama, camE, kopete, everything gave weird errors like "Connection could not be made", "device not ready" or just showed a blank screen. But soon, after few trial and errors, I found the solution. Basically the "zc0301" module is the culprit and all you have to do to get your camera working is prevent it from loading. So, this is what I did:
-
sudo modprobe -r gspca
-
-
sudo modprobe -r zc0301
-
-
sudo modprobe gspca
And voila! the webcam started working like magic. Of course, this tip is only for webcams that use this particular chip. And if you want to make this change permanent so that you don't have to run these commands everytime you want to use your webcam, all you have to do is add the following line to your /etc/modprobe.d/blacklist file
blacklist zc0301
This would prevent the module from loading whenever you connect your webcam to your computer. Let me know if this worked for you or if you have some of your own tips/tricks/hacks to get this or other webcams working on linux.
© Shantanu Goel | Tip: Getting Your Webcam To Work In Ubuntu----
If you liked this post, then you can get free updates










This post has 11 comments
September 7th, 2008
Thank you for your post. I have solved my similar problem with the webcam Colovis. Just put the line:
blacklist sn9c102
into the file: /etc/modprobe.d/blacklist.
Then all thing work well.
November 6th, 2008
Thanks for the tip, although I do not need it. I recently bought a cheapo webcam while in Japan and, surprisingly, it worked with Ubuntu out of the box, yet it would not work with Windows XP. Strange, another reason Ubuntu is my OS of choice.
November 6th, 2008
Did you tried the application "cheese"?
cheese only loaded my inbuilt camera in HP laptop.
November 6th, 2008
I cannot get my cheapo Dynex usb webcam working on my Debian Lenny system; I have tried the suggestions to unload sn9c102 and zc0301 and reloading gspca but it still isn't going for me (no /dev/video device created). Frustrating.
[ 1253.807894] usb 4-1.3: new full speed USB device using ehci_hcd and address 4
[ 1253.903205] usb 4-1.3: configuration #1 chosen from 1 choice
[ 1253.904702] usb 4-1.3: New USB device found, idVendor=05a9, idProduct=8519
[ 1253.904717] usb 4-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1253.904724] usb 4-1.3: Product: USB Camera
[ 1253.904730] usb 4-1.3: Manufacturer: OmniVision Technologies, Inc.
[ 1254.167300] usbcore: registered new interface driver snd-usb-audio
[ 1264.245001] usbcore: deregistering interface driver gspca
[ 1264.245001] gspca: driver gspca deregistered
[ 1275.943147] Linux video capture interface: v2.00
[ 1275.951155] usbcore: registered new interface driver gspca
[ 1275.951155] gspca: gspca driver 01.00.20 registered
[ 1278.284987] usb 4-1.3: USB disconnect, address 4
[ 1279.263773] usb 4-1.3: new full speed USB device using ehci_hcd and address 5
[ 1279.357812] usb 4-1.3: configuration #1 chosen from 1 choice
[ 1279.357812] usb 4-1.3: New USB device found, idVendor=05a9, idProduct=8519
[ 1279.357812] usb 4-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1279.357812] usb 4-1.3: Product: USB Camera
[ 1279.357812] usb 4-1.3: Manufacturer: OmniVision Technologies, Inc.
November 6th, 2008
@lefty.crupps: It looks like your camera is made manufactured by OmniVision. Can you try to see ov511 driver and see if it works? (modprobe ov511)
November 6th, 2008
Thanks for the followup, Shantanu Goel.
I was told to use the gspca driver but it seems this one ov511 also doesn't work to create my /dev/video device; should I be looking elsewhere?
[ 9893.174156] usbcore: deregistering interface driver gspca
[ 9893.174156] gspca: driver gspca deregistered
[ 9900.031712] usbcore: deregistering interface driver ov511
[ 9900.031757] ov511: driver deregistered
[ 9902.526253] usb 4-1.3: USB disconnect, address 6
[ 9913.914054] Linux video capture interface: v2.00
[ 9913.922193] usbcore: registered new interface driver ov511
[ 9913.922193] ov511: v1.64 for Linux 2.5 : ov511 USB Camera Driver
[ 9916.342359] usb 4-1.3: new full speed USB device using ehci_hcd and address 7
[ 9916.439563] usb 4-1.3: configuration #1 chosen from 1 choice
[ 9916.442071] usb 4-1.3: New USB device found, idVendor=05a9, idProduct=8519
[ 9916.442105] usb 4-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 9916.442113] usb 4-1.3: Product: USB Camera
[ 9916.442119] usb 4-1.3: Manufacturer: OmniVision Technologies, Inc.
debian:~$ ls /dev/v*
/dev/vboxdrv /dev/vcs /dev/vcs1 /dev/vcs2 /dev/vcs3 /dev/vcs4 /dev/vcs5 /dev/vcs6 /dev/vcs7 /dev/vcsa /dev/vcsa1 /dev/vcsa2 /dev/vcsa3 /dev/vcsa4 /dev/vcsa5 /dev/vcsa6 /dev/vcsa7
November 11th, 2008
still no go it seems, thanks.
November 15th, 2008
how about for Acre4315? how can I make it work? I installed jasper but there was no image displaying only a black screen
November 21st, 2008
Thanks this works for the Microdia Clas Ohlson TWC-30XOP WebCam too
but you run
sudo modprobe -r sn9c102
then
blacklist sn9c102
November 21st, 2008
Actually this may work for many other devices as well.
This is because multiple drivers are loaded for the same function. Do this on the command prompt:
$ lsmod | grep video
look for
videodev 29440 2 gspca,sn9c102
here we see two modules loaded, gspca usually works.
Remove a module then start your viewer app, no joy? remove the other and reload the 1st removed.
Hope this helps.
November 28th, 2008
I have three questions:
Can you do this with a network camera using Mpeg4 or Mjpeg?
Do you know of a way to do the same thing with Windows XP?
How can you have the detected motion of the webcam, grab the image that changed +/- a few frames and automatically send an email to a predetermined email address with attached image.
The result would be when your camera detects motion, it would send you an image to your email or even use twitter. That way, you know if it is important or not.
Trackbacks
Add a comment