TV card Webcam冲突解决

电视卡与摄像头很容易冲突。比如你modprobe <电视卡> 再modprobe <摄像头> 他们可能会同占一个video device.
所以在这样的情况下我们需要重写udev. 这里有一篇好文章教给你怎样解决这类冲突,怎样重新编写udev. 点击这里浏览:Writing udev rules
这里有一篇已经写好的这个TIP:TIP How to use openwengo when you got a tv card


user@localhost ~ $ lsusb
Bus 002 Device 002: ID 046d:c01e Logitech, Inc. MX518 Optical Mouse
Bus 002 Device 001: ID 0000:0000 
Bus 001 Device 001: ID 0000:0000 
user@localhost ~ $


Files in /etc/udev/rules.d/ are parsed in lexical order, and in
some circumstances, the order in which rules are parsed is important.
In general, you want your own rules to be parsed before the defaults,
so I suggest you create a file at /etc/udev/rules.d/10-local.rules and write all your rules into this file.)原文里面有,他建议加一个10-local.rules在你的其他rules前面。


KERNEL=="video[0-9]*", BUS=="usb", SYSFS{idVendor}=="",
SYSFS{idProduct}=="", NAME="v4l/video0" , SYMLINK="video1" ,

只要把idVendor和idProduct对号就可以了。他们的编号就是, 创建一个group命令如下:

groupadd webcam
gpasswd -a webcam

USER 就是用户名。


udevcontrol reload_rules

这样webcam就更改完毕了。现在编写Tv Card规则。

udevinfo -a -p /sys/class/video4linux/<video card number> (用tab键看看你有几个video*,一般在video0,我的是在video0)

KERNEL=="video[0-9]*", BUS=="", SYSFS{device}=="", SYSFS{}=="", SYSFS{dev}=="", NAME="v4l/video0", SYMLINK="video0", GROUP="tv"


groupadd tv
gpasswd -a tv

udevcontrol reload_rules


Tvtime看电视的时候默认是video0, webcam使用camorama的时候添加参数
camorama -d /dev/video1

一切是那么自然 ………………….

Leave a Reply

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

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s