pulseaudio – Alsa does not correctly detect the front panel audio jack under Ubuntu 16.04

I often switch between my headphones and my speakers and here is the usual behavior supposed:

  • If I unplug my headphones connected to the front panel, the audio output will automatically switch to the speakers connected to the rear panel.
  • If I reconnect my headphones on the front panel, the speakers connected to the rear panel will automatically turn off and the sound will play. The volume profile will also change.

I think these are the default settings because I have no problem with 2 other computers with almost the same setups.

This problem occurred after suspending my computer, which is probably not due to a system update.

What is happening now is:

  • Unplugging everything connected to my front panel will not mute my computer.
    speakers whatever.
  • The only way to make my headphones work is to change output
    device to "headset" in Pulseaudio volume control. Even if she
    as unplugged, I always get an audio output. This
    has been tested with different devices.

enter the description of the image here

Then I would receive an audio output of both my speakers and my headphones. The automatic mute option in alsamixer does nothing. I've tried using the gnome version and it pulls a
** (gnome-alsamixer: 12461): WARNING **: gam_toggle_set_state (). No idea what to do for the mixing element "Auto mute mode"!

Fault. I tried to restart, reinstall Alsa and Pulseaudio, but the problem persisted.