21

I list sources and sinks as follows:

pactl list sources
pactl list sinks

The output I get is:

...
    Ports:
        analog-input-internal-mic: Internal Microphone (priority: 8900)
        analog-input-headphone-mic: Microphone (priority: 8700)
        analog-input-headset-mic: Headset Microphone (priority: 8800)
...
    Ports:
        analog-output-speaker: Speakers (priority: 10000)
        analog-output-headphones: Headphones (priority: 9000, available)

How do I change the priorities listed above and have them fixed at what I change them to? Note that I am not looking to set a default source and sink or to delete unwanted sources or sinks, I just want to be able to assign them different priorities.

mcarans
  • 1,225

2 Answers2

13

First, use the following command to see the list of cards and ports:

pactl list sinks

Then, run (change out the filename to correspond to the port you want to modify (list the files in the paths/ folder to see which ones there are)):

sudo vim /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf

to modify the priority (that value is multiplied by 100).

Ken
  • 146
1

I had to enable some obscure setting in the UI (?) in order to actually automatically switch between ports, HDMI vs. internal audio in my case. Without the setting, it won't switch the ports regardless of their priorities.

Perhaps it is module-switch-on-connect

I think the following answer is relevant: https://askubuntu.com/a/158250/480388

alamar
  • 113