You are not logged in.
I want to automatically switch to the headphone jack sink whenever the headphones are plugged in to the front headphone jack. The default audio comes from the HDMI connected to my monitor. It used to work out of the box when I had external speakers. I have installed: pulseaudio, pulseaudio-alsa pulseaudio-jack and alsa-utils. I read that module-switch-on-port-available was supposed to do just this but I tried both with and without loading this module in my default.pa and still didn't switch. I can switch from HDMI to headphone in the pavcontrol without any problems. One thing I don't quite understand is what happens with my sinks when I plug my headphones out. It looks like my headphone sink is replaced with a "default" one (alsa_output.pci-0000_1e_00.3.iec958-stereo). So if I have my headphones selected in pavucontrol and unplug my headphones the audio falls back to this "default" sink instead of the HDMI. Not sure if this is the expected behaviour. Here are some logs:
> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA ATI HDMI], device 11: HDMI 5 [HDMI 5]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0WITHOUT HEADPHONES PLUGGED IN
> pacmd list-sinks
2 sink(s) available.
* index: 0
name: <alsa_output.pci-0000_1c_00.1.hdmi-stereo-extra3>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9030
volume: front-left: 64880 / 99% / -0.26 dB, front-right: 64880 / 99% / -0.26 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
card: 0 <alsa_card.pci-0000_1c_00.1>
module: 6
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "HDMI 3"
alsa.id = "HDMI 3"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "9"
alsa.card = "0"
alsa.card_name = "HDA ATI HDMI"
alsa.long_card_name = "HDA ATI HDMI at 0xfe960000 irq 76"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:1c:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:1c:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "1002"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
device.product.id = "aaf0"
device.product.name = "Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]"
device.string = "hdmi:0,3"
device.buffering.buffer_size = "352768"
device.buffering.fragment_size = "176384"
device.access_mode = "mmap+timer"
device.profile.name = "hdmi-stereo-extra3"
device.profile.description = "Digital Stereo (HDMI 4)"
device.description = "Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] Digital Stereo (HDMI 4)"
alsa.mixer_name = "ATI R6xx HDMI"
alsa.components = "HDA:1002aa01,00aa0100,00100700"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "ASUS VC239"
active port: <hdmi-output-3>
index: 3
name: <alsa_output.pci-0000_1e_00.3.iec958-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL DECIBEL_VOLUME LATENCY
state: RUNNING
suspend cause: (none)
priority: 9038
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 100.90 ms
max request: 17 KiB
max rewind: 17 KiB
monitor source: 3
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 1
linked by: 1
fixed latency: 100.14 ms
card: 1 <alsa_card.pci-0000_1e_00.3>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC892 Digital"
alsa.id = "ALC892 Digital"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "1"
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfe800000 irq 78"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:1e:00.3"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:1e:00.3/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "1457"
device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
device.string = "iec958:1"
device.buffering.buffer_size = "17664"
device.buffering.fragment_size = "2944"
device.access_mode = "mmap"
device.profile.name = "iec958-stereo"
device.profile.description = "Digital Stereo (IEC958)"
device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Digital Stereo (IEC958)"
alsa.mixer_name = "Realtek ALC892"
alsa.components = "HDA:10ec0892,1462eb89,00100302"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
properties:
active port: <iec958-stereo-output>WITH HEADPHONES PLUGGED IN
> pacmd list-sinks
2 sink(s) available.
* index: 0
name: <alsa_output.pci-0000_1c_00.1.hdmi-stereo-extra3>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9030
volume: front-left: 64880 / 99% / -0.26 dB, front-right: 64880 / 99% / -0.26 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
card: 0 <alsa_card.pci-0000_1c_00.1>
module: 5
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "HDMI 3"
alsa.id = "HDMI 3"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "9"
alsa.card = "0"
alsa.card_name = "HDA ATI HDMI"
alsa.long_card_name = "HDA ATI HDMI at 0xfe960000 irq 76"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:1c:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:1c:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "1002"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
device.product.id = "aaf0"
device.product.name = "Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]"
device.string = "hdmi:0,3"
device.buffering.buffer_size = "352768"
device.buffering.fragment_size = "176384"
device.access_mode = "mmap+timer"
device.profile.name = "hdmi-stereo-extra3"
device.profile.description = "Digital Stereo (HDMI 4)"
device.description = "Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] Digital Stereo (HDMI 4)"
alsa.mixer_name = "ATI R6xx HDMI"
alsa.components = "HDA:1002aa01,00aa0100,00100700"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "ASUS VC239"
active port: <hdmi-output-3>
index: 1
name: <alsa_output.pci-0000_1e_00.3.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9039
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 100.14 ms
card: 1 <alsa_card.pci-0000_1e_00.3>
module: 6
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC892 Analog"
alsa.id = "ALC892 Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfe800000 irq 78"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:1e:00.3"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:1e:00.3/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "1457"
device.product.name = "Family 17h (Models 00h-0fh) HD Audio Controller"
device.string = "front:1"
device.buffering.buffer_size = "17664"
device.buffering.fragment_size = "2944"
device.access_mode = "mmap"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "Family 17h (Models 00h-0fh) HD Audio Controller Analog Stereo"
alsa.mixer_name = "Realtek ALC892"
alsa.components = "HDA:10ec0892,1462eb89,00100302"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
properties:
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-headphones>Offline