How can I assign a webcam to a specific /dev/video#?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How can I assign a webcam to a specific /dev/video#?
Here's the situation. I have a MythTV box with 2 pci capture devices and a usb web cam I plug in every now and then. The problem happens if I leave the webcam plugged in and reboot. It assigns the webcam as /dev/video0 and the 2 capture cards as 1 and 2, which messes up MythTV. Is there a way to set the assignment of the USB device to say 3 or 4 so it won't mix up my devices if I have it plugged in or not?
Please post your solution (when you have it) as I am sure other people will be interested to read how you went about writing your rule, deciding where to put it, and how you tested it.
You could even send Daniel Drake (who wrote "Writing udev rules") a link to your post here in case he'd like to include it in his list of examples.
In my situation I did an lsusb and got this output:
Code:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 004: ID 03f0:020c Hewlett-Packard Multimedia Keyboard
Bus 002 Device 003: ID 03f0:010c Hewlett-Packard Multimedia Keyboard Hub
Bus 002 Device 002: ID 045e:0039 Microsoft Corp. IntelliMouse Optical
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Now that I found my ID for my Logitech Webcam, I created a udev rule at
Good.
You got it working.
But better:
You did your own research, followed simple advice (I just pointed you at udev), but you not only found the solution on your own but then explained how, and gave good links, so others will hopefully find their solution from this thread, hopefully without having to ask anything further at all.
If your two capture cards ever start swapping their /dev/names you will now know what to do to lock them into their right places.
Happy MythTV (I gave up on that a few years ago, maybe it's time for another try. Linux gets better by the month )
Congratulations, and thanks for the follow-up.
Have fun with linux.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.