# [SOLVED] GSPCA driver problem

## 2lopez

Hi guys...

I've bought a small Labtec Webcam Pro which seems to be supported by the kernel, as Documentation/video4linux/gspca.txt says:

 *Quote:*   

> ...
> 
> zc3xx           046d:08a2       Labtec Webcam Pro
> 
> ...

 

In fact I've been using for some weeks the module from http://mxhaard.free.fr/download.html, but after upgrading to 2.6.27 sources I got a compilation failure so decided to move to the kernel driver.

I've compiled the module and loaded it. After that, when I try to test it with camorama, I get the following dialog:

 *Quote:*   

> Unable to capture image.

 

and the program crashes with no output. I get similar results using Skype (no dialog but a screen with a lot of distortion and no image at all).

Here is an extract of my kernel .config file:

```
...

#

# Multimedia devices

#

#

# Multimedia core support

#

CONFIG_VIDEO_DEV=y

CONFIG_VIDEO_V4L2_COMMON=y

CONFIG_VIDEO_ALLOW_V4L1=y

CONFIG_VIDEO_V4L1_COMPAT=y

# CONFIG_DVB_CORE is not set

CONFIG_VIDEO_MEDIA=y

#

# Multimedia drivers

#

CONFIG_MEDIA_ATTACH=y

CONFIG_VIDEO_V4L2=y

CONFIG_VIDEO_V4L1=y

CONFIG_VIDEO_CAPTURE_DRIVERS=y

# CONFIG_VIDEO_ADV_DEBUG is not set

CONFIG_VIDEO_HELPER_CHIPS_AUTO=y

# CONFIG_VIDEO_VIVI is not set

# CONFIG_VIDEO_CPIA is not set

# CONFIG_VIDEO_CPIA2 is not set

# CONFIG_VIDEO_STRADIS is not set

# CONFIG_VIDEO_MEYE is not set

CONFIG_V4L_USB_DRIVERS=y

CONFIG_USB_VIDEO_CLASS=m

CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

CONFIG_USB_GSPCA=m

# CONFIG_USB_VICAM is not set

# CONFIG_USB_IBMCAM is not set

# CONFIG_USB_KONICAWC is not set

# CONFIG_USB_QUICKCAM_MESSENGER is not set

# CONFIG_USB_ET61X251 is not set

# CONFIG_USB_OV511 is not set

# CONFIG_USB_SE401 is not set

# CONFIG_USB_SN9C102 is not set

# CONFIG_USB_STV680 is not set

# CONFIG_USB_ZC0301 is not set

# CONFIG_USB_PWC is not set

# CONFIG_USB_ZR364XX is not set

# CONFIG_USB_STKWEBCAM is not set

# CONFIG_USB_S2255 is not set

# CONFIG_SOC_CAMERA is not set

# CONFIG_VIDEO_SH_MOBILE_CEU is not set

# CONFIG_RADIO_ADAPTERS is not set

# CONFIG_DAB is not set

...
```

Could you please give me a tip? Anything would be much appreciated!

----------

## m.s.w

Well, It wont help you in solving problem, but it maybe will make you easier to live with the problem:

I have exactly the same problem. What is strange is that with gspcav1 driver compiled (not the one from kernel) everything worked great. This driver from kernel is just a crappy thing.

----------

## 2lopez

I've tried to emerge gspcav1 from the ebuild tree (I'm using the stable one so I had to add it to package.keywords) and got the following output:

```
 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/2.6.27-gentoo-r7/build

 * Found sources for kernel version:

 *     2.6.27-gentoo-r7

 * Checking for suitable kernel configuration options...

   [ ok ]

>>> Unpacking source...

>>> Unpacking gspcav1-20071224.tar.gz to /var/tmp/portage/media-video/gspcav1-20071224/work

 * Converting gspcav1-20071224/Makefile to use M= instead of SUBDIRS= ...

   [ ok ]

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224 ...

ln: creating symbolic link `Module.symvers': File exists

 * Preparing gspca module

make -C /usr/src/linux M=/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224 CC=cc modules

