Automatically select headphones when plugged in
- by Joachim Pileborg
When I plug headphones into my desktop computer, they are not automatically selected for output, instead all sound still goes through my S/PDIF output to the stereo.
The headphones alternative is added in the sound settings, and I have to manually select it as output device.
$ cat /proc/asound/pcm
00-00: ALC898 Analog : ALC898 Analog : playback 1 : capture 1
00-01: ALC898 Digital : ALC898 Digital : playback 1
00-02: ALC898 Analog : ALC898 Analog : capture 2
I have done a Google search, as well as search askubuntu.com, but none of the answers in the hits I found seems to help.
Also, after listening with the headphones and then unplug them, the previous output is not automatically selected, so I have no sound at all then. I have to manually select the correct output in the settings.