webcam on Linux (Fedora) – issues with Skype

Install a webcam on Linux is kind of tricky. The problem is almost none of the manufacturer would provide the Linux driver when delivering their products. And again, the power of open source community would be the hero again. There are some different kinds of Linux webcam drivers which cover different range of the products. In this post, we will try to give a general guidance on how to choose a webcam, install and make it work. The real example happens here is Logitech WebCam c310 and Fedora 18 with kernel 3.8.1. May it help.

1. How to choose the webcam?
This link (https://wiki.archlinux.org/index.php/Webcam_Setup#Identify_your_webcam) lists different kinds of webcams supported by Linux based on different drivers. We will choose ‘Linux-UVC’ here, which is sort of popular and covers the most common fashion webcams. You could find the detailed products from the UVC web (http://www.ideasonboard.org/uvc/). Then I have bought Logitech WebCam c310.

[root@daveti ~]# lsmod | grep uvc
uvcvideo               80924  0
videobuf2_vmalloc      13163  1 uvcvideo
videobuf2_core         38816  1 uvcvideo
videodev              120947  2 uvcvideo,videobuf2_core
media                  20444  2 uvcvideo,videodev

2. Install the uvc kernel module
Note that uvc kernel module (driver) is not necessarily contained in the Linux kernel. ‘lsmod | grep uvc’ to make sure you have the module enabled. Otherwise, please install it using your pkg manager, like yum in Fedora.

3. Make sure your WebCam is recognized when uvc is enabled
[root@daveti ~]# lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 002: ID 1058:1140 Western Digital Technologies, Inc. My Book Essential USB3.0
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 413c:2501 Dell Computer Corp.
Bus 002 Device 004: ID 0461:4d81 Primax Electronics, Ltd Dell N889 Optical Mouse
Bus 002 Device 005: ID 413c:2107 Dell Computer Corp.
Bus 002 Device 057: ID 046d:081b Logitech, Inc. Webcam C310

4. Install the WebCam applications
I have installed ‘Cheese’, ‘guvcview’ and ‘Video4Linux Control Panel’ (will cover the communication software later). Much more applications could be found at link (https://wiki.archlinux.org/index.php/Webcam_Setup#Get_software_to_use_your_webcam)

5. Skype/Pidgin
The interesting thing happened here is ‘Pidgin’ could make video calls after ‘Skype’ works (it seems both of them are based on old libv4l instead of using the uvc driver directly). So we will try to tweak our ‘Skype’ then. ‘Skype’ is different with other WebCam application, which could take advantage of the latest drivers, like uvc. ‘Skype’ is totally based on old Linux webcam driver lib – libv4l. More over, there is no 64-bit ‘Skype’ binary till now. Even you were running ‘Skype’ on 64-bit Linux, you were using the 32-bit ‘Skype’ and you would have to install 32-bit libv4l, like the one for fedora (http://rpm.pbone.net/index.php3/stat/4/idpl/20041050/dir/fedora_18/com/libv4l-0.8.8-3.fc18.i686.rpm.html). After that, we need to write a shell wrapper for calling ‘Skype’ in a way that will trigger the libv4l (only in this way, we could make video calls in ‘Skype’)

[root@daveti bin]# cat myskp
#!/usr/bin/bash

# Wrapper to call skype with v4l driver
# to enable the video ability
# 8 Mar, 2013
# daveti

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

There is a good link which gives much more info about this tweaking (http://community.linuxmint.com/tutorial/view/219)

6. No voice?
It would be much more frustrating if video works but voice not. Make sure to do 2 things for voice:
sudo yum reinstall pulseaudio alsa-plugins-pulseaudio pulseaudio-esound-compat pulseaudio-libs pulseaudio-libs-glib2 pulseaudio-module-zeroconf pulseaudio-libs-zeroconf xmms-pulse pulseaudio-module-gconf wine-pulseaudio xine-lib-pulseaudio pulseaudio-utils pulseaudio-module-bluetooth gst-mixer padevchooser paman paprefs pavucontrol pavumeter
System->Preferences->VolumeControl->Device: choose the USB device (ID is the one in ‘lsusb’) and make sure you have not mute the microphone.

About daveti

Interested in kernel hacking, compilers, machine learning and guitars.
This entry was posted in Linux Distro and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.