This happens on an MSI GS72 laptop.
On Ubuntu (16.04), the audio works fine: I can plug my headphones in, out, and the sound will either play through the speakers or the headphones.
On Windows 10 (Home) however, with all the drivers up to date (Realtek 126.96.36.19996), the headphones simply won't take the lead. When I plug them in, the sound keeps playing through the speakers, and not through the headphones.
In the "playback devices" menu, I can see 2 devices:
Both devices show as "working fine" when opening their properties.
In "recording devices", I also have 2 devices:
When plugged to a TV via HDMI, the sound is correctly played by the TV and not the speakers. (currently cannot check what the output of "playback devices" is in that case)
I tried disabling various drivers and devices, launching "Realtek HD Audio Manager" (which doesn't open)... I am out of ideas on how to troubleshoot this.
Turns out the specific Realtek drivers provided on the MSI support website (which are presented as more recent than the official Realtek ones by a 6 months margin, so I did not bother to try the official ones) are to blame.
I downloaded the latest Realtek drivers (R2.79) from the official site, installed them and since then my headphones are correctly recognized.
Meanwhile, MSI's online support only advised me to install their equalizer software (Nahimic2) which does nothing more nor better than the default Realtek Manager. Horrible support on that part, MSI.