Sound disappeared again after pipewire-pulseaudio upgrade

After recent zypper dup problem returned again: symlinks to /dev/null were created again and previous workarounds do not help and need to explicitly run:

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

So proposed solution does not work: Sound disappeared after every pipewire-pulseaudio upgrade - #9 by akontsevich and bugreport was re-openned again: https://bugzilla.opensuse.org/show_bug.cgi?id=1258917#c2.

@akontsevich have you accidentally masked those units, that’s what it does, creates a symlink to /dev/null

No issues here with sounds on GNOME.

1 Like

ChatGPT has found the problem it is in pipewire-pulseaudio postinstall script:

> 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):


:

it runs setup-pulseaudio --auto > /dev/null:

> cat /usr/bin/setup-pulseaudio
#!/bin/sh

LIST_OF_OSS_APPS="aumix sox"

show_help() {
    echo "setup-pulseaudio [ --enable | --disable | --auto | --status ]"
    echo ""
    echo "Modifies configuration files of some applications for PulseAudio"
    echo "  --enable   Enables PulseAudio"
    echo "  --disable  Disables PulseAudio"
    echo "  --auto     Automatically enables/disables PulseAudio based on configuration"
    echo "  --status   Shows activation state (disabled or enabled) for PulseAudio"
    echo ""
    echo "You need to be root for this command to succeed"
    echo "You may need to re-login for changes to take effect"
    exit 1
}

check_root() {
    id=`id -u`
    if [ "x$id" = "x0" ]; then
        true
    else
        echo "You need to be root in order to enable/disable pulseaudio"
        false
    fi
}

PROFNAME=/etc/profile.d/pulseaudio.sh
CPROFNAME=/etc/profile.d/pulseaudio.csh
pulse_client_conf=/etc/pulse/client.conf.d/50-system.conf

MPLAYER_CONF=/etc/mplayer/mplayer.conf

set_variable () {
    if test -f $PROFNAME &&
        grep -q "export $1"= $PROFNAME; then
        sed -i -e "s|export $1=.*|export $1=$2|g" $PROFNAME
    else
        echo "export $1=$2" >> $PROFNAME
    fi
    if test -f $CPROFNAME &&
        grep -q "setenv $1 " $CPROFNAME; then
        sed -i -e "s|setenv $1 .*|setenv $1 $2|g" $CPROFNAME
    else
        echo "setenv $1 $2" >> $CPROFNAME
    fi
}

delete_variable () {
    if test -f $PROFNAME &&
        grep -q "export $1"= $PROFNAME; then
        sed -i -e "/export $1=.*/d" $PROFNAME
    fi
    if test -f $CPROFNAME &&
        grep -q "setenv $1 " $CPROFNAME; then
        sed -i -e "/setenv $1 .*/d" $CPROFNAME
    fi
}

setup_gconf_vendor() {
    if [ -x /usr/bin/gconftool-2 ]; then
        /usr/bin/gconftool-2 --direct --config-source \
            xml:readwrite:/etc/gconf/gconf.xml.vendor \
            "$@"
    fi
}

has_user_pulseaudio() {
    test -f /etc/systemd/user/sockets.target.wants/pulseaudio.socket && return 0
    test -f /etc/systemd/user/sockets.target.wants/pipewire-pulse.socket && return 0
    return 1
}

pulseaudio_bin_name() {
    if [ -x /usr/bin/pulseaudio ]; then
        echo "pulseaudio"
    else
        echo "pipewire-pulse"
    fi
}

enable_phonon() {
    echo "Enabling PulseAudio for Phonon..."
    delete_variable PHONON_PULSEAUDIO_DISABLE
}

enable_kmix() {
    echo "Enabling PulseAudio for Kmix..."
    delete_variable KMIX_PULSEAUDIO_DISABLE
}

enable_alsa() {
    echo "Enabling PulseAudio for ALSA..."
    if [ -f /etc/alsa/conf.d/99-pulseaudio-default.conf ]; then
        return 0
    fi
    if [ -f /etc/alsa/conf.d/99-pulseaudio-default.conf.example ]; then
        ln -s 99-pulseaudio-default.conf.example /etc/alsa/conf.d/99-pulseaudio-default.conf
        delete_variable ALSA_CONFIG_PATH
    elif [ -f /usr/share/alsa/conf.d/99-pulseaudio-default.conf.example ]; then
        ln -s /usr/share/alsa/conf.d/99-pulseaudio-default.conf.example /etc/alsa/conf.d/99-pulseaudio-default.conf
        delete_variable ALSA_CONFIG_PATH
    elif [ -f /etc/alsa-pulse.conf ]; then
        set_variable ALSA_CONFIG_PATH /etc/alsa-pulse.conf
    else
        echo "Please install alsa-plugins-pulse package"
        delete_variable ALSA_CONFIG_PATH
    fi
}

