domenica 3 gennaio 2010

Getting Logitech Quickcam Express USB webcam to work with Skype on Ubuntu Karmic 9.10

This cheap webcam is a real drama. It never worked on Ubuntu. Now something changed. As you can read here,
"Linux kernel offers an API to access a wide variety of video (input mostly) devices through the video4linux API...[CUT] Currently the v4l API is strictly a userspace <-> kernelspace API, so there are no further support libraries for applications to access v4l devices. This means that applications need to support reading the frame data from the video device in a variety of video formats and then converting it to a video format suitable for their own use."
Logitech Quickcam Express USB webcam uses the gspca driver.
"The out of kernel gspca usb webcam driver framework solved the video format problem by doing conversion from hardware specific compression formats (usb 1.1 bandwidth is too low to carry raw frames at a decent framerate) to generic formats as supported by most applications in the kernel. With the merging of the gspca driver into the mainline kernel, this conversion has been removed from gspca as video format conversion clearly does not belong in the kernel."
Ok, let's get started. If you want to use your cheap webcam with Skype, you have to follow these directions:
  1. Run a terminal and type: bash -c 'export LD_PRELOAD=/usr/lib/libv4l/; skype'
  2. Go to Options --> Video devices, select your camera (/dev/video0 for me) and click "Test"
If it works, you can create a script in /usr/local/bin:

export LD_PRELOAD=/usr/lib/libv4l/

Call it runSkype, make it executable and add it to the startup applications.
As said before, the v4l API is strictly an userspace, so if you want to switch from an user to another, Skype will not work properly for the new user. Probably you'll need to unplug your webcam and plug it again but I have never tested this fix. Otherwise you won't have problems.