Webcam in Ubuntu

i dont know why all this while im not using webcam in linux until last week i try to plug the webcam in my ubuntu. It appear great result because the webcam driver detected by need to do something more to make its working better … now lets start by checking the device detected ..

fenris@thinkbuntu:~$ lsusb
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 001 Device 004: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 001 Device 003: ID 0a5c:2110 Broadcom Corp.
Bus 001 Device 001: ID 0000:0000
Bus 003 Device 002: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 WebCam
Bus 003 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 004 Device 002: ID 17ef:1003
Bus 004 Device 001: ID 0000:0000

With this information we can know the Vendor_id=0ac8 and the Product_id=301b . We could also see this using the graphical user interfase usbview. Another thing that we can see is the manufacturer of the chipset Z-Star/Vimicro (that is also used in many other cheap webcams) Among the output of the usbview program, we can see somthing like this Manufacturer: Vimicro Corp.

I’m going to summarize the steps I took:

1) Download and untar the file gspcav120071224.tar.gz:
wget -c http://mxhaard.free.fr/spca50x/Download/gspcav1-20071224.tar.gz

tar xvfz gspcav1­20071224.tar.gz

2) Compile and install the driver:

cd gspcav1-20071224

make clean
make

sudo make install

3) This is the extra step that I had to do:

sudo gedit /etc/modprobe.d/options

and add an option for this driver:

options gspca force_rgb=1

sudo apt-get install camorama

then try to open camorama, if cant open the application,try this:

$sudo lsmod |grep gspca
gspca 660176 0
videodev 28160 2 gspca,zc0301
usbcore 134280 7 gspca,zc0301,usb_storage,libusual,ehci_hcd,uhci_hcd

Remove the zc0301 module:

$sudo modprobe -r zc0301

Insert module gspca back:

$ sudo modprobe gspca

Give a check first:

$ lsmod |grep gspca
gspca 660176 0
videodev 28160 1 gspca
usbcore 134280 6 gspca,usb_storage,libusual,ehci_hcd,uhci_hcd

Let it be more confident:

$ lsmod | grep videodev
videodev 28160 1 gspca
v4l1_compat 15236 1 videodev
v4l2_common 25216 1 videodev

If it still can’t run the camorama :

check the device permission:

$ ls -l /dev/video0
crw-rw—- 1 root video 81, 0 2008-01-27 08:10 /dev/video0

Device video0 running with user group video,so u should change the permission:

$ sudo chmod 777 /dev/video0
$ ls -l /dev/video0
crwxrwxrwx 1 root video 81, 0 2008-01-27 08:10 /dev/video0

@ the easier way is installing the gspca from repo (i forgot to check in repo, gspca is in it):

fenris@thinkbuntu:~$ sudo apt-get install gspca-sourceHope it working for u all because its working for me!!
Gud Luck!!

Camorama in Action!!Camorama in Action - Close up!!


