Pipewire. Disable suspend of sink

I need some way to make the audio system NOT suspend the output. Here’s the output of pactl list short sinks when I have something running:

147     alsa_output.pci-0000_0a_00.1.hdmi-stereo        PipeWire        s32le 2ch 48000Hz       RUNNING
148     alsa_output.pci-0000_0c_00.4.iec958-stereo      PipeWire        s32le 2ch 48000Hz       SUSPENDED

This is it right when audio stops being used:

147     alsa_output.pci-0000_0a_00.1.hdmi-stereo        PipeWire        s32le 2ch 48000Hz       IDLE
148     alsa_output.pci-0000_0c_00.4.iec958-stereo      PipeWire        s32le 2ch 48000Hz       SUSPENDED

And here it is about 7 seconds later:

147     alsa_output.pci-0000_0a_00.1.hdmi-stereo        PipeWire        s32le 2ch 48000Hz       SUSPENDED
148     alsa_output.pci-0000_0c_00.4.iec958-stereo      PipeWire        s32le 2ch 48000Hz       SUSPENDED

How can I make it never suspend on idle?
Already added node.suspend-on-idle = false in the stream.properties of /usr/share/pipewire/client.conf to no effect.

This is my primary reason I can’t use Linux on my daily browsing, not even considering gaming. Previously on Ubuntu I also tried the answers people gave for PulseAudio since it used that, and that also didn’t work.

Do not ask stupid questions like “why” unless you’re willing to buy me a replacement 43-inch TV-monitor.

Why?
:speech_balloon:

:nerd_face:

PS. me sending some crypto your way :crazy_face:

I think “why” is a fair question sometimes since a deeper understanding of the actual issue being experienced may help to furnish a fuller solution.

There are many ways to skin a cat, as they say :smile:

Because my monitor has a 5 second initialization for the sound. This start-stop behavior not just robs me of the sound, but also triggers an annoying overlay on the screen. I have never had this problem under Windows, but it makes Linux unusable due to frustration.

That does sound frustrating!

Assuming you’re using wireplumber alongside pipewire, you may want to try editing suspend-node.lua in /usr/share/wireplumber/scripts/node -

    -- Add a timeout source if idle for at least 5 seconds
    if new_state == "idle" or new_state == "error" then
      -- honor "session.suspend-timeout-seconds" if specified
      local timeout =
          tonumber(node.properties["session.suspend-timeout-seconds"]) or 5

      if timeout == 0 then
        return
      end

Change the 5 to 0, then restart the service and see if the issue persists?

edit and change ~/.config/pipewire/pipewire-pulse.conf to have the next line
pulse.idle.timeout = 0 # pause after 5 seconds of underrun

edit and change ~/.config/wireplumber/wireplumber.conf.d/51-disable-suspension-xx1.conf (give youyr own name) to have the following settings:

monitor.alsa.rules = [

{
matches = [
{
## Matches all sources.
node.name = “alsa_input."
node.name = "alsa_output.

}
]
actions = {
update-props = {
## 0 disables suspend
api.alsa.use-chmap = false
api.alsa.headroom = 16384
session.suspend-timeout-seconds = 0
}
}
}

{
matches = [
{
node.name = “alsa_output.pci-0000_00_1f.3.hdmi-surround71”
}
{
node.name = “alsa_output.usb-GeneralPlus_USB_Audio_Device-00.analog-stereo”
}
]
actions = {
update-props = {
session.suspend-timeout-seconds = 0
}
}
}

]

If you do your own equalizers in ~/.config/pipewire/pipewire.conf, then these sinks should also be
disabled suspend function.

    node.name = "Lv2_EQ16-Rock_input"
    node.name = "Lv2_EQ16-Ska_input"
    node.name = "Lv2_EQ16-Soft_input"
    node.name = "Lv2_EQ16-Techno_input"
    node.name = "Lv2_EQ16-Highno_input"
    node.name = "surround-Lad_input"
    node.name = "surround-lv2_input"
    node.name = "Reverb_input"
    node.name = "Reverb_Delay_input"
    node.name = "Lv2_Airwindow-tube2_input"
    node.name = "Lv2_Airwindow-drumslam_input"
    node.name = "Lv2_Airwindow-purestdrive_input"
    node.name = "Lv2_Airwindow-slew_input"
    node.name = "Lv2_Airwindow-srsly2_input"
    node.name = "Lv2_Airwindow-spiral_input"

