Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.77k stars 709 forks source link

Pulseaudio: Too many open files #3537

Open keremenci opened 3 months ago

keremenci commented 3 months ago

I have a nested group containing pulseaudio and pulseaudio/slider file in my waybar config. When I uncomment the group, memory usage spikes up to fill all ram and triggers oom-killer on waybar process.

This usually happens when the system has been left open for some time. For example, current error is from a system uptime of 11 days.

modules.json

  "group/sys-info": {
    "modules": [
      "network",
      "group/volume"
    ],
    "orientation": "horizontal"
  },
  "group/volume": {
    "drawer": {
      "children-class": "volume",
      "transition-duration": 500,
      "transition-left-to-right": true
    },
    "modules": [
      "pulseaudio",
      "pulseaudio/slider"
    ],
    "orientation": "horizontal"
  },

The waybar output is as follows:

[2024-08-21 09:24:40.488] [info] Bar configured (width: 1920, height: 57) for output: HDMI-A-1
[2024-08-21 09:24:40.488] [info] Bar configured (width: 1920, height: 57) for output: DP-1
Failed to create secure directory (/run/user/1000/pulse): Too many open files
Failed to create secure directory (/run/user/1000/pulse): Too many open files
terminate called after throwing an instance of 'std::runtime_error'
socket(): Too many open files

Output of running lsof and counting open files couple of seconds after launching waybar. The lsof.log is populated by a very large number of /memfd:pulseaudio file descriptors.

$ waybar & disown
$ lsof > lsof.log
$ cat lsof.log | awk '{ print $2 " " $1; }' | sort -rn | uniq -c | sort -rn | head -20

 556173 199804 waybar
  70104 1411 spotify
  33800 1252516 opera
  24050 2131677 opera
  19216 1236 Hyprland
  18270 1252554 opera
  17056 2568 Discord
  15824 2152815 code
  12312 2202576 postman
  11556 1413 electron
  10080 1415 Discord
   8800 1252556 opera
   8190 2133 electron
   7506 1255601 opera
   7028 1980 Discord
   6090 2202684 postman
   5940 2202623 postman
   5850 2055 spotify
   5307 3570615 opera
   5208 3425407 opera

Running on Arch Linux with Hyprland

Nikola-Milovic commented 3 weeks ago

Any update on this? Any solution?