62 Responses to “Webcam in Ubuntu”

  • KageSenshi Says:

    its not a one step apt-get ?

    i know its just “yum install gspca“ in fedora :P

    anybody reading this comment, try finding it first from ubuntu repo, i believe its somewhere there .. installing from source on places other than $HOME and /usr/local is bad :P

  • khairul Says:

    hmm thanks for da comment .. yeah .. forget to check in repo .. its in there :

    fenris@thinkbuntu:~$ sudo apt-cache search gspca
    Password or swipe finger:
    gspca-source – source for the gspca v4l kernel module

  • mrnoob Says:

    teach me tuanguru,
    im noob

  • Dave Shuck Says:

    I have a zc0301 (Tripp-Lite is the brand) and I have followed the steps in this post. Everything seems to match up with your results until I get to the part where I do _ls – l /dev/video0_ and I get “No such file or directory”. Additionally, when I try to run camorama I get an error “Could not connect to video device (/dev/video0)”.

    Do you have any thoughts on this? FWIW, I am running Ubuntu Hardy.

  • fenris Says:

    try checking your usb connection then try

    ls -l /dev/vid*

    let see if there is listed ya device ..

    error u got from camorama is because the webcam are not connected/detected … u already do the modprobe & lsmod step rite?

  • piju Says:

    pinjam webcam ko.
    aku nak recording

  • baucha Says:

    i have 0ac8:307b Z-star Microelectronics and it seems the new 22071224 driver sud support it. I hav done a lil research wit google n found out that there is suppor for it withe sensor OV7620.h however, when i connect it my webcam is recognized by the system but the problem is when i try to run any webcam apps (like camorama, skype, kopete, cheese), the app just freezes and i get following in my dmesg

    [29066.356000] /home/baucha/Documents/gspcav1-20071224/gspca_core.c: [gspca_set_isoc_ep:945] ISO EndPoint found 0×81 AlternateSet 7

    Any idea what might be causing my webcam from working?
    one more thing, I found exactly similar posting for x307b here http://quilombo.wordpress.com/2008/02/02/zaapa-webcam-en-ubuntu-linux-710-gutsy-gibbon-2/

    I followed all the steps but same thing happening. Pls help!

  • mypapit Says:

    nice howto, prolly the best ubuntu of all around in your blog

  • phyz Says:

    wow….cayalah bro!

  • Web Camera и ЛинукÑ? « Блогът на [Deathmaster] Says:

    [...] които ми помогнаха да Ñ?е Ñ?правÑ? Ñ? проблема Ñ?и. Това е адреÑ?ÑŠÑ‚, който ми помогна най – [...]

  • Erik Says:

    Wow. this works very well!

  • problem compiling driver Says:

    when i do make clean i got that message:
    user@user-desktop:~/Descargas Temporales/gspcav1-20071224$ make clean
    rm -r -f *.o decoder/.gspcadecoder.o.cmd decoder/*.o \
    .gspca.o.cmd *.o *.ko *.mod.* .[a-z]* core *.i \
    *.symvers *.err

  • Kevin Yu Says:

    Thanks for your fatanstic documentation

  • Tim Says:

    Hello,

    I have the same webcam, and got it working in a much easier way under Ubuntu (8.04). It is true that you need the gspca drivers, but those are already in Ubuntu, it’s just that the zc0301 driver gets loaded instead of it (probably because it is more specific or something). So all you have to do is blacklist the zc0301 driver:

    $ sudo gedit /etc/modprobe.d/blacklist

    Add these lines at the bottom:

    # Use gspca for Z-Star webcam
    blacklist zc0301

    Pull out your webcam, plug it back in, and start camorama. If your colours are fucked up you can try adding a “color correction” filter in Camorama (Skype does this automatically). If that doesn’t help, try adding “options gspca force_rgb=1″ to /etc/modprobe.d/options.

    Cheers,
    Tim

  • fenris Says:

    Thanks Tim for da info .. actually i use it since gutsy … anyway .. thanks for remind me about the blacklist .. i shall add in my blacklist ..

  • agung suyono Says:

    hi i use zc0301 webcam try to install with the driver, cant work only dolphin apeear what sholud i choose from dolphin

  • agung suyono Says:

    hi i use zc0301 webcam try to install with the driver, cant work only dolphin apeear what sholud i choose from dolphin run with…..?

  • agung suyono Says:

    when i insert driver ..appear on desktop and said install when i klik it ..appear hdc.dolphin and appear..inf..98. me , xp n 2000 and .auto run and then set up exe….when i klik auto run.inf appear ..a box…said..open.set up exe..icon set up exe…what should i klik or type next..

  • agung suyono Says:

    Hi Tim,

    Tell me in details how to install and run webcam zc0301 in kubuntu like you exlian on 19 May above please

  • agung suyono Says:

    Hi Tim,

    Tell me in details how to install and run webcam zc0301 in kubuntu like you expiain on 19 May above please

  • battery Says:

    […] Last week I made the Aphextwinalizer, a Flash gimmick that uses your webcam to show your photo on the cover of your favorite record. I made it as an experiment. It didn’t take long and I wanted to experiment with Flash, webcams and screenshots. […]

  • Zach Says:

    I use a ZC0302 webcam and I have had NO luck getting it to work Under Ubuntu Studio. I had to downgrade from Hardy Heron due to non stop system crashes. If you could help me get my Z-Star Microelectronics Corp. ZC0302 WebCam webcam working, I’d greatly appreciate it. I’ve run out of options.

  • Roberto C. Says:

    Ubuntu hardy 8.04 up to date a s jul 5, 208
    Maxxtro webcam – 0c45:6019 Microdia – Sonix
    Module loaded is sn9c102 instead zc0301.
    Just using gspca from current kernel modules and disabling snc9c102 works for me (camorama, cheese, ekiga, stopmotion )

    In /etc/modprobe.d/options add:
    # 0c45:6019 Microdia
    options gspca force_rgb=1

    In /etc/modprobe.d/blacklist add:
    # 0c45:6019 Microdia
    blacklist sn9c102

  • LiangXu Wang » Blog Archive » 使用z-staræ‘„åƒ?头 Says:

    [...] �考: http://blog.myfenris.net/?p=377 注�其中的comment: $ sudo gedit [...]

  • thanhquanky Says:

    i don’t know when i use
    ls -l /dev/video0

    it’s said that ls: cannot access /dev/video0: No such file or directory

  • Kumar Says:

    Thnx a ton..
    I was having a hard time getting my ZC0303 based webcam working with skype. It will register itself as ZC0301, will work with Ekiga but won’t work with Skype or Cheese. I just removed the zc0301 module. Now it registers as generic Vimicron webcam and works flawlessly..

  • Javier Says:

    I’m having trouble making my camera work on Ubuntu 8.04. I think I have installed the camera successfully. But camorama won’t even open. And VLC won’t detect it. What can I be doing wrong?. Here is the relevant information:

    administrador@administrador-desktop:~$ lsusb
    Bus 004 Device 001: ID 0000:0000
    Bus 003 Device 001: ID 0000:0000
    Bus 002 Device 001: ID 0000:0000
    Bus 001 Device 003: ID 0ac8:307b Z-Star Microelectronics Corp.
    Bus 001 Device 001: ID 0000:0000
    administrador@administrador-desktop:~$

    And:

    administrador@administrador-desktop:~$ ls /dev/video*
    /dev/video0

    And:

    administrador@administrador-desktop:~$ lsmod | grep videodev
    videodev 29440 8 gspca
    v4l2_common 18304 1 videodev
    v4l1_compat 15492 1 videodev

    and:

    administrador@administrador-desktop:~$ ls -l /dev/video0
    crw-rw—-+ 1 root video 81, 0 2008-09-11 21:08 /dev/video0

    Any advice will be much appreciated.

    Javier

  • Amaresh@ Says:

    ls -l /dev/vid*

    ls -l /dev/vid*
    ls: cannot access /dev/vid*: No such file or directory

    guide me

  • naopak.lik Says:

    I used this tutorial in ubuntu 8.04 and it worked and now I have problem in ubuntu 8.10.

    i get error on make command

    make
    make -C /lib/modules/`uname -r`/build SUBDIRS=/home/naopaklik/gspcav1-20071224 CC=cc modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-generic’
    CC [M] /home/naopaklik/gspcav1-20071224/gspca_core.o
    /home/naopaklik/gspcav1-20071224/gspca_core.c:54:27: error: asm/semaphore.h: No such file or directory
    /home/naopaklik/gspcav1-20071224/gspca_core.c: In function ‘spca5xx_ioctl’:
    /home/naopaklik/gspcav1-20071224/gspca_core.c:2463: error: implicit declaration of function ‘video_usercopy’
    /home/naopaklik/gspcav1-20071224/gspca_core.c: At top level:
    /home/naopaklik/gspcav1-20071224/gspca_core.c:2604: error: ‘v4l_compat_ioctl32’ undeclared here (not in a function)
    /home/naopaklik/gspcav1-20071224/gspca_core.c:2609: error: unknown field ‘owner’ specified in initializer
    /home/naopaklik/gspcav1-20071224/gspca_core.c:2609: warning: initialization from incompatible pointer type
    /home/naopaklik/gspcav1-20071224/gspca_core.c:2611: error: unknown field ‘type’ specified in initializer
    /home/naopaklik/gspcav1-20071224/gspca_core.c: In function ‘spca50x_create_sysfs’:
    /home/naopaklik/gspcav1-20071224/gspca_core.c:2769: error: implicit declaration of function ‘video_device_create_file’
    /home/naopaklik/gspcav1-20071224/gspca_core.c:2780: error: implicit declaration of function ‘video_device_remove_file’
    /home/naopaklik/gspcav1-20071224/gspca_core.c: In function ‘spca5xx_probe’:
    /home/naopaklik/gspcav1-20071224/gspca_core.c:4301: error: incompatible types in assignment
    make[2]: *** [/home/naopaklik/gspcav1-20071224/gspca_core.o] Error 1
    make[1]: *** [_module_/home/naopaklik/gspcav1-20071224] Error 2
    make[1]: Leaving directory `/usr/src/linux-heade

    thanks for help

  • fenris Says:

    naopak,

    have u try installing this:

    $ apt-cache search gspca
    gspca-source – source for the gspca v4l kernel module

    $ apt-get install gspca-source

    thanks for remind me .. i forget to test my webcam after im upgrading to intrepid. will post the result here after tested in intrepid

  • zaf Says:

    Hey I have the exact same problem as naopak. It was working well in hardy and since I upgraded it’s been acting funky. First I couldn’t get it to work in kopete and now I have absolutely nothing.
    Any news on that ?

  • asdf Says:

    tried to get this to work, failed miserably with ubuntu 8.10….

  • Brian Anotado Says:

    That works!
    I’m having problem with my webcam for almost two weeks and I can’t get it work. Thanks a lot..

    Cheers!

  • Ashwin kumar Says:

    hi

    am having problems with my webcam!!

    i installed the webcam driver as suggested above but am getting blurred image

    cameroma opens but the image it shows is very poor. cant even make out my face or anything…its plain blurred showing just color variations if i move my hand or something…

    am using ubuntu hardy and my ID 0ac8:307b Z-Star Microelectronics Corp

  • fenris Says:

    check your webcam lens focus

  • Reefat Says:

    At the bottom of your post there are two pictures of your desktop. I loved the theme of Ubuntu you used. Which version of Ubuntu is that (is it Kubuntu Or Hardy Heron 8.04)? Could you please give me the link to download the theme?

    [Note: This blog doesn't have the notification option. So, would you mind to answer me to my email address?]

    Thank you.

  • Recent Links Tagged With "interfase" - JabberTags Says:

    [...] Saved by melw on Sun 08-3-2009 Nuevo interfase en SL Saved by eilemach on Sat 28-2-2009 Webcam in Ubuntu Saved by nonenuna on Thu 26-2-2009 We’re ALIVE Saved by simiant on Fri 23-1-2009 Totlol, [...]

  • nitrofurano Says:

    trying on Ubuntu Jaunty – only getting error messages, and no devices

  • nitrofurano Says:

    Tried again – do someone really have webcam running on Jaunty or Karmic? is it possible having webcam working on any GNU/Linux or Ubuntu?

  • mare Says:

    I use cheese
    less frustrating if you just want to take picture

    sudo apt-get install cheese

  • lsmod - StartTags.com Says:

    [...] nicely formats the contents of the /proc/modules, showing what kernel modules are currently …Webcam in Ubuntu | .:: mY Life JoUrNeY ::.i dont know why all this while im not using webcam in linux until last week i try to plug the webcam [...]

  • tatil otelleri Says:

    teach me tuanguru,
    im noob

  • http://www.buyuyapmak.com Says:

    nicely formats the contents of the /proc/modules, showing what kernel modules are currently …Webcam in Ubuntu | .:: mY Life JoUrNeY ::.i dont know why all this while im not using webcam in linux until last week i try to plug the webcam

  • antalya otelleri Says:

    I read your article with great pleasure. This wonderful article thank you for sharing with us

  • evden eve nakliyat Says:

    Cool Post .. very nica all .. tnx

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes