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?
In
/etc/pulse/default.pa
comment out module-switch-on-port-available:Then restart.
You must deactivate all modules that start with
module-switch-on-*
in pulse audio service if you want to disable this behavior also with bluetooth and USB devices.Ubuntu 18.04 and 20.04 LTS, for example:
module-switch-on-port-available
module-switch-on-connect
In a single instruction:
Then kill pulse audio or reboot:
Yes, Witek's answer worked for me. I am new to Ubuntu (Xubuntu) so I didn't even know how to even comment out a line. So for people like me, here's a more detailed answer:
Go to your file manager and click "file system". Then find
/etc/pulse/default.pa
Open that file using any text editor.
Putting a hash symbol
#
in front of a line of code is how you comment out a line. Put a hash in front of the line that reads:When you click save, it will ask for your admin password. Enter it, restart and you're done.