# Logitech QuickCam 046d:08da & 046d:0870 [SOLVED]

## HeXiLeD

This is an old camera that i use as security cam and its has been working with thh driver package qc-usb, now removed from portage due to kernel built in driver support.

Hardware info:

```
Bus 006 Device 003: ID  046d:0870 Logitech, Inc. QuickCam Exp
```

Support:

```
stv06xx      046d:0870   Dexxa WebCam USB
```

Reference: http://www.kernel.org/doc/Documentation/video4linux/gspca.txt

Matching driver kernel driver:

gspca_stv06xx

And compiled as module:

```
# lsmod | grep gspca_stv06xx

gspca_stv06xx          19664  0

# lsmod | grep quickcam

quickcam               59936  0

```

Working problems:

-Camorama is only able to get a black video with scratched blinking lines across and reporting 82 fps !!

-amsn gets a black video input and freezes

-skype gets nothing. even the square where the video should be does grey (same colour as skype GUI)

-ekiga crashes 

-linphone-3 gets a black screen video 

and mplayer ... reports that the driver should be use only with v4l2 and not v4l

$ mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=yv12:device=/dev/video1

```
MPlayer SVN-r29796-4.3.4 (C) 2000-2009 MPlayer Team

Playing tv://.

TV file format detected.

Selected driver: v4l2

 name: Video 4 Linux 2 input

 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>

 comment: first try, more to come ;-)

Selected device: Camera

 Capabilites:  video capture  read/write  streaming

 supported norms:

 inputs: 0 = STV06xx;

 Current input: 0

 Current format: unknown (0x31384142)

tv.c: norm_from_string(pal): Bogus norm parameter, setting default.

v4l2: ioctl enum norm failed: Invalid argument

Error: Cannot set norm!

Selected input hasn't got a tuner!

v4l2: Cannot get fps

v4l2: ioctl request buffers failed: Device or resource busy

v4l2: ioctl set mute failed: Invalid argument

v4l2: 0 frames successfully processed, 0 frames dropped.

```

```
Selected input hasn't got a tuner!
```

 ???

$ mplayer tv:// -tv driver=v4l2:width=352:height=292:outfmt=yv12:device=/dev/video1

```
MPlayer SVN-r29796-4.3.4 (C) 2000-2009 MPlayer Team

Playing tv://.

TV file format detected.

Selected driver: v4l2

 name: Video 4 Linux 2 input

 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>

 comment: first try, more to come ;-)

Selected device: Camera

 Capabilites:  video capture  read/write  streaming

 supported norms:

 inputs: 0 = STV06xx;

 Current input: 0

 Current format: unknown (0x31384142)

tv.c: norm_from_string(pal): Bogus norm parameter, setting default.

v4l2: ioctl enum norm failed: Invalid argument

Error: Cannot set norm!

Selected input hasn't got a tuner!

v4l2: Cannot get fps

v4l2: ioctl set mute failed: Invalid argument

v4l2: ioctl query control failed: Invalid argument

v4l2: ioctl query control failed: Invalid argument

v4l2: ioctl query control failed: Invalid argument

v4l2: ioctl query control failed: Invalid argument

==========================================================================

Cannot find codec matching selected -vo and video format 0x31384142.

==========================================================================

v4l2: ioctl set mute failed: Invalid argument

v4l2: 0 frames successfully processed, 0 frames dropped.

Exiting... (End of file)
```

And with v4l:

$ mplayer tv:// -tv driver=v4l:width=352:height=292:outfmt=yv12:device=/dev/video1

