PDA

View Full Version : How to assign your webcam consistently to /dev/video0 if you have a Hauppauge TV card



dcharlespyle
18th June 2013, 08:47 PM
Udev rules set up for this purpose do not always work due to Fedora's parallel loading of driver modules. I found multiple times that if the cx18 module loaded first the udev rule assigning /dev/video0 to the webcam did not work. The same was the case when trying to assign it to /dev/video1 whenever the uvcvideo module loaded first. This resulted in the devices being switched randomly during reboots. Since certain applications expect the webcam to be at /dev/video0 and will crash otherwise without specifying on the command line or in a desktop file, following is what needs to be done (at least for now) in order to keep that from happening.

1. Create a udev rules file (name it 00-webcam.rules so it loads first) for your webcam and put it in the /etc/udev/rules.d directory.

2. Make sure the following text, or something like it to match your device (mine is a Logitech C910 HD webcam, device id 046d:0821), in the file on a single line:


SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0821", NAME:="video0"

3. Create a file videodevices.conf in the /etc/modprobe.d directory.

4. Save the following contents in the file on a single line:


install cx18 /sbin/modprobe uvcvideo; /sbin/modprobe --ignore-install cx18

5. Reboot.

That's it! So far, it seems to be working every reboot thus far. I have been rebooting about two dozen times before posting this. Hopefully, it will continue to work and hopefully it will work for others who have long been looking for a solution to the long-standing problem of conflicts between the cx18 and uvcvideo modules with Hauppauge TV tuner cards and various webcams.