Sound disappeared after every pipewire-pulseaudio upgrade

Long time problem still exists: sound disappeared after every pipewire-pulseaudio upgrade is creates symlinks:

  • /etc/systemd/user/pipewire-pulse.service -> /dev/null
  • /etc/systemd/user/pipewire-pulse.socket -> dev/null

And after reboot sound disappears. Possible solutions to enable sound:

sudo systemctl --user --global unmask pipewire-pulse.socket pipewire-pulse.service && \
systemctl --user enable --now pipewire pipewire-pulse

OR

sudo rm -f /etc/systemd/user/pipewire-pulse*
sudo systemctl --global unmask pipewire-pulse.service pipewire-pulse.socket
sudo systemctl --global preset pipewire-pulse.service pipewire-pulse.socket
systemctl --user enable --now pipewire-pulse.socket pipewire-pulse.service

But how to prevent these files creating? SUSE post-install script package bug?

Previous attempts to solve the problem:

Previous bug reports that did not solve this:

New bug report:
https://bugzilla.opensuse.org/show_bug.cgi?id=1258917

No preset overrides?

ls -l /etc/systemd/user-preset/

If that directory does not exist or is empty, say so.

It would be useful to know if the mask exists immediately after an update or is persistent from the past…

ls -l /etc/systemd/user/pipewire-pulse*
stat /etc/systemd/user/pipewire-pulse.service

I assume pulseuaudio is not installed?
rpm -q pulseaudio

> LC_ALL=C.UTF-8 ls -l /etc/systemd/user-preset/
ls: cannot access '/etc/systemd/user-preset/': No such file or directory
> LC_ALL=C.UTF-8 ls -l /etc/systemd/user/pipewire-pulse*
ls: cannot access '/etc/systemd/user/pipewire-pulse*': No such file or directory
> LC_ALL=C.UTF-8 stat /etc/systemd/user/pipewire-pulse.service
stat: cannot statx '/etc/systemd/user/pipewire-pulse.service': No such file or directory

Yes, created after the update, does not exists (deleted) before the update.

Yes, not installed.

No local preset overrides, that’s eliminated from the equation. Thanks for confirming that the mask is created only after the update, and not present before.

Digging in to this, I note…

~> rpm -q --scripts pipewire-pulseaudio
preinstall scriptlet (using /bin/sh):


if [ -x /usr/lib/systemd/systemd-update-helper ]; then
        /usr/lib/systemd/systemd-update-helper mark-install-user-units pipewire-pulse.service pipewire-pulse.socket || : 
fi
postinstall scriptlet (using /bin/sh):


if [ -x /usr/lib/systemd/systemd-update-helper ]; then
        /usr/lib/systemd/systemd-update-helper install-user-units pipewire-pulse.service pipewire-pulse.socket || :
fi

# If the pipewire-pulse.socket user service is not enabled and the workaround
# for boo#1186561 has never been executed, we need to execute it now
if [ ! -L /etc/systemd/user/sockets.target.wants/pipewire-pulse.socket \
    -a ! -f /var/lib/pipewire/pipewire-pulseaudio_post_workaround \
    -a -x /usr/bin/systemctl ]; then
    for service in pipewire-pulse.service pipewire-pulse.socket ; do
        /usr/bin/systemctl --global preset "$service" || :
    done
    mkdir -p /var/lib/pipewire
    cat << EOF > /var/lib/pipewire/pipewire-pulseaudio_post_workaround
# The existence of this file means that the pipewire-pulseaudio user service was
# enabled at least once. Please don't remove this file as that would
# make the services to be enabled again in the next package update.
#
# Check the following bugs for more information:
# https://bugzilla.opensuse.org/show_bug.cgi?id=1184852
# https://bugzilla.opensuse.org/show_bug.cgi?id=1183012
# https://bugzilla.opensuse.org/show_bug.cgi?id=1186561
EOF
fi
# Update the /etc/profile.d/pulseaudio.* files
setup-pulseaudio --auto > /dev/null
preuninstall scriptlet (using /bin/sh):