```
MPlayer SVN-r29796-4.3.4 (C) 2000-2009 MPlayer Team

Playing tv://.

TV file format detected.

Selected driver: v4l

 name: Video 4 Linux input

 author: Alex Beregszaszi

 comment: under development

=================================================================

 WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!

 As the V4L1 compatibility layer is broken, this may not work.

 If you encounter any problems, use driver=v4l2 instead.

 Bugreports on driver=v4l with v4l2 drivers will be ignored.

=================================================================

Selected device: Camera

 Capabilites: capture 

 Device type: 1

 Supported sizes: 48x32 => 352x292

 Inputs: 1

  0: STV06xx:  (tuner:0, norm:pal)

Using input 'STV06xx'

tv.c: norm_from_string(pal): Bogus norm parameter, setting default.

Unknown norm!

Error: Cannot set norm!

Selected input hasn't got a tuner!

FPS not specified in the header or invalid, use the -fps option.

No stream found.

```

notes: 

$ mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=yv12:device=/dev/video2 works flawlessly for my other webcam

# dmesg

```

usb 6-1: new full speed USB device using uhci_hcd and address 4

usb 6-1: New USB device found, idVendor=046d, idProduct=0870

usb 6-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0

usb 6-1: Product: Camera

usb 6-1: configuration #1 chosen from 1 choice

STV06xx: Probing for a stv06xx device

gspca: probing 046d:0870

STV06xx: Configuring camera

STV06xx: HDCS-1020 sensor detected

STV06xx: Initializing camera

gspca: probe ok
```

Question:

Are we getting the qc-usb ebuild back or ... whats the other option ? wget & Manual compile it ?

http://www.quickcamteam.net/devices/non-uvc-webcams

http://www.quickcamteam.net/software/linux/drivers/quickcam-usb-driver

----------

## keyson

Hi,

If you look at the warning when running mplayer:

 *Quote:*   

> 
> 
> =================================================================
> 
>  WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!
> ...

 

So to solve this you need to follow the directions in the http://en.gentoo-wiki.com/wiki/Webcam#Libraries .

How to use it is described on the same page.

 *Quote:*   

> 
> 
> You might need to install media-libs/libv4l and run "LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so application" in order to make some programs which only work with v4l1 work on v4l2. Remember also to emerge those applications with the v4l v4l2 flag.
> 
> 

 

Homepage for libv4l http://hansdegoede.livejournal.com/3636.html

So emerge libv4l and test.

----------

## HeXiLeD

Ok so i took a look at this documentation and i already had all of this except  media-tv/xawtv.

So lets review:

 *Quote:*   

> If you are using udev there should now be a device file in /dev/v4l/ called video0 (or video1, video2 or video3, for that matter). If the device is not created, check dmesg for errors and useful messages.

 

```
 # ls /dev/v4l/

by-id  by-path

 # ls /dev/v4l/by-path/

pci-0000:00:1d.0-video-index0  pci-0000:00:1d.7-usb-0:4:1.0-video-index0

 # ls /dev/v4l/by-id/

usb-046d_0990_6CB3DD11-video-index0

# ls /dev/ | grep video

video0

video1

video1394
```

Note: by ID it shows only one video device while by path it shows 2. Why ?

Video0 = 046d:0870 Logitech, Inc. QuickCam Exp

```
 # emerge -pv  media-tv/xawtv

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] media-tv/xawtv-3.95-r2  USE="X -aalib alsa dv -lirc (-mmx) -motif -nls opengl quicktime -xext -xv -zvbi" 0 kB
```

# v4l-info 

