# Webcam works with mplayer, not with Cheese, Skype

## Progman3K

My webcam works OK with mplayer only.

Linux 2.6.32-gentoo-r2 x64

```
lsusb
```

 *Quote:*   

> Bus 006 Device 008: ID 0c45:6143 Microdia

 

```
lsmod
```

 *Quote:*   

> Module                  Size  Used by
> 
> gspca_sonixj           16554  0 
> 
> gspca_main             18143  1 gspca_sonixj

 

```
mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video1 -nosound
```

 *Quote:*   

> MPlayer SVN-r29796-4.3.2 (C) 2000-2009 MPlayer Team
> 
> Playing tv://.
> 
> TV file format detected.
> ...

 

```
dmesg
```

 *Quote:*   

> usb 6-1: new full speed USB device using uhci_hcd and address 8
> 
> usb 6-1: New USB device found, idVendor=0c45, idProduct=6143
> 
> usb 6-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
> ...

 

What do I have to do to get it to work with Cheese and Skype?

Thanks

----------

## Herring42

I know the cause of the problem: The kernel interface has changed to v4l2 (from v4l1).

Skype (being binary) hasn't yet got support for the new interface.

----------

## Progman3K

 *Herring42 wrote:*   

> I know the cause of the problem: The kernel interface has changed to v4l2 (from v4l1).
> 
> Skype (being binary) hasn't yet got support for the new interface.

 

If that was the case then Cheese should work, right?

I am running the very latest version - media-video/cheese-2.28.1-r1

Or is mplayer able to play camera video sources that are neither v4l1 nor v4l2?

Thanks for your help.

----------

## tuber

Could you please try 

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

 and 

```
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype
```

?

----------

## Progman3K

```
$ LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype
```

 *Quote:*   

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

 When I click the TEST (video) button, I get a white square.

```
$ LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype
```

 *Quote:*   

> ERROR: ld.so: object '/usr/lib/libv4l/v4l2convert.so' from LD_PRELOAD cannot be preloaded: ignored.

 When I click the TEST (video) button, I get a white square.

```
$ skype
```

 *Quote:*   

> 

 When I click the TEST (video) button, I get a green square with multicolored snow in it...

Thanks for the tip!

Do the preload error messages mean anything really bad?

----------

## boerKrelis

 *Progman3K wrote:*   

> 
> 
> Do the preload error messages mean anything really bad?
> 
> 

 

Yes. It tells you that something you specified to preload, can't be loaded. Could be permissions, but it's more likely that you don't have libv4l. Have you checked whether /usr/lib/libv4l exists at all? Depending on the outcome of that bit of research, you might want to install media-libs/libv4l .

----------

## Progman3K

 *boerKrelis wrote:*   

> Have you checked whether /usr/lib/libv4l exists at all? Depending on the outcome of that bit of research, you might want to install media-libs/libv4l .

 

It does:

```
$ ls -l /usr/lib/libv4l
```

 *Quote:*   

> total 20
> 
> -rwxr-xr-x 1 root root  5888 2009-12-20 11:52 v4l1compat.so
> 
> -rwxr-xr-x 1 root root 10080 2009-12-20 11:52 v4l2convert.so
> ...

 

Also, from the attributes, it appears that they CAN be executed by any user. Groups for my user:

wheel audio cdrom video games usb users portage plugdev vmware pulse-access qemu kvm vboxusers

I think the v4l libs DO get loaded when I invoke them, because the video test in Skype looks different with them (a white box) as opposed to when I just execute Skype without the v4l support (a green square with snow).

Thanks for the help.

----------

## boerKrelis

Isn't skype statically linked? Last time I ran it (~4 years ago or so) I think it was. Could that be the issue? libv4l is LGPL so legally it's possible.

----------

## Progman3K

 *boerKrelis wrote:*   

> Isn't skype statically linked? Last time I ran it (~4 years ago or so) I think it was. Could that be the issue? libv4l is LGPL so legally it's possible.

 

I've built it with the USE flag qt-static because originally if you did not do that it didn't run at all

Do you think that could be the problem? Hang on, let's try the tests with it built without that flag...

Nope, same result, same error messages too.

----------

## calebgray

I had similar troubles... until I...

```
$ emerge -av media-libs/libv4l
```

And ran...

```
$ LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype
```

Clicking "test" worked! Thanks so much for the help!

Also, the "/usr/bin/skype" is a script... I change the last line to the following so that I never had to think about it again.  :Very Happy: 

 *Quote:*   

> LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so ./skype "$@"

 

----------

## Herring42

 *calebgray wrote:*   

> 
> 
> ```
> $ LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype
> ```
> ...

 

Ahhh!!!!!

```

LD_PRELOAD=/usr/lib32/libv4l/v4l2convert.so skype

```

Using lib32 found the correct library, and I have a working camera!

Yay!

----------

## papapenguin

after many failed attempts with skype and my webcam,

 *Quote:*   

> LD_PRELOAD=/usr/lib32/libv4l/v4l2convert.so skype

 

fixed my video woes, now to get my built in microphones to work WITH webcam...   :Confused: 

----------

## crazymonito

I'm having this exact issue but with my Panasonic GS-35.  It shows up when I enter lsusb and it is even detecting whether it is in webcam mode or DV mode.

```
Bus 002 Device 005: ID 04da:231a Panasonic (Matsushita) NV-GS11/230/250 (DV mode)
```

Using mplayer shows video just fine (no sound though):

