Quantcast
Channel: Jacob Hume - Fragmented Development
Viewing all articles
Browse latest Browse all 85

Disable devices with udev

$
0
0

Every piece of hardware I have seems to have its own built-in sound device. Thunderbolt docks, USB3 hubs... even HDMI and display port carry sound. On my laptop, I only want to use a few of them - but every time I connect another device, it becomes the default sound card.

This is most annoying with my Thunderbolt dock. I will never use this audio device, so I want to completely remove it. Aside from soldering, the next best approach I've found is udev rules!

First, we need to find the ID of the device using the lsusb command:

windigo@nyota | ~
→ lsusb
Bus 008 Device 002: ID 2188:0747 CalDigit Card Reader
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 002: ID 0c45:7692 Microdia USB Keyboard
Bus 005 Device 002: ID 2188:6533 CalDigit, Inc. CalDigit Thunderbolt 3 Audio
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04f2:b649 Chicony Electronics Co., Ltd Chicony USB2.0 Camera
Bus 001 Device 004: ID 8087:0aaa Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

If we read through the devices, I can spot the "CalDigit, Inc. CalDigit Thunderbolt 3 Audio" device that I'd like to remove. It's ID is 2188:6533.

The following udev rule will prevent a USB device with that ID from being authorized, and therefore won't take over my audio. I added it in a new rule file, /etc/udev/rules.d/10-no.dock.soundcards.rules:

SUBSYSTEM=="usb", ATTRS{idVendor}=="2188", ATTRS{idProduct}=="6533", ATTR{authorized}="0"

Viewing all articles
Browse latest Browse all 85

Latest Images

Trending Articles





Latest Images