• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General Linux Chat
#6
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]
  Reply


Messages In This Thread
General Linux Chat - by BigPete - 02-15-2026, 06:25 PM
General Linux Chat - by BigPete - 02-15-2026, 06:28 PM
General Linux Chat - by BigPete - 02-15-2026, 06:42 PM
General Linux Chat - by BigPete - 02-15-2026, 06:45 PM
General Linux Chat - by BigPete - 02-17-2026, 03:29 PM
General Linux Chat - by BigPete - 02-19-2026, 07:24 PM
General Linux Chat - by Jim Rockford - 02-20-2026, 08:36 AM
General Linux Chat - by BigPete - 04-15-2026, 06:26 PM
General Linux Chat - by BigPete - 05-11-2026, 12:11 AM



Users browsing this thread: 1 Guest(s)
test
.tcat example
.trow1 example
.trow2 example
.trow_sep example
.trow1 example
.trow2 example
.tfoot example
Recent Posts
Not much progress. The vps is very...
BigPete — 07:25 PM
7670193074886200589 View:
BigPete — 02:28 AM
Digital Prophet — 07:45 PM
I’m still working on this, but got ...
BigPete — 02:36 AM
7dR1c65Elfk View:
BigPete — 02:53 PM
forum statistics
  • Members: 11
  • Latest member: Admin
  • Forum threads: 72
  • Forum posts: 433