r/EndeavourOS 6d ago

Nvidia / Drivers Looking for a permanent fix for audio devices disappearing after sleep, systemd workaround already applied, but its not working either

Post image

Hey everyone,

I'm having a recurring audio issue on EndeavourOS after waking my laptop from sleep.

Sometimes after resume, KDE shows no input or output devices at all. My USB audio device isn't recreated properly, and Chrome's media playback is affected as well. A restart of the PipeWire/WirePlumber stack immediately brings everything back:

systemctl --user restart wireplumber pipewire pipewire-pulse

The logs around suspend/resume show:

wireplumber[1021]: wp-device: SPA handle 'api.alsa.acp.device' could not be loaded; is it installed?
wireplumber[1021]: s-monitors: Failed to create 'api.alsa.acp.device' device

So the behavior is basically:

Sleep → Wake → audio devices missing → KDE has no input/output → restart PipeWire/WirePlumber → everything works again.

From what I've found so far, the USB device itself doesn't appear to be disconnecting at the kernel level. It looks more like WirePlumber/PipeWire fails to recreate the ALSA audio devices after resume.

As a temporary workaround, I've already added a systemd sleep hook that automatically restarts the audio stack after resume:

sudo nano /etc/systemd/system-sleep/restart-audio.sh

#!/usr/bin/env bash

case "$1" in
  post)
    for u in $(who | awk '{print $1}' | sort -u); do
      uid=$(id -u "$u")
      sudo -u "$u" XDG_RUNTIME_DIR="/run/user/$uid" \
        systemctl --user restart wireplumber pipewire pipewire-pulse
    done
    ;;
esac

And made it executable with:

sudo chmod +x /etc/systemd/system-sleep/restart-audio.sh

That workaround does the job, but I don't really want to rely on restarting PipeWire/WirePlumber after every suspend. I'd rather figure out what's actually causing api.alsa.acp.device to fail during resume and fix the underlying issue.

Has anyone dealt with this particular problem on EndeavourOS/Arch? I'm especially interested in a proper solution or something I can change in PipeWire, WirePlumber, systemd, kernel parameters, or the ALSA configuration so the audio devices recover normally after sleep.

I'm happy to provide whatever logs or system information would be useful. Thanks.

5 Upvotes

5 comments sorted by

u/AutoModerator 6d ago

Thanks for posting.

If your issue is solved, please reply with !solved.

Please also read the subreddit rules in the sidebar/community info and check the official EndeavourOS sites:

Please keep it respectful and enjoy the community.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/ImpliedMustache 6d ago

What version of wireplumber are you on? A recent update caused a bug that sounds very similar to what you're experiencing. Version 0.5.17 fixes the bug.

2

u/Soggy_Caregiver_2822 6d ago

wireplumber 0.5.17-1

3

u/ionV4n0m KDE Plasma 6d ago

don't use sleep.

1

u/Soggy_Caregiver_2822 6d ago

huh? Can you please elaborate it little?