enable_libao() {
    echo "Enabling PulseAudio for libao..."
    if test -f /etc/libao.conf; then
        if grep -q "default_driver=pulse" /etc/libao.conf; then
            echo "Default driver is pulse already in /etc/libao.conf"
        else
            echo "default_driver=pulse" >> /etc/libao.conf
        fi
    else
        echo "default_driver=pulse" >> /etc/libao.conf
    fi
}

enable_mplayer() {
    echo "Enabling PulseAudio for mplayer..."
    if test -f $MPLAYER_CONF; then
        if grep -q '^ao *= *pulse' $MPLAYER_CONF; then
            :
        elif grep -q '^ao *=' $MPLAYER_CONF; then
            sed -i -e 's/^ao *= *\(.*\)$/ao=pulse,\1/g' $MPLAYER_CONF
        else
            echo "ao=pulse" >> $MPLAYER_CONF
        fi
    fi

    # FIXME: mplayerplug-in uses $HOME/.mplayer/mplayerplug-in.conf
}

enable_speechd() {
    echo "Enabling PulseAudio for speech dispatcher..."
    if test -f /etc/speech-dispatcher/speechd.conf; then
        if grep -q 'AudioOutputMethod' /etc/speech-dispatcher/speechd.conf; then
            sed -i -e "s|^.*AudioOutputMethod .*|AudioOutputMethod \"pulse\"|g" /etc/speech-dispatcher/speechd.conf
        else
            echo "AudioOutputMethod \"pulse\"" >> /etc/speech-dispatcher/speechd.conf
        fi
    fi
}

enable_openal() {
    # nothing to do here. openal-soft is patched to prefer pulse but
    # it won't autostart the daemon.
    return 0
}

enable_oss() {
    echo "Enabling PulseAudio for OSS..."
    for app in $LIST_OF_OSS_APPS; do
        if test -f $PROFNAME &&
            grep -q "alias $app='padsp $app'" $PROFNAME; then
            echo "Application $app already setup for PulseAudio"
        else
            echo "alias $app='padsp $app'" >> $PROFNAME
        fi
    done
}

enable_sdl() {
    echo "Enabling PulseAudio for SDL..."
    # We don't need the audio driver override for SDL; SDL prefers already
    # pulseaudio as default (bsc#1189778)
    delete_variable SDL_AUDIODRIVER

    # Alternatively, we may set "pulseaudio" explicitly, which should be
    # applicable both for SDL-1.2 and SDL-2
    # set_variable SDL_AUDIODRIVER pulseaudio
}

enable_timidity() {
    echo "Enabling PulseAudio for Timidity..."
    # Use esound output for timidity
    if test -f $PROFNAME &&
        grep -q "alias timidity='timidity -Oe'" $PROFNAME; then
        echo "Timidity already setup for using PulseAudio"
    else
        echo "alias timidity='timidity -Oe'" >> $PROFNAME
    fi
}

enable_xine() {
    #echo "Enabling PulseAudio for Xine..."
    # FIXME: xine uses $HOME/.xine/config
    return 0
}

enable_festival() {
    test -f /etc/festival.scm || return 0
    echo "Enabling PulseAudio for Festival..."
    cat << EOF >> /etc/festival.scm
;;;; Use pulseaudio to output sound
(Parameter.set 'Audio_Command "paplay -n festival \$FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Required_Format 'snd)
EOF
}

enable_sox() {
    echo "Enabling PulseAudio for SoX..."
    set_variable AUDIODRIVER pulseaudio
}

enable_gstreamer() {
    # set autoaudiosink/src, which should pick up PA
    echo "Setting auto sink/src for gstreamer"
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/audiosink autoaudiosink
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/musicaudiosink autoaudiosink
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/chataudiosink autoaudiosink
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/audiosrc autoaudiosrc
}

enable_qemu () {
    echo "Enabling PulseAudio for QEMU/KVM"
    set_variable QEMU_AUDIO_DRV pa
}

enable_autospawn() {
    has_user_pulseaudio && return
    test -x /usr/bin/pulseaudio || return
    echo "Enabling PulseAudio autospawn..."
    if grep -q ^autospawn $pulse_client_conf >/dev/null 2>&1; then
        sed -i -e "s|^autospawn.*|autospawn = yes|g" $pulse_client_conf
    else
        echo "autospawn = yes" >> $pulse_client_conf
    fi
}

enable_systemd() {
    has_user_pulseaudio || return
    echo "Enabling systemd user socket..."
    s=$(pulseaudio_bin_name)
    systemctl --global unmask $s.socket
    systemctl --global unmask $s.service
}

disable_alsa() {
    echo "Disabling PulseAudio for ALSA..."
    delete_variable ALSA_CONFIG_PATH
    rm -f /etc/alsa/conf.d/99-pulseaudio-default.conf
}

