I'm using a laptop running Ubuntu 18.04 with one built-in webcam (integral to the monitor), and I'm attaching multiple other webcams.
I'd like to disable the built-in webcam only, and continue to allow for as many other cameras as I choose to connect. Is there an elegant way to do this in Ubuntu 18.04?
All the current info I can find on this topic suggests sudo modprobe -r uvcvideo
and sudo modprobe uvcvideo
to disable and enable webcams temporarily and editing /etc/modprobe.d/blacklist.conf
to disable webcams persistently after a reboot, but both of these methods seem to turn on or off all webcams, not only the built-in webcam or a certain specified webcam.
There is indeed a rather elegant solution. Instead of telling the driver to ignore the device, you tell the system to ignore the device.
As internal webcams are normally detected as a USB device, you can add an 'udev rule' that will disable the device at boot.
Example: In my case the internal webcam of my chromebook is listed as following with lsusb:
With this information we can now add an 'udev rule' to /etc/udev/rules.d
We add the following line and specify the idVendor and idProduct values using the values we got from the 'lsusb' command. As showed before my values are '1bcf:2c67'
Save the the file with 'ctrl+x' 'y'. After a reboot your internal WebCam should be ignored by the system.