```
### v4l2 device info [/dev/video0] ###

general info

    VIDIOC_QUERYCAP

        driver                  : "STV06xx"

        card                    : "Camera"

        bus_info                : "usb-0000:00:1d.0-1"

        version                 : 2.5.0

        capabilities            : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

standards

inputs

    VIDIOC_ENUMINPUT(0)

        index                   : 0

        name                    : "STV06xx"

        type                    : CAMERA

        audioset                : 0

        tuner                   : 0

        std                     : 0x0 []

        status                  : 0x0 []

video capture

    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)

        index                   : 0

        type                    : VIDEO_CAPTURE

        flags                   : 0

        description             : "BA81"

        pixelformat             : 0x31384142 [BA81]

    VIDIOC_G_FMT(VIDEO_CAPTURE)

        type                    : VIDEO_CAPTURE

        fmt.pix.width           : 352

        fmt.pix.height          : 292

        fmt.pix.pixelformat     : 0x31384142 [BA81]

        fmt.pix.field           : NONE

        fmt.pix.bytesperline    : 352

        fmt.pix.sizeimage       : 102784

        fmt.pix.colorspace      : SRGB

        fmt.pix.priv            : 1

controls

### video4linux device info [/dev/video0] ###

general info

    VIDIOCGCAP

        name                    : "Camera"

        type                    : 0x1 [CAPTURE]

        channels                : 1

        audios                  : 0

        maxwidth                : 352

        maxheight               : 292

        minwidth                : 48

        minheight               : 32

channels

    VIDIOCGCHAN(0)

        channel                 : 0

        name                    : "STV06xx"

        tuners                  : 0

        flags                   : 0x0 []

        type                    : CAMERA

        norm                    : 0

tuner

ioctl VIDIOCGTUNER: Invalid argument

audio

    VIDIOCGAUDIO

        audio                   : 0

        volume                  : 0

        bass                    : 0

        treble                  : 0

picture

    VIDIOCGPICT

        brightness              : 0

        hue                     : 0

        colour                  : 0

        contrast                : 0

        whiteness               : 0

        depth                   : 8

        palette                 : unknown

buffer

ioctl VIDIOCGFBUF: Invalid argument

window

    VIDIOCGWIN

        x                       : 0

        y                       : 0

        width                   : 352

        height                  : 292

        chromakey               : 0

        flags                   : 0
```

 *Quote:*   

> Remember to have mplayer compiled with dvb and v4l and/or v4l2

 

```
 media-video/mplayer-1.0_rc4_p20091026-r1  USE="3dnow -3dnowext X a52 aac aalib alsa (-altivec) -amr ass -bidi -bindist -bl -bs2b -cddb -cdio cdparanoia -cpudetection -custom-cpuopts -debug dga dirac directfb -doc dts dv dvb dvd dvdnav -dxr3 -enca encode esd faac faad fbcon ftp -ggi gif -gmplayer iconv -ipv6 jack -joystick jpeg -ladspa libcaca -lirc live -lzo mad md5sum mmx -mmxext -mng mp3 -nas network -nut openal opengl osdmenu oss png -pnm -pulseaudio pvr quicktime radio rar real -rtc samba schroedinger sdl shm speex sse sse2 -ssse3 (-svga) teletext -tga -theora toolame tremor truetype twolame unicode v4l v4l2 -vdpau (-vidix) vorbis (-win32codecs) x264 -xanim -xinerama xscreensaver xv xvid xvmc -zoran" VIDEO_CARDS="-mga nvidia -s3virge -tdfx
```

 *Quote:*   

> You might need to install media-libs/libv4l and run "LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so application" in order to make some programs which only work with v4l1 work on v4l2. Remember also to emerge those applications with the v4l v4l2 flag.

 

```
# emerge -pv media-libs/libv4l

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] media-libs/libv4l-0.6.1  0 kB
```

There are no v4l v4l2 flags for this package. But i do have v4l and vl42 in make.conf

```
 $ ls /usr/lib/libv4l/v4l1compat.so

/usr/lib/libv4l/v4l1compat.so
```

Best result was with mplayer:

```
$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so mplayer tv:// -tv driver=v4l:width=352:height=292:device=/dev/video0 -fps 15
```

Which provided a black video output during a very sunny day.

Moving to the second recommended URL.

I didnt understand the information of the one very well but lets see.

 *Quote:*   

> Just replace open("dev/video0", ...) with v4l2_open("dev/video0", ...), ioctl with v4l2_ioctl, etc. libv4l2 will then do conversion of any known (webcam) pixelformats to bgr24 or yuv420.

 

Replace it where ? 

The only terminal command options i have are:

```
v4l-conf  v4lctl    v4l-inf
```

