Thursday, June 7, 2007

Fixing TV Card and WebCam culpirts.

A number of software packages, including OpenWengo or linphone, will usually insist on using /dev/video0 as the device from which they acquire pictures. This might turn into a problem if your hardware also has a PCI based TV card. Indeed, the TV card would then automatically turn into video0 while the webcam will be video1, a behaviour that you do not which to have.

The solution is a mixture of this tutorial and this blog entry. What I did was finding out the vendor/product of the webcam via lsusb and finding the vendor and device of the TV card via udevinfo -a -p /sys/class/video4linux/video0. I ended up with the following content for a (new) file called 35-perso.rules in /etc/udev/rules.d/:

KERNEL=="video[0-9]*", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="08ad", BUS=="usb", NAME="v4l/video0", SYMLINK="video0"
KERNEL=="video[0-9]*", SYSFS{vendor}=="0x1131", SYSFS{device}=="0x7134", BUS=="pci", NAME="v4l/video1", SYMLINK="video1"


Note that the NAME directive is mandatory for this to work properly, otherwise you'll still have video1 and video0 crossed.

No comments: