Get Your Webcam Working with GSPCA

August 6th, 2008 by Elliot Isaacson

Your rating: None Average: 3 (2 votes)

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.


__________________________


Special Magazine Offer -- 2 Free Trial Issues!
Receive 2 free trial issues of Linux Journal as well as instant online access to current and past issues. There's NO RISK and NO OBLIGATION to buy. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Sorry, offer available in the US only. International orders, click here.

Comment viewing options

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

Error

On October 9th, 2008 Nedim (not verified) says:

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

On September 21st, 2008 embee (not verified) says:

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

On August 21st, 2008 bobbyratliff says:

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

On August 7th, 2008 Cláudio da Silveira Pinheiro (not verified) says:

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. :)

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Featured Videos

The October 9, 2008 edition of Linux Journal Live! Associate Editor, Shawn Powers, and Kyle Rankin, "Hack and /" columnist and author of Knoppix Hacks, Linux Multimedia Hacks, Knoppix Pocket Reference and others, discuss Linux distributions.

The October 2, 2008 edition of Linux Journal Live! Associate Editor, Shawn Powers, and Steven Evatt, Online Development manager for The Houston Chronicle discuss surviving disaster with Linux.

From the Magazine

November 2008, #175

There aren't many numbers that put the US national debt to shame, but here's one: 1,100,000,000,000,000. What's that? That's how many floating-point operations per second the Roadrunner supercomputer at Las Alamos can perform. That's about 100 FLOPS per dollar of US debt (unfortunately, the debt is winning the second derivative race). Read the article about Roadrunner in this month's High Performance Computing issue of LJ.

Along with that, find out how to program the Cell processor and how to use CUDA with your NVIDIA GPU. Also in this issue: Mr HandS (aka Kyle Rankin) gives us a few tips on using Compiz, Chef Marcel shows you how to get blogging off your plate quicker, Mick Bauer talks about Samba security, Dan Sawyer interviews Cory Doctrow and Doc talks about how information technology can affect democracy and fix the national debt (just kidding about that last part). That and more for your reading pleasure in this month's Linux Journal.

Read this issue