Ubuntu – How to get sound on headphones without switching back to ‘Speakers’ manually

12.04alsaheadphonesrealtek

On my Notebook (with Realtek ALC269VB) the sound over speakers works well until I plugin the headphones, Speakes get muted as expected but no sound on headphones. I noticed that as soon as I plugin the headphones, Alsamixer, Ubuntu Sound Control and pavucontrol switched to 'Headphones' which have no effect (does not really exist). When I switch back to 'Speakers' everything is fine; I can control the sound of headphones. This is a kind of work-around (starting pavucontrol to switch from Headphones to Speakers) but not relly satisfying.

My complete sound configuration and a screenshot of Alsamixer.

You may notice that Alsamixer says 'Intel Cougarpoint HDMI' instead of 'Intel HDA Realtec ALC269VB' what it did two days ago. Anyway, I couldn't find any differences between it.

My question:

In order to easy the work-around: is there a command line option to switch to 'Speakers'?

Best Answer

Pulseaudio always tries to switch to a newly available audio port when it becomes available. To stop this we can edit our default.pa. This file is located in /etc/pulse (defining settings for all users) or in ~/.pulse (to override these settings for a single user). Just comment out this line to stop pulseaudio from switching ports as follows:

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

To take effect we need to restart pulseaudio server with pulseaudio -k (or restarting our session).

Whenever you edit the /etc/pulse/default.pa please make a backup first to be able to restore previous settings in case something goes wrong.

Related Question