# spca5xx or gspca driver help

## flynnguy

I'm new to gentoo but not to linux so I am familiar with compiling my kernel and such but not necessarily the gentoo way of doing things. 

I have a webcam that I am trying to get working under gentoo. If I do a lsusb, I get the following:

Bus 001 Device 006: ID 093a:2468 Pixart Imaging, Inc. Easy Snap Snake Eye WebCam

Doing some searching I found that the module spca5xx should work but in trying to get that module compiled, I've also seen references that the gspca module is replacing it.

So first I do:

```
# emerge spca5xx

Calculating dependencies... done!

>>> Emerging (1 of 1) media-video/spca5xx-20060301 to /

 * spca5xx-20060301.tar.gz MD5 ;-) ...                                                                    [ ok ]

 * spca5xx-20060301.tar.gz RMD160 ;-) ...                                                                 [ ok ]

 * spca5xx-20060301.tar.gz SHA1 ;-) ...                                                                   [ ok ]

 * spca5xx-20060301.tar.gz SHA256 ;-) ...                                                                 [ ok ]

 * spca5xx-20060301.tar.gz size ;-) ...                                                                   [ ok ]

 * checking ebuild checksums ;-) ...                                                                      [ ok ]

 * checking auxfile checksums ;-) ...                                                                     [ ok ]

 * checking miscfile checksums ;-) ...                                                                    [ ok ]

 * checking spca5xx-20060301.tar.gz ;-) ...                                                               [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/2.6.19-gentoo-r5/build

 * Found sources for kernel version:

 *     2.6.19-gentoo-r5

>>> Unpacking source...

>>> Unpacking spca5xx-20060301.tar.gz to /var/tmp/portage/media-video/spca5xx-20060301/work

tar: spca5xx-20060301/drivers: implausibly old time stamp 1969-12-31 19:00:00

 * Converting spca5xx-20060301/Makefile to use M= instead of SUBDIRS= ...                                 [ ok ]

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301 ...

 * Preparing spca5xx module

   Building SPCA5XX driver for 2.5/2.6 kernel.

   Remember: you must have read/write access to your kernel source tree.

make -C /usr/src/linux M=/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301 CC=i686-pc-linux-gnu-gcc modules

make[1]: Entering directory `/usr/src/linux-2.6.19-gentoo-r5'

  CC [M]  /var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.o

  CC [M]  /var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spcadecoder.o

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:39:26: error: linux/config.h: No such file or directory

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spcadecoder.c: In function 'fun_D':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spcadecoder.c:756: warning: value computed is not used

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca50x_init_isoc':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:1976: warning: assignment from incompatible pointer type

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca5xx_open':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:3838: warning: implicit declaration of function 'video_devdata'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:3838: warning: initialization makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:3843: warning: implicit declaration of function 'video_get_drvdata'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:3843: warning: initialization makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca5xx_close':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:3953: warning: initialization makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca5xx_do_ioctl':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:4000: warning: initialization makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca5xx_ioctl':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:4925: warning: implicit declaration of function 'video_usercopy'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca5xx_read':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:4948: warning: initialization makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca5xx_mmap':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5055: warning: initialization makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: At top level:

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5107: error: variable 'spca50x_template' has initializer but incomplete type

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5108: error: unknown field 'owner' specified in initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5108: warning: excess elements in struct initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5108: warning: (near initialization for 'spca50x_template')

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5109: error: unknown field 'name' specified in initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5109: warning: excess elements in struct initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5109: warning: (near initialization for 'spca50x_template')

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5110: error: unknown field 'type' specified in initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5110: warning: excess elements in struct initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5110: warning: (near initialization for 'spca50x_template')

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5111: error: unknown field 'hardware' specified in initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5111: warning: excess elements in struct initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5111: warning: (near initialization for 'spca50x_template')

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5112: error: unknown field 'fops' specified in initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5112: warning: excess elements in struct initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5112: warning: (near initialization for 'spca50x_template')

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5114: error: unknown field 'release' specified in initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5114: error: 'video_device_release' undeclared here (not in a function)

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5114: warning: excess elements in struct initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5114: warning: (near initialization for 'spca50x_template')

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5116: error: unknown field 'minor' specified in initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5116: warning: excess elements in struct initializer

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5116: warning: (near initialization for 'spca50x_template')

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'cd_to_spca50x':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5954: warning: implicit declaration of function 'to_video_device'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5954: warning: initialization makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:5955: warning: return makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca50x_create_sysfs':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:6064: warning: implicit declaration of function 'video_device_create_file'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c: In function 'spca5xx_probe':

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8275: warning: implicit declaration of function 'video_device_alloc'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8275: warning: assignment makes pointer from integer without a cast

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8278: error: invalid application of 'sizeof' to incomplete type 'struct video_device' 

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8278: error: invalid application of 'sizeof' to incomplete type 'struct video_device' 

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8278: error: invalid application of 'sizeof' to incomplete type 'struct video_device' 

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8280: error: dereferencing pointer to incomplete type

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8282: warning: implicit declaration of function 'video_set_drvdata'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8287: warning: implicit declaration of function 'video_register_device'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8287: error: 'VFL_TYPE_GRABBER' undeclared (first use in this function)

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8287: error: (Each undeclared identifier is reported only once

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8287: error: for each function it appears in.)

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8316: error: dereferencing pointer to incomplete type

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8317: warning: implicit declaration of function 'video_device_release'