make[1]: Entering directory `/usr/src/linux-2.6.27-gentoo-r7'

  CC [M]  /var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.o

  CC [M]  /var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/decoder/gspcadecoder.o

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:54:27: error: asm/semaphore.h: No such file or directory

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c: In function 'spca5xx_ioctl':

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:2463: error: implicit declaration of function 'video_usercopy'

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c: At top level:

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:2609: error: unknown field 'owner' specified in initializer

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:2609: warning: initialization from incompatible pointer type

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:2611: error: unknown field 'type' specified in initializer

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c: In function 'spca50x_create_sysfs':

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:2769: error: implicit declaration of function 'video_device_create_file'

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:2780: error: implicit declaration of function 'video_device_remove_file'

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c: In function 'spca5xx_probe':

/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.c:4301: error: incompatible types in assignment

make[2]: *** [/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224/gspca_core.o] Error 1

make[2]: *** Waiting for unfinished jobs....

make[1]: *** [_module_/var/tmp/portage/media-video/gspcav1-20071224/work/gspcav1-20071224] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.27-gentoo-r7'

make: *** [default] Error 2

 * 

 * ERROR: media-video/gspcav1-20071224 failed.

 * Call stack:

 *               ebuild.sh, line   49:  Called src_compile

 *             environment, line 3131:  Called linux-mod_src_compile

 *             environment, line 2404:  Called die

 * The specific snippet of code:

 *               eval "emake HOSTCC=\"$(tc-getBUILD_CC)\"                   CROSS_COMPILE=${CHOST}-                   LDFLAGS=\"$(get_abi_LDFLAGS)\"                   ${BUILD_FIXES}                   ${BUILD_PARAMS}                   ${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";

 *  The die message:

 *   Unable to emake HOSTCC=i686-pc-linux-gnu-gcc CROSS_COMPILE=i686-pc-linux-gnu- LDFLAGS=  KERNELDIR=/usr/src/linux default

 * 

 * If you need support, post the topmost build error, and the call stack if relevant.

 * A complete build log is located at '/var/tmp/portage/media-video/gspcav1-20071224/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/media-video/gspcav1-20071224/temp/environment'.

 * 

```

This is one reason of why I prefer the stable tree   :Confused: 

m.s.w, have you tried the driver from portage or the one from http://mxhaard.free.fr/download.html ?? Have you succeeded in any way???

----------

## hasselhoff

 *2lopez wrote:*   

> Hi guys...
> 
> I've bought a small Labtec Webcam Pro which seems to be supported by the kernel, as Documentation/video4linux/gspca.txt says:
> 
>  *Quote:*   ...
> ...

 

When gspca was moved into the kernel sources, they had to remove many video formats that were specific to individual webcams.  Emerge the userspace library libv4l to get these formats.  Run skype with:

 *Quote:*   

> LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

 

Note that skype is 32-bit, so if you're on a 64-bit system you'll have to do more work because the libv4l ebuild will only build 64-bit libraries.  There's a modified ebuild somewhere, maybe at bugs.gentoo.org, which will build 32-bit libs as well.  In that case the path above should be /usr/lib32/libv4l/v4l1compat.so.

----------

## radio_flyer

Yeah, I ran into this with the latest 2.6.26 kernel too. I have a Logitech Quickcam Communicate STX, but it uses (used) the same gpscav1 driver, so perhaps my path to camorama happiness might be instructive even though your camera is different.

BTW, I note your comment about stable. I prefer to refer to Gentoo's keywording system as broken (~) and stale (no ~). I think those definitions are more precise   :Laughing: 

Anyway, here's what I did:

Unmerged gspcav1.

Enabled the USB gpsca drivers in the kernel as modules -- on my system this loads gspca_main and gspca_zc3xx when I plug in the camera.

Stuck the USE flag 'libv4l2' in /etc/make.conf. Two items of goodness result--the libv4l2 library is pulled in, and vlc is rebuilt to support it. This allows the webcam to work with vlc (at /dev/video0).

In order to recover some of the adjustments that used to be present in the old gspcav1 driver, I emerged the v4l2ucp program. There's an ebuild at 

https://bugs.gentoo.org/show_bug.cgi?id=249103, but it's obviously written for broken architectures, as it keywords ~amd64 and calls for a version of portage that hasn't become stale yet. Interestingly, this state of the art ebuild compiles a program last modified in 2006. Go figure. Anyway, my modified version, which I stuck in /usr/local/portage/media-tv/v4l2ucp, is below. (Make sure your local overlay is enabled in /etc/make.conf).

To get camorama to run, you have to pay attention to the elog output of libv4l2 pulled in during step 3 above. Apparently camorama uses the older video4linux V1 API, so you have to run it with 'LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so camorama'.

My webcam lives again, and it is nice not to have to do a module-rebuild for gspcav1 after every kernel upgrade.

My modified v4l2ucp-1.2.ebuild :

```

# Copyright 1999-2008 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

inherit eutils

DESCRIPTION="A universal control panel for all Video for Linux Two (V4L2)

devices"

HOMEPAGE="http://v4l2ucp.sourceforge.net/"

SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="x86 ~amd64"

IUSE=""

DEPEND="x11-libs/qt:3"

RDEPEND="${DEPEND}"

# src_compile() {

#       econf || die "econf failed"

#       emake || die "emake failed"

# }

src_install() {

        einstall || die "einstall failed"

}

```

Don't forget to run 'ebuild v4l2ucp-1.2.ebuild digest'.

----------

## 2lopez

