Get Your Webcam Working with GSPCA

 in

Webcams are notorious for their lack of support under Linux. But thanks to GSPCA, many webcams now have functional V4L drivers. This tutorial covers the building, installation, and configuration of the GSPCA drivers, including how to adjust color balance and brightness directly at the kernel module level.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

GSPCA

Anonymous's picture

when i try wget http://www.bairesnortelug.com.ar/diff/gspca.diff
im getting this:

donivan@donivan-laptop:/usr/src/modules/gspcav1-20071224$ wget http://www.bairesnortelug.com.ar/diff/gspca.diff
--2010-02-26 01:43:21-- http://www.bairesnortelug.com.ar/diff/gspca.diff
Resolving www.bairesnortelug.com.ar... failed: Name or service not known.
wget: unable to resolve host address `www.bairesnortelug.com.ar'

any ideas on this issue

thanks

Try Again

Mitch Frazier's picture

It works here, so try again. If it still fails then you've got some kind of DNS problem.

Mitch Frazier is an Associate Editor for Linux Journal.

GSPCA

Anonymous's picture

It works but is there any patch like gspca for kernel version 2.6.31?

thanks

Patch

Mitch Frazier's picture

This post is going on two years old and it looks like there have been significant changes to this driver. If you've got kernel version 2.6.31 then my first thought is that you're dealing with a different sort of a problem and you don't need to patch the kernel. What distro are you using and what type of camera do you have?

Mitch Frazier is an Associate Editor for Linux Journal.

GSPCA

Anonymous's picture

im using ubunto 9.10 and im using also gentoo , my camera is a logitech quickcam chat

thanks

More Info

Mitch Frazier's picture

From what I find on the gspca driver site and in other locations that webcam should be working. What application are you using and what symptoms are you seeing (or not seeing)?

Mitch Frazier is an Associate Editor for Linux Journal.

GSPCA

Anonymous's picture

well first of all i`m not seeing /dev/video0 i have my webcam plugged... if i go to /dev i dont have the folder video0...
if you type this on the konsole
ls -la /dev/video0
ls: cannot access /dev/video0: No such file or directory
ls /dev/vid*
ls: cannot access /dev/vid*: No such file or directory

i have try to install the camera driver but it says that gspca doesn't exist on /proc/modules,i`ve tried to copy the driver to /usr/src/modules, but there already a file name modules but it seems to be a .tar file and it doesnt let copy anything to it or extract the info, so i don't really know what to do there , when i enter lsmod im not getting anything at all , lsusb does detect the camera,i already add the gspca_spca561 to the /etc/modules, and im still not getting anything, am i doing anything wrong so far?

thanks

Drivers

Mitch Frazier's picture

Since lsusb sees the camera but lsmod isn't showing any driver then you probably don't have the driver installed, which is probably the conclusion that you've alread come to.

But, as I mentioned this seems like it ought to work without kernel/driver patching. You've got a fairly new distro so the driver should be there. Undo your changes to /etc/modules and start your package manager and search for "gspca" and/or "webcam" and see if there are any standard packages that could help (I can't tell you which ones since I don't use ubuntu or gentoo).

Mitch Frazier is an Associate Editor for Linux Journal.

Does this work with Opensuse?

Anonymous's picture

Does this work with Opensuse and quickcam communicate stx?

It doesn't work!!

Juan p's picture

i got ubuntu 8.10 and it does work... the pc recognices it in skype when i test it but only shows green stripes...no real image...

Comment.ec:2910: error: too many arguments to function

mwango's picture

Hello,

We Installed RHEL 5 for this Informix products

Informix SE version 7.26 UC6R1
Informix 4gl Developer Version 7.32 UC4
Informix 4gl Runtime Version 7.32 UC4
Informix 4gl Compiler RT Version 7.32 UC3
Informix Sql Development Version 7.32 UC4
Informix Sql Runtime Version 7.32 UC4

I am getting the above error. What is amazing is that, some programs are linking and not all.

Could have an idea on this ?

Thanking you for your cooperation.

Felix Mwango Mutale

Error instalation

