How to fix Ubuntu Studio / XFCE not playing sound on headphones

This is just a quick note because I fixed a computer problem that had been bugging me for a while. I'm sure I saw someone else complaining about it online too, but when I Ecosiated¹ nothing much came up.

To fix it, open a terminal (this is Linux, after all), and type alsamixer. With all the different, overlapping sound configuration applications that come installed, I'd so far overlooked this one. Press f6 to choose your sound device if necessary. I found that my headphone output was both turned to 0 and muted, so I pressed the right arrow key to select it, used the up arrow to turn the volume up, and pressed M to unmute it. Further over to the right is the Auto Mute control, which sets whether the speakers turn off when you plug the headphones in. Press up and down to set it as you require. Escape to exit.

Alsamixer screenshot

The usual volume controls only expose the master volume, not the separate speaker and headphone levels. There are probably a dozen other ways to fix this issue with the various tools installed, but that's the one that worked for me.

¹ I have contacted Ecosia to ask what the correct verb is. If they reply, I'll let you know.