02-19-2026, 07:24 PM
I've been using Debian 13 on my desktop for quite some time now. However I have had a weird issue where if the machine goes into sleep/hibernation I would have no audio when I logged back in.
I am just using the Monitor speakers over HDMI so I suspect the issue is NVIDIA drivers. I struggled with this for months, and am still not entirely sure why it doesn't work, but I did manage to come up with a workaround:
I ended up writing a daemon to detect when a machine resumes from sleep and then restarting the audio stack and reapplying the NVIDIA profile. Also unmutes and sets volume to 100% in case my kid was using the computer last. (She adjusts audio output via the OS rather than the speakers)
Once again I resort to brute force rather than elegant solutions but whatever. it works.
[SPOILER="Code"]
[CODE=bash]#!/usr/bin/env bash
set -u
SINK='alsa_output.pci-0000_29_00.1.hdmi-stereo'
CARD='alsa_card.pci-0000_29_00.1'
PROFILE='output:hdmi-stereo'
apply_fix() {
sleep 2
systemctl --user restart pipewire pipewire-pulse wireplumber || true
sleep 1
pactl set-card-profile "$CARD" "$PROFILE" || true
pactl set-default-sink "$SINK" || true
pactl set-sink-mute "$SINK" 0 || true
pactl set-sink-volume "$SINK" 100% || true
for id in $(pactl list short sink-inputs 2>/dev/null | awk '{print $1}'); do
pactl move-sink-input "$id" "$SINK" || true
pactl set-sink-input-mute "$id" 0 || true
done
}
# Watch login1 sleep signals on the system bus.
# PrepareForSleep(true) = about to sleep; PrepareForSleep(false) = resumed.
dbus-monitor --system "type='signal',interface='org.freedesktop.login1.Manager',member='PrepareForSleep'" 2>/dev/null |
while IFS= read -r line; do
case "$line" in
*"boolean false"*)
apply_fix
;;
esac
done[/CODE]
[/SPOILER]
I am just using the Monitor speakers over HDMI so I suspect the issue is NVIDIA drivers. I struggled with this for months, and am still not entirely sure why it doesn't work, but I did manage to come up with a workaround:
I ended up writing a daemon to detect when a machine resumes from sleep and then restarting the audio stack and reapplying the NVIDIA profile. Also unmutes and sets volume to 100% in case my kid was using the computer last. (She adjusts audio output via the OS rather than the speakers)
Once again I resort to brute force rather than elegant solutions but whatever. it works.
[SPOILER="Code"]
[CODE=bash]#!/usr/bin/env bash
set -u
SINK='alsa_output.pci-0000_29_00.1.hdmi-stereo'
CARD='alsa_card.pci-0000_29_00.1'
PROFILE='output:hdmi-stereo'
apply_fix() {
sleep 2
systemctl --user restart pipewire pipewire-pulse wireplumber || true
sleep 1
pactl set-card-profile "$CARD" "$PROFILE" || true
pactl set-default-sink "$SINK" || true
pactl set-sink-mute "$SINK" 0 || true
pactl set-sink-volume "$SINK" 100% || true
for id in $(pactl list short sink-inputs 2>/dev/null | awk '{print $1}'); do
pactl move-sink-input "$id" "$SINK" || true
pactl set-sink-input-mute "$id" 0 || true
done
}
# Watch login1 sleep signals on the system bus.
# PrepareForSleep(true) = about to sleep; PrepareForSleep(false) = resumed.
dbus-monitor --system "type='signal',interface='org.freedesktop.login1.Manager',member='PrepareForSleep'" 2>/dev/null |
while IFS= read -r line; do
case "$line" in
*"boolean false"*)
apply_fix
;;
esac
done[/CODE]
[/SPOILER]

