0

When I connect the headphones, I have to change the output port from the audio mixer, and do the reverse process by disconnecting them.

Could you help me, to make this happen automatically when you connect or disconnect the headphones, or make a shortcut so that it changes without having to do the whole process?

PD: I am using Ubuntu Studio 20.04 (focal fossa) with XFCE desktop environment

Shirubius
  • 21
  • 4
  • Please edit your question for Ubuntu Version, and perhaps a screenshot of your audio manager settings. Might be easier to set your default audio to the headset and let in infer when unplugged; you could alias the command in that question to run manually, as well. – DankyNanky May 21 '20 at 10:20
  • Excuse me, i'm new to GNU, and i don't speak english ... where i could look for the manager settings. – Shirubius May 23 '20 at 23:28
  • This should be accomplished automatically by PulseAudio. Is this with or without Jack started? If you're using Jack and expect speakers to switch to headphones, that is currently not possible, but it is being worked on in Studio Controls. – Erich Eickmeyer May 31 '20 at 02:11

1 Answers1

0

Have the same problem... After reading many forums i dont find proper hint and write own solution this is my first script and I don’t know how good it is, but it does its job

sudo journalctl -u acpid -f | grep -oP --line-buffered 'completed input layer event "jack/headphone HEADPHONE \K[^ ]*' | while read -r line 
do case "$line" in
    unplug\"        ) pactl set-sink-port 1 analog-output-speaker;;
    plug\"          ) pactl set-sink-port 1 analog-output-headphones ;;
esac;
done