I have a tuner card and a webcam. When I boot up these devices are detected and the entries in /dev are video0 and video1. The problem is that it switches the devices at boot. Each time I boot I never know which is video0 and which is video1. I have a launcher for VLC that opens the tuner card so that I can watch TV. I have guvcview to use the webcam. I have to modify the launcher for each to use the correct device almost every time I want to use them. Is there a way to lock these devices to a specific entry in /dev at boot?
Announcement
Collapse
No announcement yet.
Lock a device to a specific entry in /dev
Collapse
This topic is closed.
X
X
-
Re: Lock a device to a specific entry in /dev
I had the same problem and it irritated me enough that I gave the webcam on my desktop PC away and just use the one on my netbook
The only way I know is to write a udev rule but I have no experience there. This may help -
http://hackaday.com/2009/09/18/how-to-write-udev-rules/we see things not as they are, but as we are.
-- anais nin
- Top
- Bottom
-
Re: Lock a device to a specific entry in /dev
Originally posted by DetonateThat's a little over my head. I just came up with an easier solution. I'll just unplug the webcam, which is a USB device and leave it unplugged until I need it.we see things not as they are, but as we are.
-- anais nin
- Top
- Bottom
Comment
-
Re: Lock a device to a specific entry in /dev
I think all you need is to get the output from
udevadm info -a -p $(udevadm info -q path -n /dev/video0)
match the device to the vendor/product id from lsusb
and create your file /etc/udev/rules.d/50-usbcamera.rules and put something like:
Code:SUBSYSTEM=="video4linux", BUS=="usb", SYSFS{idVendor}=="XXXX", SYSFS{idProduct}=="XXXX", NAME="video0"
Shouldn't be too hard.
- Top
- Bottom
Comment
-
Re: Lock a device to a specific entry in /dev
I'll play around with that and see if I can get it to work. Once the first device is set, there should not be any need to set the second device should there? It would automatically grab the next number I think.
- Top
- Bottom
Comment
-
Re: Lock a device to a specific entry in /dev
Yeah, I think that's right. Can't hurt to try - you can always delete it if it doesn't work.
- Top
- Bottom
Comment
Comment