Score:0

How do you have Ubuntu properly manage the audio output device currently in use?

cn flag

I am relatively new to Linux/Ubuntu and am having a very anoying problem that seams to have been around in Ubuntu for a long time based on the google results I got when researching but all solutions seem to be adhoc and half assed.

My PC has an internal audio device and is connected to my TV via HDMI. The PC is being used as an HTPC so it should typically be using the HDMI device when it is available.

My audio output device is set to HDMI on boot with a startup application command in the GUI.

When the TV is turned off or goes to sleep the audio device automatically switches the internal audio device. This is to be expected as the HDMI device no longer exists to the computer. When the TV is turned back on the audio device in use remains as the internal audio device and I must manually change the device back to hdmi in either the Ubuntu sound settings or in using pactl in the terminal or by restarting.

This problem is frustrating, very anoying and from my research has been a problem for years in multiple distributions.

Is there a way for to have Ubuntu (or a 3rd party application) automatically manage the audio output device based on a hierarchy of priority which is reassessed whenever an audio device is added or removed from the system?

I am looking for a simple and persistant solution that won't be undone or require user action on reboot.

Something like this should be available by default for Ubuntu desktop distributions and would be valuable for video output, audio output and audio input given that it is commonly used on laptops that frequently have devices added and removed.

Thanks for the help.

Sadaharu Wakisaka avatar
pl flag
Welcome to AskUbuntu, yes it does. https://askubuntu.com/questions/1154586/how-can-i-change-pulseaudio-port-priorities
cn flag
@Sadaharu. Thanks for the pointer. can you adivse if lower priority value = first selection ore is higher value = first selection?
Sadaharu Wakisaka avatar
pl flag
Higher = first and lowest = last.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.