```
mplayer tv:// -tv driver=v4l2:device=/dev/video0

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 ;-)

v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.

Selected device: DVC

 Capabilites:  video capture  streaming

 supported norms:

 inputs: 0 = Camera; 1 = MTIT;

 Current input: 0

 Current format: unknown (0x64737664)

v4l2: ioctl set format failed: Invalid argument

v4l2: ioctl set format failed: Invalid argument

v4l2: ioctl set format failed: Invalid argument

v4l2: ioctl set format failed: Invalid argument

v4l2: ioctl set format failed: Invalid argument

v4l2: ioctl set format failed: Invalid argument

v4l2: ioctl set format failed: Invalid argument

v4l2: ioctl set format failed: Invalid argument

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

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

Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family

Unsupported PixelFormat -1

Selected video codec: [ffdv] vfm: ffmpeg (FFmpeg DV)

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

Audio: no sound

Starting playback...

v4l2: select timeout

Could not find matching colorspace - retrying with -vf scale...

Opening video filter: [scale]

Movie-Aspect is undefined - no prescaling applied.

SwScaler: reducing / aligning filtersize 1 -> 4

SwScaler: reducing / aligning filtersize 5 -> 4

SwScaler: reducing / aligning filtersize 1 -> 1

SwScaler: reducing / aligning filtersize 9 -> 8

[swscaler @ 0xb7b260]BICUBIC scaler, from yuv411p to yuv420p using MMX2

[swscaler @ 0xb7b260]using 4-tap MMX scaler for horizontal luminance scaling

[swscaler @ 0xb7b260]using 4-tap MMX scaler for horizontal chrominance scaling

[swscaler @ 0xb7b260]using 1-tap MMX "scaler" for vertical scaling (YV12 like)

[swscaler @ 0xb7b260]720x480 -> 720x480

VO: [xv] 720x480 => 720x480 Planar YV12 

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=66

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=71

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=72

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=68

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=68

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=70

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=66

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=65

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=65

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=70

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=67

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=65

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=69

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=66

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=67

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

[dvvideo @ 0xa978c0]AC EOB marker is absent pos=64

V:   0.0 159/159 ??% ??% ??,?% 0 0 

MPlayer interrupted by signal 2 in module: video_read_frame

v4l2: ioctl set mute failed: Invalid argument

v4l2: 160 frames successfully processed, 7 frames dropped.
```

If I try to test the camera with gstreamer-properties, it shows the device in 'Pipeline', but the test fails with an error that says:  *Quote:*   

> Video for Linux 2 (v4l2): Could not negotiate format

 

Here is what shows up in the terminal

```
gstreamer-properties-Message: Skipping unavailable plugin 'artsdsink'

gstreamer-properties-Message: Skipping unavailable plugin 'esdsink'

gstreamer-properties-Message: Skipping unavailable plugin 'osssink'

gstreamer-properties-Message: Skipping unavailable plugin 'pulsesink'

gstreamer-properties-Message: Skipping unavailable plugin 'glimagesink'

gstreamer-properties-Message: Skipping unavailable plugin 'sdlvideosink'

gstreamer-properties-Message: Skipping unavailable plugin 'v4lmjpegsrc'

gstreamer-properties-Message: Skipping unavailable plugin 'qcamsrc'

gstreamer-properties-Message: Skipping unavailable plugin 'esdmon'

gstreamer-properties-Message: Skipping unavailable plugin 'osssrc'

gstreamer-properties-Message: Skipping unavailable plugin 'pulsesrc'

(gstreamer-properties:4731): GStreamer-WARNING **: pad v4l2src1:src returned caps which are not a real subset of its template caps

gstreamer-properties-Message: Error running pipeline 'Video for Linux 2 (v4l2)': Could not negotiate format [gstbasesrc.c(2719): gst_base_src_start (): /GstPipeline:pipeline3/GstV4l2Src:v4l2src1:

Check your filtered caps, if any]

```

Both Cheese and Skype fail to show any video but it does look like the camera is being detected by them.  I tried the LD_PRELOAD trick for Skype but it just says that it could not be loaded and then ignores it.  Any help would definitely be appreciated as I'm all out of ideas.   :Confused: 

EDIT: I managed to figure it out.  I was doing the LD_PRELOAD from the wrong location and my camera's default resolution is too high for Gstreamer so it wouldn't show it.  Once I changed the location and set my camera to webcam mode, it worked fine.

----------

## Zivarah

I am having the same problem with my webcam: Microsoft LifeCam VX-1000

mplayer tv mode works fine, detects the camera and gives great output, however Skype cannot use the camera.

At first, Skype did not see the camera at all, then after adding functionality to the kernel (doh!) and recompiling, Skype sees /dev/video0 however seems unable to use it. Clicking "Test" in the video settings gets no response.

I have tried every preload mentioned in this post, including v4l and v4l2 in lib, lib32, and lib64.  [edit: lib points to lib64, doh, that was silly].  I'm relatively sure I didn't miss any, and all give the same error:

```
LD_PRELOAD=/usr/lib32/libv4l/v4l2convert.so skype

ERROR: ld.so: object '/usr/lib/libv4l/v4l2convert.so' from LD_PRELOAD cannot be preloaded: ignored.
```

I do have the libv4l package installed:

media-libs/libv4l version 0.6.1

Everyone else that has this problem with this webcam (and most webcams in general, it would appear) seemed to have success with the preloading.

Any ideas?

Thanks,

-Ziv

[EDIT]: I saw a post on the Ubuntu forums where someone fixed this by downgrading their nvidia driver from 195 to 173, so I tried this. Turns out my graphics card (EVGA GTX 260) isn't supported in the 173 driver so it looks like I may be out of luck, at least in that regard.Last edited by Zivarah on Mon Oct 18, 2010 8:37 pm; edited 1 time in total

----------

