How to rename connected audio devices?

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
Post Reply
JackElliott
Level 1
Level 1
Posts: 30
Joined: Mon Nov 14, 2016 10:41 am

How to rename connected audio devices?

Post by JackElliott »

Hi, I have a couple of external USB devices for recording and playback, but they both use the same IC chip, so the Sound Settings applet in the panel shows them both with the same name. I'd like to assign "friendly" names to the devices. I'm running Pulseaudio and read here and there on the Internet that "paman" can be used for renaming. I'd like to try it, but cannot find a way to launch "paman." Or maybe there's another way to rename the devices. I'm running Mint 19.3 Cinnamon.

Thank you!
User avatar
MrEen
Level 20
Level 20
Posts: 11790
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to rename connected audio devices?

Post by MrEen »

Hi JackElliott,

I thought about this for a couple of days and I'm still not sure what the best method is to accomplish what you want, but this might work for you:

In the terminal run pacmd list-sinks (for the outputs) and pacmd list-sources (for the inputs). Just after the index numbers you see the sink/source names for each. You now need to determine which one is which on your own, but you can then run this command to alter the description of the sink:

Code: Select all

pacmd update-sink-proplist SINKNAME device.description="DESCRIPTION"
You use the long name from the first command that should be between <> brackets in place of SINKNAME, and your preferred name goes in place of DESCRIPTION. Lose or use the quotes for the description, and don't use any spaces. So use My_Card_#1 instead of My Card #1 for example. It's possible the spaces issue is fixed in your version of PulseAudio, but it's not on mine. Trying spaces with or without the quotes always produces this for me:

Code: Select all

Failed to parse proplist.
And the sources is almost the same:

Code: Select all

pacmd update-source-proplist SOURCENAME device.description="DESCRIPTION"
I believe that will change what you want changed.
JackElliott
Level 1
Level 1
Posts: 30
Joined: Mon Nov 14, 2016 10:41 am

Re: How to rename connected audio devices?

Post by JackElliott »

Thank you MrEen for your help!

My version of PulseAudio (11.1) also throws off the parse error when the new device.description name contains a space.

After running the update and confirming with

Code: Select all

pacmd list-sinks
that device.description now had the new name, I opened the Sound program and it did not did not display the new name for the Output (sink) device. I logged off and back on to restart PA and found that the "custom name" does not persist through logoff/logon. PA might poll the devices for their details at startup, and peripherals are likely going to be providing them. So maybe a configuration file or a shell script could work to keep settings.

Anyway, there are two other fields that a sink listing reveals which contain the same out-of-the-box default device.description string:

Code: Select all

alsa.card.name
and

Code: Select all

device.product.name
Those may or may not be modifiable, but I'll give them a try and see if maybe it's those fields that Sound and my audio programs are using when offering a choice of Pulseaudio output devices. Too tired tonight for that, will report back.
User avatar
MrEen
Level 20
Level 20
Posts: 11790
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to rename connected audio devices?

Post by MrEen »

Yes, what I gave you won't survive a reboot. I was hoping to confirm they accomplished what you were after, before giving you the way to make them "permanent" as such.

For permanentness (I like the sound of that), add the lines to bottom of /etc/pulse/default.pa but drop the pacmd prefix from each line.

You should be able to get away with running pulseaudio -k in the terminal to pick up the change without needing to reboot.

The way to edit the file is xed admin:///etc/pulse/default.pa in the terminal. Make the change, save and close the file, and ignore any warnings the terminal spits out.
User avatar
MrEen
Level 20
Level 20
Posts: 11790
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to rename connected audio devices?

Post by MrEen »

I figured out why we couldn't use spaces. Needed more quotes:

Code: Select all

pacmd 'update-sink-proplist alsa_output.pci-0000_00_14.2.analog-stereo device.description="My Card Eh" '
It should probably work fine in default.pa like this:

Code: Select all

update-sink-proplist alsa_output.pci-0000_00_14.2.analog-stereo device.description="My Card With Spaces In The Name"
Of course, you need to alter the SINKNAME for your case. And yes, I'm Canadian! (Although I live in the US.)
JackElliott
Level 1
Level 1
Posts: 30
Joined: Mon Nov 14, 2016 10:41 am

Re: How to rename connected audio devices?

Post by JackElliott »

Thank you, Mr Een.
"Perminosity" also seems to be an equally cromulent word. In my brief Googlage (!) I did find information about what a fellow can do with default.pa but didn't happen to stumble across such an option as you suggested, so thank you for showing that.

After having posted my question I switched out the two audio adapters (one used for source, one for sink) and replaced them with a single all-in-one unit. The two previous units were made by different manufacturers and one was source-only, the other was sink-only but because they both employed the same IC chip, they both showed up in pa with identical names. Not to mention that while the source-only device had no hardware for playback (being a microphone preamp) pa erroneously showed it as a playback device. Likewise, the sink device, a digital-to-audio converter, had no actual input circuitry, but, again, pa did not know that, so it erroneously showed it as a recording device. Such confusion! Thus my question about assigning useful names. But the all-in-one adapter solves the problem without me needing to tinker any more with pa's settings.

Even so, I thank you for your help!
User avatar
MrEen
Level 20
Level 20
Posts: 11790
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to rename connected audio devices?

Post by MrEen »

You're quite welcome! :D

I actually learned that command due to your question, so it was still a win in my book.
Post Reply

Return to “Sound, Multimedia, & Codecs”