I don't have a definitive answer here (and never experienced this behaviour myself), but in an effort to assist I did find this old
bug report while conducting a quick search. Anyway, it describes users experiencing similar behaviour, and has some potentially useful information including the use of 'hdajackretask' to disable auto-muting/switching of the headphone output. Read post #13 onwards. It might take some experimentation though.
You might find some pulseaudio logging via
Code:
journalctl -b |grep pulse
or watch in a terminal on the fly with
Code:
journalctl -f |grep pulse
I've read of another workaound involving removing (or commenting out) the following PA module from /etc/pulse/default.pa
Code:
load-module module-switch-on-port-available
but this just apparently helps with the symptoms, not the switching (if that's what is occurring). Here's one example of that...
https://bbs.archlinux.org/viewtopic.php?id=147225