disable_phonon() {
    echo "Disabling PulseAudio for Phonon..."
    set_variable PHONON_PULSEAUDIO_DISABLE 1
}

disable_kmix() {
    echo "Disabling PulseAudio for Kmix..."
    set_variable KMIX_PULSEAUDIO_DISABLE 1
}

disable_libao() {
    if test -f /etc/libao.conf; then
        echo "Disabling PulseAudio for libao..."
        sed -i -e "/default_driver=pulse/d" /etc/libao.conf
    fi
}

disable_mplayer() {
    if test -f $MPLAYER_CONF; then
        echo "Disabling PulseAudio for mplayer..."
        sed -i -e 's/^ao *= *pulse,*/ao=/g' \
                -e 's/^ao *= *$/ao=alsa/g' $MPLAYER_CONF
    fi
}

disable_speechd() {
    echo "Disabling PulseAudio for speech dispatcher..."
    if test -f /etc/speech-dispatcher/speechd.conf; then
        if grep -q 'AudioOutputMethod' /etc/speech-dispatcher/speechd.conf; then
            sed -i -e "s|^.*AudioOutputMethod .*|#AudioOutputMethod \"pulse\"|g" /etc/speech-dispatcher/speechd.conf
        fi
    fi
}

disable_openal() {
    # nothing to do here. openal-soft is patched to prefer pulse but
    # it won't autostart the daemon.
    return 0
}

disable_oss() {
    for app in $LIST_OF_OSS_APPS; do
        sed -i -e "/alias $app='padsp $app'/d" $PROFNAME
    done
}

disable_sdl() {
    echo "Disabling PulseAudio for SDL..."
    delete_variable SDL_AUDIODRIVER
}

disable_timidity() {
    echo "Disabling PulseAudio for Timidity..."
    sed -i -e "/alias timidity='timidity -Oe'/d" $PROFNAME
}

disable_xine() {
    #echo "Disabling PulseAudio for Xine..."
    # FIXME: xine uses $HOME/.xine/config
    return 0
}

disable_festival() {
    test -f /etc/festival.scm || return 0
    echo "Disabling PulseAudio for Festival..."
    /usr/bin/sed --in-place /";;;; Use pulseaudio to output sound"/d /etc/festival.scm
    /usr/bin/sed --in-place /"(Parameter.set 'Audio_Command \"paplay -n festival \$FILE\")"/d /etc/festival.scm
    /usr/bin/sed --in-place /"(Parameter.set 'Audio_Method 'Audio_Command)"/d /etc/festival.scm
    /usr/bin/sed --in-place /"(Parameter.set 'Audio_Required_Format 'snd)"/d /etc/festival.scm
}

disable_sox() {
    echo "Disabling PulseAudio for SoX..."
    set_variable AUDIODRIVER alsa
}

disable_gstreamer() {
    echo "Setting alsasink/src for gstreamer"
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/audiosink alsasink
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/musicaudiosink alsasink
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/chataudiosink alsasink
    setup_gconf_vendor -s -t str \
        /system/gstreamer/0.10/default/audiosrc alsasrc
}

disable_qemu () {
    echo "Clearing QEMU/KVM audio setup"
    delete_variable QEMU_AUDIO_DRV
}

disable_autospawn() {
    has_user_pulseaudio && return
    test -x /usr/bin/pulseaudio || return
    echo "Disabling PulseAudio autospawn..."
    if grep -q ^autospawn $pulse_client_conf >/dev/null 2>&1; then
        sed -i -e "s|^autospawn.*|autospawn = no|g" $pulse_client_conf
    else
        echo "autospawn = no" >> $pulse_client_conf
    fi
    # kill leftover PA processes
    killall pulseaudio > /dev/null 2>&1
}

disable_systemd() {
    has_user_pulseaudio || return
    echo "Disabling systemd user socket..."
    s=$(pulseaudio_bin_name)
    systemctl --global mask $s.socket
    systemctl --global mask $s.service
    # kill leftover PA processes
    killall $s > /dev/null 2>&1
}

enable_all() {
    enable_alsa
    enable_libao
    enable_mplayer
    enable_openal
    enable_oss
    enable_sdl
    enable_timidity
    enable_xine
    enable_festival
    enable_phonon
    enable_kmix
    enable_speechd
    enable_sox
    enable_gstreamer
    enable_qemu
    enable_autospawn
    enable_systemd
}

disable_all() {
    disable_alsa
    disable_libao
    disable_mplayer
    disable_openal
    disable_oss
    disable_sdl
    disable_timidity
    disable_xine
    disable_festival
    disable_phonon
    disable_kmix
    disable_speechd
    disable_sox
    disable_gstreamer
    disable_qemu
    disable_autospawn
    disable_systemd
}

