Volume resets to 100% on TV speakers when locking desktop (Vicuna + PipeWire + WirePlumber)

Topology

  • Lenovo Thinkpad X1 Carbon Gen7
    • ThinkPad Thunderbolt 4 Dock
      • 48" LG OLED 4K TV - CX (OLED48CX6LB)

What happens

When I lock (Super + l) Gnome, my display turns off. When I type on the keyboard, the display turns on again, and I see the lockscreen. If I use the mediakeys on my keyboard to change the volume, I notice it is now reset to 100%.

I can reduce the volume manually now, and it works fine until next time I lock Gnome.

The nightmare is whenever the computer locks itself, or I lock it with music running in the background. Properly gets my adrenaline going when logging on, and experiencing the volume having gone from 20% to 100%!

What is the expected outcome

When I lock (Super + l) Gnome, Volume should not change to 100% on my 48" LG OLED 4K TV

What output did you get

Audio snippet from “wpctl status”:

Audio
 ├─ Devices:
 │      47. ThinkPad Thunderbolt 4 Dock USB Audio [alsa]
 │      68. Cannon Point-LP High Definition Audio Controller [alsa]
 │      90. BRIO Ultra HD Webcam                [alsa]
 │  
 ├─ Sinks:
 │  *   51. Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 1 Output [vol: 0.94]
 │      53. ThinkPad Thunderbolt 4 Dock USB Audio Analog stereo [vol: 0.16]
 │      67. Cannon Point-LP High Definition Audio Controller Headphones [vol: 1.00]
 │      83. Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 2 Output [vol: 1.00]
 │     143. Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 3 Output [vol: 1.00]

Audio snippet from “pw-cli list-objects”:

	id 51, type PipeWire:Interface:Node/3
 		object.serial = "1232"
 		object.path = "alsa:acp:sofhdadsp:2:playback"
 		factory.id = "19"
 		client.id = "43"
 		device.id = "68"
 		priority.session = "696"
 		priority.driver = "696"
 		node.description = "Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 1 Output"
 		node.name = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI1__sink"
 		node.nick = "HDMI / DisplayPort 1 Output"
 		media.class = "Audio/Sink"

Audio snippet from “wpctl status” again, after I’ve locked and unlocked Gnome:

Audio
 ├─ Devices:
 │      47. ThinkPad Thunderbolt 4 Dock USB Audio [alsa]
 │      68. Cannon Point-LP High Definition Audio Controller [alsa]
 │      90. BRIO Ultra HD Webcam                [alsa]
 │  
 ├─ Sinks:
 │      53. ThinkPad Thunderbolt 4 Dock USB Audio Analog stereo [vol: 0.16]
 │      67. Cannon Point-LP High Definition Audio Controller Headphones [vol: 1.00]
 │      80. Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 3 Output [vol: 1.00]
 │      94. Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 2 Output [vol: 1.00]
 │  *   99. Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 1 Output [vol: 1.00]

Audio snippet from “pw-cli list-objects” again, after I’ve locked and unlocked Gnome:

	id 99, type PipeWire:Interface:Node/3
 		object.serial = "1297"
 		object.path = "alsa:acp:sofhdadsp:2:playback"
 		factory.id = "19"
 		client.id = "43"
 		device.id = "68"
 		priority.session = "696"
 		priority.driver = "696"
 		node.description = "Cannon Point-LP High Definition Audio Controller HDMI / DisplayPort 1 Output"
 		node.name = "alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI1__sink"
 		node.nick = "HDMI / DisplayPort 1 Output"
 		media.class = "Audio/Sink"

I’ve posted the output of the log from “WIREPLUMBER_DEBUG=3 wireplumber” here: I 15:28:03.443869 wp ../lib/wp/wp.c:35:wp_init: WirePlumber 0.5. - Pastebin.com
I can see lines where it looks like it is setting the volume to 100%, but I do not understand the surrounding context.

I am wondering if the issue stems from these devices getting a new unique identifier after locking Gnome. I see the ID and object.serial changes. Maybe WirePlumber defaults to 100% volume on new devices.

I am used to Linux, but new to the nix-way, so please assist me with methods I can use to troubleshoot this.

Meta information like system and nix versions

NixOS 24.11.714127.f5a32fa27df9 (Vicuna)
libwireplumber 0.5.7
libpipewire 1.2.7

Audio snippet from configuration.nix

  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    wireplumber.enable = true;
  };

And more importantly

I do love NixOS, thank you very much for the work you put in to both the code, testing and community!