Neither of these worked, even though I replaced the node.name with the one from my listing.
However you did point me to look in the wireplubmer config, and I found something that worked.

I edited /usr/share/wireplumber/wireplumber.conf
commented out the loading of the suspend-node.lua script, and removed it from the “wants” of “policy.node” a few rows below.

Ran

systemctl --user restart pipewire wireplumber

and now I have sound working all the time!

The dumbest thing I learned here when I went in the source code before the replies is that they’re calling the output a “source”, and the input a “sink”. Their “source” is literally the opposite of a source! It’s a target/destination.

1 Like

Congratulations! I’m just glad you got there haha :laughing:

The frustrating thing is that as a user, I shouldn’t have to know any of these words: pipewire, pulseaudio, wireplumber.

If I was your average user, this would just mean I’m stuck with Windows as my only option. Normal people won’t even know to look for this. The most concise description they could give is “audio turning off after 5 seconds”.

Perhaps you have wrong expectations of the distro you have chosen to use and that is the reason for your frustration?

Archlinux and by extension EndeavourOS are Do It Yourself distros:

Whereas many GNU/Linux distributions attempt to be more user-friendly, Arch Linux has always been, and shall always remain user-centric. The distribution is intended to fill the needs of those contributing to it, rather than trying to appeal to as many users as possible. It is targeted at the proficient GNU/Linux user, or anyone with a do-it-yourself attitude who is willing to read the documentation, and solve their own problems.

All users are encouraged to participate and contribute to the distribution. Reporting and helping fix bugs is highly valued and patches improving packages or the core projects are very appreciated: Arch’s developers are volunteers and active contributors will often find themselves becoming part of that team. Archers can freely contribute packages to the Arch User Repository, improve the ArchWiki documentation, provide technical assistance to others or just exchange opinions in the forums, mailing lists, or IRC channels. Arch Linux is the operating system of choice for many people around the globe, and there exist several international communities that offer help and provide documentation in many different languages.

source

[…] we are aiming for a Linux user with an intermediate level of knowledge who likes to handle a system that needs hands-on customization from the get-go, with the help of our main standout feature: Our vibrant and friendly community.

https://endeavouros.com/about-us/

With that out of the way, welcome to the community @coladict ! Hope you enjoy your system and your time here!

1 Like

Most of us are just average users. :smirk:

Late to the party but this could have been a simple solution:

edit /usr/share/pipewire/media-session.d/media-session.conf
Comment (#) out this line: suspend-node

Perhaps you have wrong expectations of the distro you have chosen to use and that is the reason for your frustration?

It’s the same with every distro! I couldn’t get it fixed under Ubuntu - the “user-friendly” distro, which used PulseAudio, and I doubt this is at all distro-dependent.

edit /usr/share/pipewire/media-session.d/media-session.conf
Comment (#) out this line: suspend-node

There’s nothing to comment out, because it doesn’t exist. This is the out-of-the-box experience.

1 Like

Mm that might been changed, i haven’t used this in a while

I concur with coladict here, my system is largely stock EOS so I just had a look for curiosity’s sakes and I also have no such .conf file :slightly_smiling_face:

But alongside that, I must also echo pebcak’s comments. How does that famous speech go again?

“We choose to go to the moon install and maintain Linux distros, not because it is easy, but because it is hard.”

1 Like

It doesn´t exist because EOS uses wireplumber and not pipewire-media-session as session manager.
The file to be edited is not below /usr but in ~/.config/wireplumber/main.lua.d/

Ah that makes sense indeed!
Thanks

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