I've got a headset with a microphone, and a webcam with a built-in microphone too; I always want to use the headset microphone, but sometimes the OS or videoconferencing tools start up using the wrong one.

The good news is Linux will let you disable your webcam's microphone without disabling its video. I've done this successfully on Ubuntu 18.04

How it's done

We're going to do it with udev-based USB device blacklisting

First, we find the USB VID and PID ('vendor ID' and 'product ID') for the webcam:

$ lsusb
Bus 002 Device 002: ID 8087:8001 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 045e:0750 Microsoft Corp. Wired Keyboard 600
Bus 003 Device 009: ID 046d:0991 Logitech, Inc. QuickCam Pro for Notebooks
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

If it's not obvious from lsusb which device is your webcam, you can always hotplug and see which device disappears - and you can view lots of details of sound devices with udevadm info -a /dev/snd/by-id/*

We then create a new text file at /etc/udev/rules.d/90-blacklist-webcam-sound.rules containing the following udev rule:

# Disables webcam audio.
SUBSYSTEM=="usb", DRIVER=="snd-usb-audio", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0991", ATTR{authorized}="0"

Then reload the rules with sudo udevadm control --reload-rules unplug and replug your device - it should now appear as a camera but not a microphone.


10 April 2020

Tags · Home · Archive · Tags