Add message commands to enable/disable jack detection per port

Georg Chini requested to merge gchini/pulseaudio:jack_detection into master

With these patches it is possible to enable or disable jack detection on a port and to set the port state manually. Each card now has a message handler. You can find the path to the message handler with "pactl list message-handlers". Following messages are available:

  • get-port-state - get the state of a single port or all ports if "all" is specified as argument
  • set-port-state - set the state of a single or all ports (0=unknown, 1=no, 2 = yes)
  • set-jack-detection - enable/disable jack detection on a single or all ports

When jack detection is disabled, the port state will change to "unknown". Setting a port state manually will disable jack detection on that port.


pactl send-message /cards/alsa_card.pci-0000_02_00.1 get-port-state '"all"' - get state of all ports

pactl send-message /cards/alsa_card.pci-0000_02_00.1 set-jack-detection '{"all":false}' - disable jack detection on all ports

pactl send-message /cards/alsa_card.pci-0000_02_00.1 set-port-state '{"hdmi-output-0":2}' - set hdmi-output-0 to available

Edited by Georg Chini

Merge request reports