When I log in to Ubuntu, the audio output is set to whatever is in when I log in, and will not change whether or not I put in the headphones.
If I login with the headphones in, and pull the headphones out, there is no switch to speakers. Similarly, if I login with the headphones out, plugging in the headphones does nothing.
I can switch the audio output in sound preferences, but I would like the change to occur automatically.
A solution presented here Sound output doesn't change automatically after connecting to Bluetooth headset doesn't work.
How can I get the audio output to automatically switch when headphones are pulled out or in?