if [ $1 -eq 0 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then
        # Package removal, not upgrade
        /usr/lib/systemd/systemd-update-helper remove-user-units pipewire-pulse.service pipewire-pulse.socket || :
fi
postuninstall scriptlet (using /bin/sh):

 
:

…which can run systemctl --global preset for the units, which could mask them if the preset says disable.

Based on the package scripts, the recurring mask happens because of the pipewire-pulseaudio post-install workaround, which only runs once per system. On your system, it looks like it triggered in a way that masked the units. You should be able to fix this permanently as explained below.

Remove any current masks…
sudo systemctl --global unmask pipewire-pulse.service pipewire-pulse.socket
Enable and start the services…
systemctl --user enable --now pipewire-pulse.service pipewire-pulse.socket

You can ensure the workaround file exists so the script won’t re-mask them ever. The following steps will create and empty file, and once that exists the update post-install script will check if it exists and skip running the systemctl --global preset that can re-mask the units…

sudo mkdir -p /var/lib/pipewire
sudo touch /var/lib/pipewire/pipewire-pulseaudio_post_workaround

In short these commands should fix it once and for-all…

sudo rm -f /etc/systemd/user/pipewire-pulse*
sudo systemctl --global unmask pipewire-pulse.service pipewire-pulse.socket
sudo systemctl --global preset pipewire-pulse.service pipewire-pulse.socket
systemctl --user enable --now pipewire-pulse.socket pipewire-pulse.service
sudo mkdir -p /var/lib/pipewire
sudo touch /var/lib/pipewire/pipewire-pulseaudio_post_workaround
1 Like

Ha-ha! ChatGPT gave me the same set of commands - did not help: next run symlinks created again:

> sudo rm -f /etc/systemd/user/pipewire-pulse*
> sudo systemctl --global unmask pipewire-pulse.service pipewire-pulse.socket
> sudo systemctl --global preset pipewire-pulse.service pipewire-pulse.socket
> systemctl --user enable --now pipewire-pulse.socket pipewire-pulse.service
> sudo mkdir -p /var/lib/pipewire
> sudo touch /var/lib/pipewire/pipewire-pulseaudio_post_workaround

> LC_ALL=C.UTF-8 sudo zypper install --force pipewire-pulseaudio
Refreshing service 'NVIDIA'.
Refreshing service 'openSUSE'.
Loading repository data...
Reading installed packages...
Forcing installation of 'pipewire-pulseaudio-1.6.0-2.1.x86_64' from repository 'openSUSE:Tumbleweed'.
Resolving package dependencies...

The following package is going to be reinstalled:
  pipewire-pulseaudio

1 package to reinstall.

Package download size:   443.3 KiB

Package install size change:
            |     469.9 KiB  required by packages that will be installed
       0 B  |  -  469.9 KiB  released by packages that will be removed

Backend:  classic_rpmtrans
Continue? [y/n/v/...? shows all options] (y):
Preloading: pipewire-pulseaudio-1.6.0-2.1.x86_64.rpm [done]
Preload finished. [success (15.9 KiB/s) ] .....................................................................................................................................[done]
Retrieving: pipewire-pulseaudio-1.6.0-2.1.x86_64 (openSUSE:Tumbleweed)                                                                                           (1/1), 443.3 KiB

Checking for file conflicts: ..................................................................................................................................................[done]
Created symlink '/etc/systemd/user/pipewire-pulse.socket' -> '/dev/null'.
Created symlink '/etc/systemd/user/pipewire-pulse.service' -> '/dev/null'.
(1/1) Installing: pipewire-pulseaudio-1.6.0-2.1.x86_64 ........................................................................................................................[done]
Running post-transaction scripts ..............................................................................................................................................[done]

Late here so out of time to investigate further…not sure why that didn’t work given the script’s workaround test…

# If the pipewire-pulse.socket user service is not enabled and the workaround
# for boo#1186561 has never been executed, we need to execute it now
if [ ! -L /etc/systemd/user/sockets.target.wants/pipewire-pulse.socket \
    -a ! -f /var/lib/pipewire/pipewire-pulseaudio_post_workaround \
    -a -x /usr/bin/systemctl ]; then
    for service in pipewire-pulse.service pipewire-pulse.socket ; do
        /usr/bin/systemctl --global preset "$service" || :
    done
    mkdir -p /var/lib/pipewire
    cat << EOF > /var/lib/pipewire/pipewire-pulseaudio_post_workaround
# The existence of this file means that the pipewire-pulseaudio user service was
# enabled at least once. Please don't remove this file as that would
# make the services to be enabled again in the next package update.
#

Hopefully others can identify the root of the issue. I’ve never been impacted or aware of others who have either.

I’m not sure that this was a valid thing to do. That will result in the package being removed before being reinstalled. During the transaction, the old unit files are removed temporarily, sosystemd-update-helper think the units are new. This triggers the preset logic and creates the /dev/null symlinks.

If the pipewire-pulse.socket user service is not enabled and the workaround

So what does systemctl --user status pipewire.socket pipewire-pulse.socket give?

(Please note that the preset for pipewire.service and pipewire-pulse.service is disabled and the services are triggered by the respective .socket upon graphical login for each user)

Found the problem: the pipewire-session-manager.service file is located in /etc/systemd/user dated October 24, 2022 with the following content:

# cat pipewire-session-manager.service
[Unit]
Description=Multimedia Service Session Manager
After=pipewire.service dbus.service
BindsTo=pipewire.service
Conflicts=pipewire-media-session.service

[Service]
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
Type=simple
ExecStart=/usr/bin/wireplumber -p $WIREPLUMBER_PROFILE
Restart=on-failure
Slice=session.slice
Environment=GIO_USE_VFS=local
Environment=WIREPLUMBER_PROFILE=main
EnvironmentFile=-/usr/etc/wireplumber.env
EnvironmentFile=-/etc/wireplumbler.env

[Install]
WantedBy=pipewire.service
Alias=pipewire-session-manager.service

and 2 socket files in /etc/systemd/user/sockets.target.wants →

  • pipewire.socket and
  • pipewire-pulse.socket

both also dated on Oct 2022 which probably was left behind on transition times from pipewire-media-session to wireplumber. Removed these 3 files - now all works, no symlinks created.

Bad TW does not upgrade clearly in such cases removing old unused settings.

Just for the records (and to avoid confusing other users reading this thread) I see those 3 files here with apparently the same content and pipewire is working:

bruno@LT-B:/> ll /etc/systemd/user
total 12
lrwxrwxrwx 1 root root   41 ago 30  2024 dbus.service -> /usr/lib/systemd/user/dbus-broker.service
drwxr-xr-x 2 root root 4096 feb 25  2023 graphical-session-pre.target.wants
drwxr-xr-x 2 root root 4096 lug 20  2024 pipewire.service.wants
lrwxrwxrwx 1 root root   41 lug 20  2024 pipewire-session-manager.service -> /usr/lib/systemd/user/wireplumber.service
drwxr-xr-x 2 root root 4096 lug 20  2024 sockets.target.wants
bruno@LT-B:/> ll /etc/systemd/user/sockets.target.wants
total 0
lrwxrwxrwx 1 root root 43 lug 20  2024 pipewire-pulse.socket -> /usr/lib/systemd/user/pipewire-pulse.socket
lrwxrwxrwx 1 root root 37 lug 20  2024 pipewire.socket -> /usr/lib/systemd/user/pipewire.socket
bruno@LT-B:/>

So maybe removing those files triggered a cleanup somewhere else?

And yes: /var/lib/pipewire/pipewire-pulseaudio_post_workaround should exist, otherwise problem appears again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.