Give HDMI outputs a higher priority than internal speakers
- Fedora 35
- wireplumber 0.4.7
On my Lenovo P14s Gen2 AMD, four HDMI outputs appear after connecting an external monitor via HDMI. They look as follows (the other three have a 7, 8, or 9 instead of the 3).
"node.name": "alsa_output.pci-0000_07_00.1.HiFi__hw_Generic_3__sink",
However, their priority is lowere than the one of the internal speakers, which means that the sound isn't automatically redirected to them once an HDMI cable is connected.
The priorities are as follows
➜ ~ pw-dump | rg -B 6 "priority.session"
"node.description": "Family 17h (Models 10h-1fh) HD Audio Controller Speaker + Headphones",
"node.name": "alsa_output.pci-0000_07_00.6.HiFi__hw_Generic_1__sink",
"node.nick": "HD-Audio Generic",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:1:hw:Generic_1:playback",
"priority.driver": 1000,
"priority.session": 1000,
--
"node.description": "Family 17h (Models 10h-1fh) HD Audio Controller Headphones Stereo Microphone",
"node.name": "alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source",
"node.nick": "HD-Audio Generic",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:1:hw:Generic_1:capture",
"priority.driver": 2000,
"priority.session": 2000,
--
"node.description": "Family 17h (Models 10h-1fh) HD Audio Controller Digital Microphone",
"node.name": "alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source",
"node.nick": "HD-Audio Generic",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:1:hw:acp:capture",
"priority.driver": 2000,
"priority.session": 2000,
--
"node.description": "Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 4 Output",
"node.name": "alsa_output.pci-0000_07_00.1.HiFi__hw_Generic_9__sink",
"node.nick": "HD-Audio Generic",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:0:hw:Generic,9:playback",
"priority.driver": 600,
"priority.session": 600,
--
"node.description": "Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 3 Output",
"node.name": "alsa_output.pci-0000_07_00.1.HiFi__hw_Generic_8__sink",
"node.nick": "HD-Audio Generic",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:0:hw:Generic,8:playback",
"priority.driver": 616,
"priority.session": 616,
--
"node.description": "Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 2 Output",
"node.name": "alsa_output.pci-0000_07_00.1.HiFi__hw_Generic_7__sink",
"node.nick": "HD-Audio Generic",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:0:hw:Generic,7:playback",
"priority.driver": 632,
"priority.session": 632,
--
"node.description": "Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output",
"node.name": "alsa_output.pci-0000_07_00.1.HiFi__hw_Generic_3__sink",
"node.nick": "HD-Audio Generic",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:0:hw:Generic,3:playback",
"priority.driver": 696,
"priority.session": 696,
However, I would expect them to have a priority between 1000 and 2000.
As a workaround, I for now added the following lines to my
matches = {
{
{ "node.name", "matches", "alsa_output.pci-0000_07_00.1.HiFi__hw_Generic_7__sink" },
},
},
apply_properties = {
["priority.session"] = 1001,
["priority.driver"] = 1001,
},
50-alsa-config.lua
.