Simply emerging libv4l solved my problem, as hasselhoff suggested! Now I can run camorama and skype using LD_PRELOAD.

Thank you hasselhoff and radio_flyer!!!

----------

## Tolstoi

The funny thing is that after testing most of the spca kernel modules I found the zc3xx one working for me. But only for a short time. Now I only get garbled stuff on the VLC and Skype display. VLC only starts my cam in v4l 1 mode and not in v4l2. As far as i can remember I never had to switch between those versions before. I wonder what I messed up after fiddling around so much.

----------

## 2lopez

 *Tolstoi wrote:*   

> Now I only get garbled stuff on the VLC and Skype display. 

 

I suppose you are using LD_PRELOAD as hasselhof suggests, aren't you??

Good luck!!

----------

## Tolstoi

At the moment VLC crashes whether I use that LD and so on command or not. Anyhow it's not quite the idea I have of an app to type in a command every time I want to use it. It worked before and I want the same comfortable solution back   :Very Happy:  . I hope I'll find a way soon.

----------

## Tolstoi

Skype works now with the cam and LD_PRELOAD. VLC still crashes.

----------

## shur

The LD_PRELOAD solution works fine for my Logitech Quickcam Messenger. Now could someone please point me to a site that would explain exactly what I am doing here. Thanks.

----------

## Tolstoi

After compiling the kernel again - I first took the v4l1 stuff out and later added the v4l1 layer stuff back again, VLC only shows me one option to use with my cam as it used to before (only v4l2) which is what I prefer and it doesn't crash anymore. Im not using LD_Preload here with VLC. So everything is fine here meanwhile.

----------

## M

The patch I posted here https://forums.gentoo.org/viewtopic-t-717602.html still works for latest svn mplayer code. I used mplayer-9999-r21 from berkano overlay in case you or somone else wants to try with mplayer.

----------

## binro

I have just upgraded to kernel 2.6.28-r1 on AMD64 and am having the same problem with my Logitech Communicate STX. Following the thread here, I backed out gspcav1 and used the kernel modules and the camera is now recognised but the video is garbled. I then installed the 32+64 bit version of libv4l and the spcaview utility now works but skype gives:

```

$ LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype

ERROR: ld.so: object '/usr/lib32/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.

```

In fact I am not much bothered about skype but KDE kopete cannot recognise the camera. Anybody had any luck with this?

TIA

----------

## Condex

 *binro wrote:*   

> I have just upgraded to kernel 2.6.28-r1 on AMD64 and am having the same problem with my Logitech Communicate STX. Following the thread here, I backed out gspcav1 and used the kernel modules and the camera is now recognised but the video is garbled. I then installed the 32+64 bit version of libv4l and the spcaview utility now works but skype gives:
> 
> ```
> 
> $ LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype
> ...

 

Sorry to bring this post up again, but I was having a similar issue with Kopete.

Same module gspca_zc3xx. With mplayer I get video without any problem but Kopete wasn't displaying any image... Running it from the terminal shows some complaining about conversion or something like that  :Confused: 

As a matter of fact, I emerged version 0.5.3 of libv4l and after executing Kopete with the following command I can see myself on the Video configuration section:

```
LD_PRELOAD=/usr/lib64/libv4l/v4l2convert.so kopete
```

Hope it helps anyone with the same problem  :Wink: 

BTW, my system is a multilib AMD64, kernel 2.6.27

Cheers!

Condex-  :Cool: 

----------

## cfgauss

 *hasselhoff wrote:*   

> Note that skype is 32-bit, so if you're on a 64-bit system you'll have to do more work because the libv4l ebuild will only build 64-bit libraries.  There's a modified ebuild somewhere, maybe at bugs.gentoo.org, which will build 32-bit libs as well.  In that case the path above should be /usr/lib32/libv4l/v4l1compat.so.

 

Thanks. The solution for AMD64 systems is here: https://bugs.gentoo.org/show_bug.cgi?id=244918. Skype strangely does report the error mentioned by binro but video works nonetheless. But audio doesn't function with my Logitech Communicate STX Webcam (which uses the gspca_zc3xx driver). Does this driver provide audio? Are there any suggestions on how to get audio working? Thanks.

[EDIT] Audio now seems to work with this 32-bit driver so all is well with Skype. Attaching the webcam loads gspca_zc3xx and that, with the LD_PRELOAD environment variable, seems to work for both audio and video.[/EDIT]Last edited by cfgauss on Sat Jul 11, 2009 3:28 pm; edited 1 time in total

----------

## Dominique_71

About v4l2ucp, it is a new version from the 22 february 2009. To change the ebuild name and redigest is enough to get it to install with portage.

@radio_flyer: ~amd64 and EAPI2 is not a broken arch but testing. Hopefully, computer science is not limited to wintel...

----------

