Pulseaudio module interaction causes crash
Author: SporifCreated Jan 3, 2019Updated Aug 26, 2026
Labelsbug
Describe the issue
If pulseaudio is killed while polybar is already running any future mouse interaction with the pulseaudio module causes a crash of polybar.
To Reproduce
I can reproduce with the stock config with everything but pulseaudio and the example bar removed.
polybar examplepulseaudio -k- Click or scroll on the pulseaudio module
Config:
[colors]
background = #222
background-alt = #444
foreground = #dfdfdf
foreground-alt = #555
primary = #ffb52a
secondary = #e60053
alert = #bd2c40
[bar/example]
width = 100%
height = 27
radius = 6.0
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = misc fixed:pixelsize=10;1
font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = wuncon siji:pixelsize=10;1
modules-right = pulseaudio
tray-position = right
tray-padding = 2
cursor-click = pointer
cursor-scroll = ns-resize
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume = VOL %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = muted
label-muted-foreground = #666
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}Polybar Log
warn: No monitor specified, using "DP-2"
warn: pulseaudio: using default sink alsa_output.pci-0000_00_1f.3.analog-stereo
error: tray: Failed to put tray above 0x0c00001 in the stack (XCB_MATCH (8))
Assertion 'o' failed at pulse/operation.c:133, function pa_operation_get_state(). Aborting.
Aborted (core dumped)Environment:
- WM: i3-gaps
- Output of
polybar -vvv:
polybar 3.3.0
Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard
X extensions: +randr (+monitors) -render -damage -sync +composite +xkb +xrm +xcursor
Build type: RelWithDebInfo
Compiler: /usr/lib/ccache/bin/c++
Compiler flags: -march=native -O2 -pipe -fstack-protector-strong -fno-plt -Wall -Wextra -Werror -Wno-noexcept-type -pedantic -pedantic-errors
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,nowSource: polybar/polybar