How do I rename audio devices in Ubuntu?

Solution 1:

I found a solution instaling pavucontrol and enabling the module-device-manager.

Install pavucontrol:

sudo apt install pavucontrol

then enable module-device-manager:

pactl load-module module-device-manager

open pavucontrol:

pavucontrol

right-click on the "port" drop menu that you want to change name and rename it: example

rename it: rename

that should work.

Solution 2:

The device name in Gnome Control center (and pavucontrol too) can be changed with udev rules. There is an undocumented udev device attribute SOUND_DESCRIPTION which can be set to change the name.

That attribute is read in PulseAudio. PulseAudio stores its value to card's device.description property (as seen by pacmd list-cards). This property is also the value that Gnome's control center reads when displaying audio devices.

Now, assuming that those headsets are USB devices then first we need to find vendor and product IDs of the two headsets with command:

lsusb

Each device has id values in form of vendor-id:product-id.

Then create a new udev rule file:

sudoedit /lib/udev/rules.d/my-pulseaudio.rules

And add content:

ATTRS{idVendor}=="vendor-id-of-1st-device", ATTRS{idProduct}=="product-id-of-1st-device", ENV{SOUND_DESCRIPTION}="Foo Headset"
ATTRS{idVendor}=="vendor-id-of-2nd-device", ATTRS{idProduct}=="product-id-of-2nd-device", ENV{SOUND_DESCRIPTION}="Bar Headset"

Then reload udev rules and restart PulseAudio:

sudo udevadm control --reload-rules
sudo udevadm trigger -ssound
systemctl --user restart pulseaudio

Now the names should have changed in Gnome's control center.

Note, if the two headsets had same vendor and product IDs then we may end up just renaming both devices with same name. In that case the rules would need 3rd ATTRS{?}=="?" check to further differentiate them from each other. To find what other attributes the devices have use command:

udevadm info /dev/snd/by-id/*

Try to find an attribute that has a different value between the two headsets, e.g. serial number.