Hi,
Two additions to this report (disclaimer: analysis and report generated
by amp code).
1. The patch that reverts the label is alsactl_home.patch, not
udev_test_alsactl.patch. Applying debian/patches/series one by one to
alsa-utils_1.2.14.orig.tar.bz2 (which has the upstream fix,
LABEL="alsa_restore_std"), the label becomes "alsa_restore_go" right
after alsactl_home.patch: its hunk on alsactl/90-alsa-restore.rules.in
removes LABEL="alsa_restore_std" and adds LABEL="alsa_restore_go" along
with the -E HOME=... arguments. udev_test_alsactl.patch only carries the
old label as context. Both patches need refreshing.
2. It doesn't take two HDA cards: any card that is hotplugged later
restores the HDA analog card instead of itself, and resets its volume
every time.
Here: card 0 is a USB webcam (Logitech C930e), card 1 NVidia HDMI, card
2 the onboard HDA codec, so /run/udev/alsa-hda-analog-card holds
ALSA_CARD_HDA_ANALOG=2. The webcam is on a monitor's USB hub, which
re-enumerates on every resume. Each time the webcam comes back, udev
runs "alsactl restore 2" instead of "restore 0", and the onboard card's
Master goes back to the level saved in /var/lib/alsa/asound.state
(41/64, -23 dB here).
With PipeWire on top, WirePlumber sees the hardware change and saves it
as the user's volume in ~/.local/state/wireplumber/default-routes, so
the volume the user set is lost for good. Reproduced: sink set to 100%,
webcam replugged, sink at 40%, and WirePlumber logs "storing
route(analog-output-headphones) props of
device(alsa_card.pci-0000_0e_00.4)" right after the webcam's card is added.
"udevadm test --action=add /sys/class/sound/controlC0" shows both
GOTO="alsa_restore_std" lines dropped and the webcam event going through
the IMPORT of /run/udev/alsa-hda-analog-card.
Versions: Debian 13, alsa-utils 1.2.14-1, pipewire 1.4.2-1,
wireplumber 0.5.8-2, kernel 6.12.
Workaround: a copy of the rule in /etc/udev/rules.d/ with the second
label renamed to alsa_restore_std.
Thanks
--
Thomas