/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.c:8319: warning: implicit declaration of function 'video_unregister_device'

make[2]: *** [/var/tmp/portage/media-video/spca5xx-20060301/work/spca5xx-20060301/drivers/usb/spca5xx.o] Error 1

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

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

make[1]: Leaving directory `/usr/src/linux-2.6.19-gentoo-r5'

make: *** [default] Error 2

!!! ERROR: media-video/spca5xx-20060301 failed.

Call stack:

  ebuild.sh, line 1614:   Called dyn_compile

  ebuild.sh, line 971:   Called qa_call 'src_compile'

  environment, line 3946:   Called src_compile

  ebuild.sh, line 1304:   Called linux-mod_src_compile

  linux-mod.eclass, line 510:   Called die

!!! Unable to make  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/spca5xx-20060301/temp/build.log'.

```

Then I found this command:

```
# ACCEPT_KEYWORDS="~x86" emerge gspca

Calculating dependencies... done!

>>> Emerging (1 of 1) media-video/gspca-01.00.10 to /

 * gspcav1-01.00.10.tar.gz MD5 ;-) ...                                                                    [ ok ]

 * gspcav1-01.00.10.tar.gz RMD160 ;-) ...                                                                 [ ok ]

 * gspcav1-01.00.10.tar.gz SHA1 ;-) ...                                                                   [ ok ]

 * gspcav1-01.00.10.tar.gz SHA256 ;-) ...                                                                 [ ok ]

 * gspcav1-01.00.10.tar.gz size ;-) ...                                                                   [ ok ]

 * checking ebuild checksums ;-) ...                                                                      [ ok ]

 * checking auxfile checksums ;-) ...                                                                     [ ok ]

 * checking miscfile checksums ;-) ...                                                                    [ ok ]

 * checking gspcav1-01.00.10.tar.gz ;-) ...                                                               [ ok ]

/usr/portage/media-video/gspca/gspca-01.00.10.ebuild: line 26: eeinfo: command not found

/usr/portage/media-video/gspca/gspca-01.00.10.ebuild: line 27: eeinfo: command not found

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found kernel object directory:

 *     /lib/modules/2.6.19-gentoo-r5/build

 * Found sources for kernel version:

 *     2.6.19-gentoo-r5

 * Checking for suitable kernel configuration options...                                                  [ ok ]

>>> Unpacking source...

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

!!! ERROR: media-video/gspca-01.00.10 failed.

Call stack:

  ebuild.sh, line 1614:   Called dyn_unpack

  ebuild.sh, line 751:   Called qa_call 'src_unpack'

  environment, line 3945:   Called src_unpack

  gspca-01.00.10.ebuild, line 34:   Called convert_to_m '/var/tmp/portage/media-video/gspca-01.00.10/work/gspca-01.00.10/gspcav2/Makefile'

  linux-mod.eclass, line 156:   Called die

!!! convert_to_m() requires a filename as an argument

!!! 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/gspca-01.00.10/temp/build.log'.

```

Anyone have any ideas how I can get this working?

----------

## SlashRhumSlashNeisson

Hi,

you must use gspcav1 with the new kernel

https://forums.gentoo.org/viewtopic-t-536754-highlight-.html

----------

## flynnguy

Thanks, I did search but couldn't seem to get anything I found to work. This seemed to work. (It compiled the kernel module and I could load it... haven't tested it yet)

----------

## brullonulla

I am using 2.6.18 and I have no plans to upgrade my kernel soon. I've seen spca5xx is going out of Portage. Does 2.6.18 support gspcav1 or should I wait for upgrading to a newer kernel?

----------

## SlashRhumSlashNeisson

hi, 

You can use gspcav1 with 2.6.18 kernel.

----------

## NeddySeagoon

flynnguy,

```
# ACCEPT_KEYWORDS="~x86" emerge gspca
```

is a very bad thing to do because portage will not know you are using the testing gspca.

You should add  

```
media-video/gspca ~x86
```

to your /etc/portage/package.keywords file so portage can manage your mix of stable and testing packages. Read man portage.

I notice that I get - media-video/gspca-01.00.10 (masked by: package.mask) now, so the package is hard masked too.

Use /etc/portage/package.unmask to fix that.

Command line adjustments to your set up, whatever they are will lead to grief at your next e

```
merge --sync

emerge world -uDNav 
```

as portage will try to downgrade the things not under its control.

----------

