# WirePlumber 0.5 ALSA rules: prefer dock / external sinks over built-in # analog when they appear (BACKLOG #87). Higher priority.session wins as # the default node; when HDMI/USB goes away, the next-highest (usually # the laptop speakers/headphones) becomes default again. # # Pure attrset so checks.dock-audio can unit-test the contract without a # full PipeWire stack. Consumed by modules/nixos/default.nix. # # Priorities stay ≤1500 (WirePlumber docs: sinks default ~600–1000; going # much higher can outrank streams / BT in surprising ways). { "monitor.alsa.rules" = [ { # HDMI / DisplayPort monitor audio (names vary: .hdmi-stereo, # .hdmi-surround, HiFi__HDMI1__sink, …). matches = [ { "node.name" = "~alsa_output\\..*\\.hdmi-.*"; } { "node.name" = "~alsa_output\\..*HDMI.*"; } { "node.name" = "~alsa_output\\..*\\.DisplayPort.*"; } { "node.name" = "~alsa_output\\..*\\.dp-.*"; } ]; actions."update-props" = { "priority.driver" = 1100; "priority.session" = 1100; }; } { # USB dock / dongle audio (Thunderbolt dock, USB-C audio, …). matches = [ { "node.name" = "~alsa_output\\.usb-.*"; } ]; actions."update-props" = { "priority.driver" = 1050; "priority.session" = 1050; }; } ]; }