Ubuntu – How to prevent automatic change of the audio device

17.10gnomesettingssound

My Ubuntu 17.10 is connected via HDMI with my TV. HDMI ist the audio device I want always to use. Sometimes when the TV is turned off, Ubuntu switches the audio device tho semething else. When I turn on the TV again, I have to switch it back manually. How to prevent this automatic switching and set the audio device once and forever?

Best Answer

In /etc/pulse/default.pa comment out module-switch-on-port-available:

# load-module module-switch-on-port-available

Then restart.