But even so i tried. I take it that i skiped something...

```
$ export LD_LIBRARY_PATH=`pwd`/lib

$ export LD_PRELOAD=`pwd`/lib/v4l1compat.so

$ camorama

ERROR: ld.so: object '/home/user/lib/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.
```

*scratches head*   :Confused: 

----------

## keyson

OK,

What is the output if you start xawtv in a console inside X.

 *Quote:*   

> 
> 
> Ex:
> 
> $ xawtv
> ...

 

[/quote]

----------

## HeXiLeD

```
$ xawtv

This is xawtv-3.95, running on Linux/x86_64 (2.6.30.3)

WARNING: v4l-conf is compiled without DGA support.

/dev/video0 [v4l2]: no overlay support

v4l-conf had some trouble, trying to continue anyway

Warning: Missing charsets in String to FontSet conversion

Warning: Cannot convert string "-*-ledfixed-medium-r-*--39-*-*-*-c-*-*-*" to type FontStruct

Warning: Missing charsets in String to FontSet conversion

Warning: Missing charsets in String to FontSet conversion
```

then  i closed it

no way to get: 384x288 32 bit TrueColor (LE: bgr-)

----------

## keyson

OK.

The driver loads OK. But the stream is not read.

I have looked around and found that when they changed it

to v4l2 and incorporated it into the kernel, they have had

some problems regarding support of all sensors.

And the HDCS-1020 that you have in the cam seems to be one of them.

Changes have been made and the driver is up to 2.8.0 now in the kernel (what I can see).

Maybe a later kernel then 2.6.30.3 would work.

/Regards

----------

## HeXiLeD

A quick update about this issue that might help other people.

While trying to fix this problem i also got my hands on another system that also had the same problem with another logitech quickcam:

```
Bus 002 Device 003: ID 046d:08da Logitech, Inc. QuickCam Messanger
```

The kernel driver for this cam should be compiled as module and it's name is gspca_zc3xx which requires gspca_main

```
ZC3XX USB Camera Driver
```

This cam was working with mplayer and amsn without any extra parameters (by default) but not with other applications such as skype, linphone-3, camorama.

In other so work with skype the following, needs to be done on the command line:

```
export LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so 

exec /opt/skype/skype "$@"
```

After this; skype worked fine for video but not for audio. The webcam is able to capture sound but the person receiving it; receives a very slow "motion" "darth vader" death voice sound. (we decided to use another microphone).

Putting the above code as an executable to make things easier:

```
 $ nano -w skype-start.sh

export LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so ; exec /opt/skype/skype "$@" & 
```

Save, exit and make it executable:

```
$ chmod +x skype-start.sh 
```

Start it:

```
./skype-start.sh
```

1 webcam fixed... 1 still to go

----------

## HeXiLeD

So finally some closure for 046d:0870 Logitech, Inc. QuickCam Exp

I tried a couple kernels (vanilla) and had some results

With vanilla-sources 2.6.34-rc6  i was able to start camorama the first time and have the webcam working perfectly for the first time and without any extra cmd line parameters. However that only happened one time. After that not even with extra parameters.

Worked only with:

$ camorama -d /dev/video1

Since i had other issues with that kernel i downgraded to 2.6.32.9 and after a couple tries i got it to work.

If i just try to use the cam like the above example; i get some green video image mixed with the real image.

Doing it like this works:

```
$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so mplayer tv:// -tv driver=v4l:width=352:height=292:device=/dev/video1 -fps 30
```

```
$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so camorama -d /dev/video1
```

```
# dmesg

STV06xx: Probing for a stv06xx device

gspca: probing 046d:0870

STV06xx: Configuring camera

STV06xx: HDCS-1020 sensor detected

STV06xx: Initializing camera

gspca: probe ok

gspca: usb_submit_urb alt 1 err -28

gspca: no transfer endpoint found
```

Problem is SOLVED

EDIT:

Webcams  For Linux

----------