case $1 in
    --enable)
        check_root || exit 1
        ENABLE=1
        enable_all
        ;;
    --disable)
        check_root || exit 1
        ENABLE=0
        disable_all
        ;;
    --auto)
        check_root || exit 1
        if [ -f /etc/sysconfig/sound ]; then
            . /etc/sysconfig/sound
        fi
        if [ "x$PULSEAUDIO_ENABLE" = "xyes" ]; then
            enable_all
        elif [ "x$PULSEAUDIO_ENABLE" = "xcustom" ]; then
            echo "Custom configuration detected, doing nothing."
        else
            disable_all
        fi
        exit 0
        ;;
    --status)
        if [ -f /etc/sysconfig/sound ]; then
            . /etc/sysconfig/sound
        fi
        if [ "x$PULSEAUDIO_ENABLE" = "xyes" ]; then
            echo "enabled"
        elif [ "x$PULSEAUDIO_ENABLE" = "xcustom" ]; then
            echo "custom configured"
        else
            echo "disabled"
        fi
        exit 0
        ;;
    *)
        show_help
        ;;
esac

# Now, update /etc/sysconfig/sound with the PA status
if grep -q PULSEAUDIO_ENABLE /etc/sysconfig/sound; then
    if [  "x$ENABLE" = "x1" ]; then
        sed -i -e "s|PULSEAUDIO_ENABLE=\"no\"|PULSEAUDIO_ENABLE=\"yes\"|g" /etc/sysconfig/sound
    else
        sed -i -e "s|PULSEAUDIO_ENABLE=\"yes\"|PULSEAUDIO_ENABLE=\"no\"|g" /etc/sysconfig/sound
    fi
else
    if [ "x$ENABLE" = "x1" ]; then
        echo "PULSEAUDIO_ENABLE=\"yes\"" >> /etc/sysconfig/sound
    else
        echo "PULSEAUDIO_ENABLE=\"no\"" >> /etc/sysconfig/sound
    fi
fi
exit 0

So to fix need to edit /etc/sysconfig/sound file and set

PULSEAUDIO_ENABLE="yes"

or even better:

PULSEAUDIO_ENABLE="custom"

Now /dev/null symlinks are not created for me on pipewire-pulseaudio reinstall /upgrade.

On my system that is already as such. Did you modify that setting manually at some stage?

Never. Could this be some old TW setting: for alsa or something? However it is strange as I’d reinstalled my system to new SSD in 2022 I beleive.

I’ve never seen anyone else impacted with this on the forums at least. A corner case it would seem.

Like I said several times here a lot of people were impacted:
https://www.reddit.com/r/openSUSE/comments/re5akg/comment/ho71dnu

That’s a 4 ry old thread. Hardly relevant to current IMHO, and in fact if running JACK or ALSA-only, it is what you’d want to achieve.

Fallout from using deprecated YaST Sound I suspect… zero issues here.

1 Like

It is very relevant and helped me to enable sound after upgrades all this time.

Quite possible.

Well, glad that you identified the environment variable that needed correcting on your system. It would be good to know it came to be. As I said, I’ve not seen it before here.

I’d raised this topic several times here for years - look at my history.

No I won’t be doing that, just as I don’t expect others to search my numerous topic history. Just be glad you’ve found the cause of the issue on your system :wink:

No. This machine has TW installed on Nov 8 2023, I am sure I never touched YaST to configure anything, and it has:

knurpht@Lenovo-P16:~> grep PULSE /etc/sysconfig/sound 
PULSEAUDIO_ENABLE="yes"
PULSEAUDIO_SYSTEM="no"
knurpht@Lenovo-P16:~>

That said, the file sound does get touched by something else, no idea what, I definitely did not edit it myself:

knurpht@Lenovo-P16:~> ls -l /etc/sysconfig/sound 
-rw-r--r-- 1 root root 1889  4 mrt 03:20 /etc/sysconfig/sound
knurpht@Lenovo-P16:~> 

where, IIRC one of the first things I did was set it to use pipewire instead of pulseaudio ( this may even not have been on this laptop but on the one I bought in 2021.)

See /var/log/zypp/history:

# 2026-03-04 00:30:05 alsa-1.2.15.3-1.2.x86_64.rpm installed ok
# Additional rpm output:
# Updating /etc/sysconfig/sound ...
# 
2026-03-04 00:30:05|install|alsa|1.2.15.3-1.2|x86_64||openSUSE:repo-oss|b8ff4b7dae9d97fd3adeb44bb18750ee38c425c3886d08cb6a69e3b25960953948e51661c59a6a91e36e4a500cbcd42bcfd96cfbebf5cef2fd8fc026ef536769|

Thanks, I had not gotten to that.

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