Webcam Driver Help


Chaser

Member
Joined
Jun 13, 2006
Messages
408
Location
Manchester
Wondering if anyone can help, though its pretty quiet here...

I picked up one of these last year (an MD80 spycam clone)

shortly after getting my Pandora but after exhaustive searches, found all the linux forums at a loss and
disclaiming that no drivers exist for it.

A check a few weeks back found that linuxtv.org had added support via their GSPCA driver packages, so perhaps good to go?

It would make an ideal little cam for the Pandora as its USB 2.0 so needs no hub, is compact, could be
easily clipped to the lid with a simple loop, holds upto 16gb microsd (should work as mass storage
aswell) and gives surprisingly good audio and video for such a cheap ass piece of Chinese rubbish.

63804795.png


44777041.png


73222606.png


28272759.png


It suffers though from weird battery behaviour (one day gives an hour, the next 5 minutes) and not
knowing where the hell its pointing, (so sometimes whilst fishing with it, I get home to find, like my
fishing, I've captured sod all :) ). Both these would be solved with it hooked up to the pandora, getting
power from it and a screen to film via. In addition if I can get its USB storage working, its an additional 16gb of potential space for very little battery drain.

On initial connection via dmesg| tail it reports:

chasers-openpandora:~$ dmesg |tail
[89761.302215] sd 10:0:0:0: [sda] Write Protect is off
[89761.307189] sd 10:0:0:0: [sda] Mode Sense: 20 00 00 00
[89761.307189] sd 10:0:0:0: [sda] Assuming drive cache: write through
[89761.313446] sda: sda1
[89761.319549] sda: p1 exceeds device capacity
[89761.325469] sd 10:0:0:0: [sda] Attached SCSI removable disk
[89761.331665] sd 10:0:0:0: Attached scsi generic sg0 type 0
[89761.340301] usb-storage: device scan complete
[89762.165985] FAT: bogus number of reserved sectors
[89762.170745] VFS: Can't find a valid FAT filesystem on dev sda.
chasers-openpandora:~$

Essentials being below, the ID's and the fact it doesn't like the file system for now, so wont open as an SD card.

04fc:0171 storage mode

lsusb gives
chasers-openpandora:~$ sudo lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 04fc:0171 Sunplus Technology Co., Ltd
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
chasers-openpandora:~$

yet it´s:

04fc 1528 in camera mode "mfr=1 product=2, serialnumber=0, product: general image device, manufacturer= sunplus co ltd.

So its recognized without a hub. The ID's are there and changed via the mode button as an imaging device. On windows it works as SD card and via mode button as a webcam in Skype or similar.

So dmesg then gives :

chasers-openpandora:~$ dmesg |tail
[77975.266998] __ratelimit: 67 callbacks suppressed
[77975.271636] keyboard.c: can't emulate rawmode for keycode 184
[77975.445587] keyboard.c: can't emulate rawmode for keycode 184
[78014.307006] usb 1-2: USB disconnect, address 3
[78014.898529] usb 1-2: new high speed USB device using ehci-omap and address 4
[78015.181945] usb 1-2: configuration #1 chosen from 1 choice
[78015.197692] usb 1-2: New USB device found, idVendor=04fc, idProduct=1528
[78015.204528] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[78015.211761] usb 1-2: Product: General Image Devic
[78015.216491] usb 1-2: Manufacturer: Sunplus Co Ltd

So it appears to be ready.

The ID's match and correspond to the driver in the package listed here :
http://www.kernel.org/doc/Documentation/video4linux/gspca.txt

spca1528 04fc:1528 Sunplus MD80 clone

Which is indeed within the GSPCA downloads 'build' folder. That I´ve uploaded here:

http://www.megaupload.com/?d=08HFDG00 gspca file

(as it also appears to contain an XBOX Kinnect driver which I thought others may be interested in)

The enclosed readme.txt and make file are in the zip and state I should "make or make install" via the terminal to build the drivers proper from whats provided and install them automatically. This however doesn't work, as all I get is "make is an unknown command".

README
gspca version 2

Standard distributions

The source of the driver gspca version 2 is included in
the current Linux kernel (starting 2.6.27).

If you have any problem with your webcam, you may get a newer
version from the git or mercurial repositories at LinuxTv.org:

http://www.linuxtv.org/

Test distribution

As there are still bugs and new webcams being tested, you may get
the last gspca development sources from my page:

http://moinejf.free.fr

Installation of the test distribution

Untar the tarball anywhere. It will create a subdirectory
gspca-2.10.x/ ('x' is the current release number).

'cd' to this subdirectory.

If you used a distribution from a LinuxTv mercurial repository,
you should have new versions of the video common modules.
In this case, you must copy the module symbol versions to the
subdirectory 'build':

cp <hg root>/v4l/Module.symvers build/

If you forgot this step, the gspca modules could not be installed
in memory with the error:

gspca_main: disagrees about version of symbol video_devdata

To generate all gspca subdrivers, do:

make

and, to install them in the kernel library, as root, do:

make install

If you are interrested by only one webcam, you may find the
associated subdriver looking at the linux documentation:

<linux source root>/Documentation/video4linux/gspca.txt

(you may browse this file in any linux git repository)

Suppose your subdriver is 'sonixj'. Instead of the previous
'make', you may do:

make gspca_sonixj.ko

The next 'make install' will install only two modules: gspca_main
and your subdriver.

Test

You may try your webcam with any v4l2 viewer (vlc, mplayer...)
or with my simple video viewer (svv):

http://moinejf.free.fr/svv.c

(the command line to generate the program is at the beginning
of the source)

If your webcam does not work:

- there is no /dev/video0:

- check if the gspca kernel modules are loaded.
If not, look at the last kernel messages
('dmesg | tail -30').

- if they are loaded, do

echo 0x0f > /sys/module/gspca_main/parameters/debug

then unplug and replug your webcam, and send me
the last kernel messages.

- the program says 'timeout' or there is no image:

- do

echo 0x3f > /sys/module/gspca_main/parameters/debug

then start the application, and send me the last kernel
messages.

- there is a bad image (you see something, maybe moving):

- get an image with

./svv -rg

- this creates a file 'image.dat'. Send it to me with the
last kernel messages.

Supported webcams

Look in the file:
<linux root>/Documentation/video4linux/gspca.txt

MAKEFILE
#

VERSION=2.11.21
#21 gspca - sonixj: Fix start sequence of sensor mt9v111
# gspca - sonixj: change again the pkt_scan
#20: gspca - tp6800: the resolutions were inverted
# gspca - tp6800: change the jpeg quantication tables for ovxxxx
#19: gspca - tp6800: fix some strange and bad isoc packets
# gspca - tp6800: add delay on USB write
# gspca - tp6800: load only once the fix i2c parameters
# gspca - tp6800: try to do real 640x480 for ovxxxx
#18: gspca - tp6800: info message if the sensor is not forced
# gspca - sonixj: Fix ISOC packet scan
# A marker 'ff ff 00 c4 c4 96' indicates an end of frame.
# It may be present anywhere in an isochronous packet.
# The bit 0x08 of the 6th byte of this marker indicates an overflow;
# if set, the frame must be discarded.
# gspca - sonixj: Fix bad luminosity
# The offsets are the marker ones.
#17: gspca - tp6800: bad init of the color table
# gspca - tp6800: adjust the quantization tables from the webcam quality
# gspca - vc032x: change some values of po3130nc from ms-win driver
# gspca - vc032x: add sharpness control to po3130nc
# gspca - vc032x: remove control setting on po3130nc capture start
# gspca - sonixj: Rename the infrared control as illuminator
# gspca - sonixj: Add the illuminator control to the webcam 0c45:614a
# gspca - sonixj: Fix ISOC packet scan
# A marker 'ff ff 00 c4 c4 96' indicates an end of frame.
# If it is not preceded by the JPEG EOF (ff d9), the frame must be discarded.
# (changed later)
#16 gspca - sonixj: bug in pkt_scan
# gspca - ov534: H & V flip controls of ov767x were inverted
# gspca - ov534: AGC and AEC work together for ov767x
# gspca - ov534: read the current exposure when disabling AEC with ov767x
#15 gspca - sonixj: The pin S_PWR_DN is inversed for sensor mi0360
# gspca - sonixj: Treat the markers in image flow
# When a marker 'ff ff 00 c4 c4 96' is found without end of image 'ff d9',
# the image must be discarded.
# gspca - ov534: add H & V flip controls for ov767x
# gspca - ov534: change the light frequency filter for ov767x
# gspca - ov534: remove sharpness control for ov767x
#14 gspca - ov534: Propagate USB errors to higher level
# gspca - ov534: Clearer debug messages
# gspca - ov534: the ov767x creates JPEG images
#13: gspca - tp6800: fix a crash at capture start with sensor CX0342
# gspca - ov534: Use the new control mechanism
# gspca - ov534: Add the webcam 06f8:3002 and sensor ov767x
#12: gspca: Fix some warnings about signedness
# (main, pca7302, pac7311)
# gspca - tp6800: fix bad jpeg header
# gspca: Remove useless code
#11: gspca - tp6800: add jpeg quality and exposure and gain controls
# gspca - tp6800: add webcam 06a2:6810
#10: gspca - stv06xx: change the autogain control
#9: gspca - stv06xx: fix a bug in the autogain control
#8: gspca - tp6800: fix bad frame rate setting for cx0342
# gspca - tp6800: set the asked frame rate for ovxxxx
# gspca - stv06xx - st6422: Use the new control mechanism
# gspca - stv06xx: Move the packet scan routine of st6422
# gspca - stv06xx: Add the autogain control
#7: gspca - tp6800: add USB traces
# gspca - tp6800: display the ovxxx id after capture start
# gspca - zc3xx: Remove some sensors from the chipset table
# Some values of the chipset ID do not identify the sensor.
# gspca - zc3xx: Use the new control mechanism
# gspca - zc3xx: The sensor tas5130_vf0250 is a gc0303
# gspca - zc3xx: Probe the sensor gc0303
#6: gspca - tp6800: add gamma control
# gspca - tp6800: add 640x480 for ovxxxx (not handled)
#5: gspca - ov519: Cleanup source
#4: gspca - ov519: cleanup source from git download
# gspca - ov519: Add get/set streamparm for frame rate
# Also, remove the module parameter 'frame_rate'.
# gspca - ov519: Cleanup source
# gspca - zc3xx: Bad detection of some tas5130c sensors
# 2.10
#19: gspca: Convert hexadecimal values from uppercase to lowercase
#14: gspca - tp6800: use the new video control mechanism.
# gspca - main: let set the input 0.
#13 gspca - main: bad setting of video standard
#12: gspca - spca505: Use the new video control mechanism.
# (dist: remove .mod.c)
#11: gspca - main: Handle multi video inputs
# gspca - main: Handle video standards
# gspca - spca505: Merge spca506 into spca505 and remove spca506
# This change was needed to handle the USB device 0733:0430 which may be
# the webcam Intel PC Camera Pro CS430 or the PixelView PlayTV
# (PV-321 USB-TV-FM-Capture Box ?)
# The grabber parts now include input and standard selection.
# gspca - spca505: Fix a bad value in TV start
#9: gspca - vc032x: Add 1280x1024 resolution for sensor po3130nc
# gspca - spca505: Set the names to the known bridge registers
# gspca - spca505: Propagate USB errors to higher level
#8: gspca - main: Disable debug messages by default
# gspca - vc032x: Add poxxxx controls to po3130nc
# gspca - vc032x: Let 046d:0892 and 046d:0896 as po3130nc instead of poxxxx
#7: gspca - vc032x: Cleanup source
# gspca - vc032x: Let sensor probe of 046d:0892 and 046d:0896 (poxxxx)
# gspca - vc032x: remove full start and stop0 for poxxxx
# gspca - zc3xx: Adjust exchanges for the webcam KMC-90.
# The exchanges cs2102k are removed and replaced by hdcs2020.
# The exchanges hdcs2020 now include some KMC-90 specific ones.
# (i2c addr, control2 instead of control, ..)
# dist: remove unless things (crebuildir.sh - Makefile targets)
#6: gspca - zc3xx: Update the init sequences of sensor cs2102k (hdcs2020)
# The new exchanges are extracted from the public file usbvm31b.inf of the
# ms-Windows driver for the KMC-90 webcam.
# In this file, the sensor is named cs2102 but it is a hdcs2020.
# gspca - zc3xx: Update the init sequences of sensor hdcs2020
# The new exchanges are extracted from the public file usbvm303.inf of the
# ms-Windows driver for 0ac8:303b.
#5: gspca - vc032x: remove poxxxx double start
# gspca - vc032x: do full init of poxxx at probe time
# gspca - vc032x: restore values of sensor poxxxx reg 20
# gspca - vc032x: compile option no_poxxx
#3: gspca - vc032x: remove vc321_reset
# gspca - vc032x: Add 160x120 for sensor poxxxx
# gspca - vc032x: change value of sensor reg 20 of poxxxx
# gspca - vc032x: rearrange the start sequences of poxxxx
# gspca - vc032x: option double start for poxxxx
# (removed)
# gspca - zc3xx: check the mi360soc sensor ID after start
#2: gspca - vc032x: remove the new values of ms-win poxxxxx
# gspca - vc032x: Bad settings of req 87 and 88.
#1: gspca - zc3xx: Add the reset_resume function.
# gspca - zc3xx: Display Micron sensor ID.
#0: gspca - vc032x: Initialize critical registers at probe time.
# The associated sequence was removed some time ago.
# It is useful for integrated webcams.
# (removed)
# 2.9
#52: gspca - vc032x: Add the reset_resume function.
#51: gspca - vc032x: always full start and full stop (b300 & b003)
#50: gspca - vc032x: fix the first backlight exchange
# gspca - vc032x: add POXXX_TEST_1 and 2 for 30s problem
#49: gspca - vc032x: remove some previous discrete values from new ms-win driver
#48: gspca - vc032x: Adjust exchanges of poxxxx from newer ms-win driver.
#47: gspca - vc032x: Don't stop the poxxxx webcams on close.
# gspca - vc032x: Add trace of USB exchanges
#46: gspca - vc032x: Check and set a main register at poxxxx connect time
# gspca - vc032x: Split the start exchanges of poxxxx
# The start exchange is splitted into two parts, and the first part
# is sent on cold start only.
# gspca - vc032x: Don't stop immediately the poxxxx webcams on close.
# The full stop of the webcam (for return to cold state) is
# done 30s after close.
# (not done)
# gspca - vc032x: remove 1280x1024 from poxxxx
#45 gspca - vc032x: Add 1280x1024 resolution for sensor poxxxx.
# (removed later)
#44: gspca - vc032x: Add some delays for poxxxx.
# gspca - pac7302/11: Change some initialization values.
# The new values are extracted from Pac7302.inf for 093a:2620
# version 1.0.0.19 07/04/30.
# - set back the EOF control in pkt_scan
#43 gspca - tp6800: define a color table for the sensor ovxxxx
#42 gspca - zc3xx: Adjust icm105a exchanges from ms-win driver.
# gspca - pac7302/11: Fix lack of end of image.
# It seems that the JPEG end of frame (ff d9) is not present
# or is not at the awaited place for some webcams.
# The problem was introduced by commit
# 327c4abf74a4426676df6c359b2a3dea2a5d126e
# (removed later)
#20: gspca - tp6800: change ovxxxx_r from ms-win driver
# add sharpness control
# small changes in init / start
# other gamma table for ovxxxx
#19: gspca - tp6800: change ovxxxx_r
#17: gspca - tp6800: adjust ovxxxx init (gamma)
#15: gspca - tp6800: fix a bug in bulk write
#12: gspca - tp6800: Add the sensor ovxxxx
# gspca - tp6800: New subdriver
# 7: gspca - tasc: bug in sd_start
# 6: gspca - tasc: New subdriver.

KVER=$(shell uname -r)
KSRC=/lib/modules/$(KVER)/build
KGSPCADIR=/lib/modules/$(KVER)/kernel/drivers/media/video/gspca

all: modules

modules:
$(MAKE) -C $(KSRC) M=$(PWD)/build modules

gspca_%::
$(MAKE) -C $(KSRC) M=$(PWD)/build gspca_main.ko $@

install:
rm -f $(KGSPCADIR)/gspca*.ko $(KGSPCADIR)/*/gspca*.ko; \
install -c -m 0644 build/*.ko $(KGSPCADIR)/; \
depmod

# local development
dist:
ln -s . gspca-$(VERSION); \
files=`ls gspca-$(VERSION)/build/*.c | fgrep -v .mod.c`; \
tar -zcvf gspca-$(VERSION).tar.gz \
gspca-$(VERSION)/Makefile \
gspca-$(VERSION)/README \
gspca-$(VERSION)/build/Makefile \
gspca-$(VERSION)/build/gspca.h.orig \
gspca-$(VERSION)/build/*.h \
$$files; \
rm gspca-$(VERSION)
.PHONY: dist driver install update modules


I presume this is because I perhaps dont have a compiling dev's toolchain, or dev environment setup on
my Pandora? If that's the case, can someone tell me how to set one up, or rather which guide around here
to follow i.e Stuckies' for PND'ing angstrom apps, or Mcobits' for PND'ing games up etc?

Is that the piece of the puzzle I am lacking that will allow me to install these drivers? Or am I
barking wildly up the wrong tree.

Anyway...

These drivers and install commands are also listed here http://thierr26.free.fr/debian-on-d410e.php#sect11 but it appears to refer to x86 based Linux installs ( http://packages.debian.org/en/lenny/gspca-modules-2.6-686 ) not to mention Lenny and Debian, so I haven't attempted that in case I mess something up.

So returning to these boards, I scoured all the webcam related posts, the most useful being this one

http://www.gp32x.de/board/index.php?/topic/56098-using-a-webcam-with-mplayer/page__hl__webcam

and I have tried all the terminal commands listed therein.

All return the same "dev/video0 does not exist" type messages which I believe are related to no proper gspca driver being installed at present. Correct?

If anyone can shed any light on how to install these drivers and get :

a) the webcam working and how to record via it.

B) possibly the usb storage working (so you can access the files it records (unless you can stick them
direct to the Pandora's SD cards) or use its micro SD as additional space)

c) How to test its current draw and if it is indeed either charging, or simply being powered by the Pandora.

I would be very grateful.

I've tried to do as much of the groundwork as I can, as a linux noob but have little time amid my newborn and other kids to get further without some help :)

edited: to add spoilers via Pandora
 
Last edited by a moderator:
Back
Top