marioortizmanero / polybar-pulseaudio-control

A feature-full Polybar module to control PulseAudio
MIT License
478 stars 49 forks source link

"Pluseaudio not started" error produces high CPU load for polybar #86

Open tariqc80 opened 7 months ago

tariqc80 commented 7 months ago

Occasionally upon system startup pulseaudio-control returns "Pulseaudio not started" in polybar. If I run the commands manually from the terminal I do get the expected volume percentages. I have to restart polybar one or two times to get this to resolve.

When this occurs, my system CPU increases to 30%+ and top reports polybar's CPU utilization is something like 7-8% instead of it's normal 0.6-0.7%. Once I restart polybar and correct the "Pulseaudio not started" error, CPU utilization returns to normal.

This only seems to happen intermittently when I start up my system or when I wake from sleep. My assumption is that there is some race condition.

Seems to be two things happening here though:

  1. pulseaudio-control listen is losing communication with pulseaudio, even though pulseaudio is running
  2. Polybar or pulseaudio is going haywire when it is in this state.

Let me know what other information I can provide to help to identify what the issue is.

This is my setup

[module/pulseaudio-control-input]
type = custom/script
tail = true
double-click-left = exec pavucontrol &
exec = pulseaudio-control --node-nicknames-from "device.description" --node-nickname "alsa_input.pci*: " --node-type input --icon-muted  --icons-volume "" --format '$VOL_ICON ${VOL_LEVEL}% $ICON_NODE $NODE_NICKNAME'  listen

[module/pulseaudio-control-output]
type = custom/script
tail = true
double-click-left = exec pavucontrol &
exec = pulseaudio-control --node-nicknames-from "device.description" --node-nickname "alsa_output.pci*:󰓃" --node-type output --icon-muted  --icons-volume " " --format '$VOL_ICON ${VOL_LEVEL}% $ICON_NODE $NODE_NICKNAME'  listen