Anonymous's picture

When i click Lancer installation
Following error happens:

@ubuntu:~$ gksudo 'python /usr/share/EasyCam2/core.py --gtk'
GO !
ln: creating symbolic link `/lib/modules/2.6.27-11-generic/build/include/linux/config.h': File exists
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-2.6.27-11-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

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=/usr/share/EasyCam2/drivers/gspca CC=cc modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-11-generic'
CC [M] /usr/share/EasyCam2/drivers/gspca/gspca_core.o
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:54:27: error: asm/semaphore.h: No such file or directory
/usr/share/EasyCam2/drivers/gspca/gspca_core.c: In function 'spca5xx_ioctl':
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:2464: error: implicit declaration of function 'video_usercopy'
/usr/share/EasyCam2/drivers/gspca/gspca_core.c: At top level:
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:2610: error: unknown field 'owner' specified in initializer
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:2610: warning: initialization from incompatible pointer type
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:2612: error: unknown field 'type' specified in initializer
/usr/share/EasyCam2/drivers/gspca/gspca_core.c: In function 'spca50x_create_sysfs':
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:2770: error: implicit declaration of function 'video_device_create_file'
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:2781: error: implicit declaration of function 'video_device_remove_file'
/usr/share/EasyCam2/drivers/gspca/gspca_core.c: In function 'spca5xx_probe':
/usr/share/EasyCam2/drivers/gspca/gspca_core.c:4310: error: incompatible types in assignment
make[2]: *** [/usr/share/EasyCam2/drivers/gspca/gspca_core.o] Error 1
make[1]: *** [_module_/usr/share/EasyCam2/drivers/gspca] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-11-generic'
make: *** [default] Error 2

:'(

It didn't compile for me

AMAMH's picture

It didn't compile for me either.
After googling, I think the problem is that it was made for older linux kernels, it cannot be compiled for current kernels.

it doesn't work

nitrofurano01's picture

i also got all of these errors, on both Ubuntu 8.10 i386 and amd64, following this video

from some forum post i also tried this one used to work on Ubuntu 8.04, but not anymore on Ubuntu 8.10:

sudo apt-get install gspca-source module-assistant
sudo module-assistant update
sudo m-a a-i gspca
modprobe gspca
sudo apt-get install xawtv
xawtv

what may happen for causing it? is there some really working way on having webcam really working on an updated Ubuntu? thanks! =)

./gspca_build didn't work

Anonymous's picture

i know i'm a linux n00b but none the less...

when i type in ./gspca_build i get:

root@indy-desktop:/home/indy/gspcav1-20071224# ./gspca_build

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/indy/gspcav1-20071224 CC=cc modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-11-generic'
CC [M] /home/indy/gspcav1-20071224/gspca_core.o
/home/indy/gspcav1-20071224/gspca_core.c:54:27: error: asm/semaphore.h: No such file or directory
/home/indy/gspcav1-20071224/gspca_core.c: In function ‘spca5xx_ioctl’:
/home/indy/gspcav1-20071224/gspca_core.c:2463: error: implicit declaration of function ‘video_usercopy’
/home/indy/gspcav1-20071224/gspca_core.c: At top level:
/home/indy/gspcav1-20071224/gspca_core.c:2609: error: unknown field ‘owner’ specified in initializer
/home/indy/gspcav1-20071224/gspca_core.c:2609: warning: initialization from incompatible pointer type
/home/indy/gspcav1-20071224/gspca_core.c:2611: error: unknown field ‘type’ specified in initializer
/home/indy/gspcav1-20071224/gspca_core.c: In function ‘spca50x_create_sysfs’:
/home/indy/gspcav1-20071224/gspca_core.c:2769: error: implicit declaration of function ‘video_device_create_file’
/home/indy/gspcav1-20071224/gspca_core.c:2780: error: implicit declaration of function ‘video_device_remove_file’
/home/indy/gspcav1-20071224/gspca_core.c: In function ‘spca5xx_probe’:
/home/indy/gspcav1-20071224/gspca_core.c:4301: error: incompatible types in assignment
make[2]: *** [/home/indy/gspcav1-20071224/gspca_core.o] Error 1
make[1]: *** [_module_/home/indy/gspcav1-20071224] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-11-generic'
make: *** [default] Error 2
root@indy-desktop:/home/indy/gspcav1-20071224#

any ideas what went wrong?
i'm MORE than willing to do anything it takes.

PLEASE email me: independence.adams@gmail.com
Thanks

gspca

Baires Norte Lug's picture

Kernel >= 2.6.27

wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20071224.tar.gz

wget http://www.bairesnortelug.com.ar/diff/gspca.diff

tar -zxvf gspcav1-20071224.tar.gz

cd gspcav1-20071224

cat ../gspca.diff | patch -p1

./gspca_build

Happy !!!!

Thz http://www.bairesnortelug.com.ar

Slackware Rulez :P

this parch works to me1!

Guillermo Aguilar's picture

after two hours of surfing. finally this patch to gspca works under my linux distro.. ubuntu jaunty with kernel 2.6.28-15-generic !!
Thanks a lot

Got the same thing as that

Anonymous's picture

Got the same thing as that guy did above. wtf

Error

Nedim's picture

I get this error :
make

make: sdl-config: Command not found
cc -DUSE_SDL -O2 -DLINUX -DHAVE_LIBJPEG=1 -c -o spcagui.o spcagui.c
In file included from spcagui.c:23:
gui.h:11:21: error: SDL/SDL.h: No such file or directory
gui.h:12:23: error: SDL_image.h: No such file or directory
In file included from spcagui.c:23:
gui.h:41: error: expected specifier-qualifier-list before ‘SDL_Surface’
gui.h:51: error: expected specifier-qualifier-list before ‘SDL_Surface’
gui.h:63: error: expected specifier-qualifier-list before ‘SDL_Surface’
gui.h:76: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
gui.h:79: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
gui.h:87: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
gui.h:90: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
gui.h:99: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
gui.h:102: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
gui.h:105: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
In file included from spcagui.c:26:
utils.h:22:21: error: jpeglib.h: No such file or directory
spcagui.c:224: error: expected declaration specifiers or ‘...’ before ‘SDL_Surface’
spcagui.c: In function ‘refresh_screen’:
spcagui.c:238: error: ‘Screen’ undeclared (first use in this function)
spcagui.c:238: error: (Each undeclared identifier is reported only once
spcagui.c:238: error: for each function it appears in.)
spcagui.c: In function ‘telecom’:
spcagui.c:289: error: ‘SDL_Surface’ undeclared (first use in this function)
spcagui.c:289: error: ‘screen’ undeclared (first use in this function)
spcagui.c:291: error: ‘Uint32’ undeclared (first use in this function)
spcagui.c:291: error: expected ‘;’ before ‘video_flags’
spcagui.c:292: error: ‘SDL_Event’ undeclared (first use in this function)
spcagui.c:292: error: expected ‘;’ before ‘event’
spcagui.c:295: error: ‘lib_flags’ undeclared (first use in this function)
spcagui.c:295: error: ‘SDL_INIT_VIDEO’ undeclared (first use in this function)
spcagui.c:297: error: ‘video_flags’ undeclared (first use in this function)
spcagui.c:297: error: ‘SDL_HWPALETTE’ undeclared (first use in this function)
spcagui.c:297: error: ‘SDL_DOUBLEBUF’ undeclared (first use in this function)
spcagui.c:315: error: too many arguments to function ‘draw_button’
spcagui.c:316: error: too many arguments to function ‘draw_button’
spcagui.c:317: error: too many arguments to function ‘draw_button’
spcagui.c:318: error: too many arguments to function ‘draw_button’
spcagui.c:319: error: too many arguments to function ‘draw_button’
spcagui.c:320: error: too many arguments to function ‘draw_button’
spcagui.c:321: error: too many arguments to function ‘draw_potentiometre’
spcagui.c:322: error: too many arguments to function ‘draw_potentiometre’
spcagui.c:323: error: too many arguments to function ‘draw_potentiometre’
spcagui.c:324: error: too many arguments to function ‘draw_control’
spcagui.c:325: error: too many arguments to function ‘draw_control’
spcagui.c:329: error: ‘event’ undeclared (first use in this function)
spcagui.c:332: error: ‘SDL_MOUSEMOTION’ undeclared (first use in this function)
spcagui.c:343: error: too many arguments to function ‘process_potentiometre’
spcagui.c:352: error: too many arguments to function ‘process_potentiometre’
spcagui.c:360: error: too many arguments to function ‘process_potentiometre’
spcagui.c:368: error: ‘SDL_MOUSEBUTTONUP’ undeclared (first use in this function)
spcagui.c:376: error: ‘SDL_MOUSEBUTTONDOWN’ undeclared (first use in this function)
spcagui.c:404: error: too many arguments to function ‘process_control’
spcagui.c:411: error: too many arguments to function ‘refresh_control’
spcagui.c:414: error: too many arguments to function ‘refresh_control’
spcagui.c:422: error: too many arguments to function ‘process_control’
spcagui.c:431: error: too many arguments to function ‘process_potentiometre’
spcagui.c:439: error: too many arguments to function ‘process_potentiometre’
spcagui.c:446: error: too many arguments to function ‘process_potentiometre’
spcagui.c:461: error: too many arguments to function ‘process_button’
spcagui.c:473: error: too many arguments to function ‘process_button’
spcagui.c:477: error: too many arguments to function ‘process_button’
spcagui.c:482: error: too many arguments to function ‘process_button’
spcagui.c:488: error: too many arguments to function ‘process_button’
spcagui.c: In function ‘processvideo’:
spcagui.c:504: error: ‘SDL_Surface’ undeclared (first use in this function)
spcagui.c:504: error: ‘screen’ undeclared (first use in this function)
spcagui.c:505: error: ‘Uint32’ undeclared (first use in this function)
spcagui.c:505: error: expected ‘;’ before ‘video_flags’
spcagui.c:506: error: ‘SDL_Event’ undeclared (first use in this function)
spcagui.c:506: error: expected ‘;’ before ‘event’
spcagui.c:508: error: ‘lib_flags’ undeclared (first use in this function)
spcagui.c:508: error: ‘SDL_INIT_VIDEO’ undeclared (first use in this function)
spcagui.c:509: error: ‘video_flags’ undeclared (first use in this function)
spcagui.c:509: error: ‘SDL_HWPALETTE’ undeclared (first use in this function)
spcagui.c:509: error: ‘SDL_DOUBLEBUF’ undeclared (first use in this function)
spcagui.c:583: error: too many arguments to function ‘refresh_screen’
make: *** [spcagui.o] Error 1

My o.s. is Ubuntu 8.04

final glitch

embee's picture

I followed the tutorial until running ./gspca_build, modules were added properly. I checked the support chart for extra assurance, and it's supported alright (Sonix with *** for support). However, when I run spcagui -d /dev/video0, it spews back an error "wrong device".

Any idea where I messed up?

Thanks for your help & awesome tutorial.

Those URLS

bobbyratliff's picture

Here are the wget commands he used:

wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20071224.tar.gz
wget http://mxhaard.free.fr/spca50x/Download/spcagui20060127.tar.gz

Sadly this driver has three

Cláudio da Silveira Pinheiro's picture

Sadly this driver has three big caveats: The first one is it implements support for V4L version 1, an API that was deprecated by the time of Linux kernel's 2.4.0 release. It doubles a developer's work trying to support a wide range of devices. The second one is about some devices advertising support for pixel formats those devices in fact don't support, a bug that may make your skin look blue (as setting an RGB mode and getting a BGR image without notice). The third one is the fact the driver doesn't handle gracefully device unplugging while in use, making programs freeze instead of recovering from the device disconnection.
These questions were discussed with Michel Xhaard (gspca maintainer) but with less than stellar results.
Mr. Xhaard brought a lot of goodness to Linux for webcam users, and he got a lot of positive karma by doing so, but maybe he could make developers' lives easier. :)

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix