#870302 pavucontrol: High CPU usage

Package:
pavucontrol
Source:
pavucontrol
Description:
PulseAudio Volume Control
Submitter:
"Nelson A. de Oliveira"
Date:
2022-05-09 07:00:04 UTC
Severity:
normal
Tags:
#870302#5
Date:
2017-07-31 19:48:37 UTC
From:
To:
Hi!

I saw that pavucontrol uses about 2.4% ~  3.3% of CPU without doing
anything (when nothing is playing a sound in the computer).

Trying to see what is happening with strace there is a lot (really a
lot) of polling:

=====
read(12, "\1\0\0\0\0\0\0\0", 8)         = 8
getpid()                                = 23673
getpid()                                = 23673
getpid()                                = 23673
getpid()                                = 23673
write(10, "\1\0\0\0\0\0\0\0", 8)        = 8
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}], 5, 0) = 0 (Timeout)
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}], 5, 19980) = 1 ([{fd=12, revents=POLLIN}])
read(12, "\1\0\0\0\0\0\0\0", 8)         = 8
getpid()                                = 23673
getpid()                                = 23673
getpid()                                = 23673
getpid()                                = 23673
write(10, "\1\0\0\0\0\0\0\0", 8)        = 8
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}], 5, 0) = 0 (Timeout)
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}], 5, 0) = 0 (Timeout)
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="5\30\4\0sE\300\1\3\0\300\1\223\3\n\0\213\4\6\0tE\300\1sE\300\1*\0\0\0"..., iov_len=1608}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 1608
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLIN}], 5, 20000) = 1 ([{fd=12, revents=POLLIN}])
(...)
=====

Maybe this could somehow be improved?
Wasting CPU for polling like this doesn't seem so right.

Thank you!

Best regards,
Nelson

#870302#10
Date:
2020-02-12 11:56:33 UTC
From:
To:
after some uptime (not two days yet)

i can see that as well:
  PID USER   RI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
nnnn me     20   0  725M 27488 19100 S 12.3  0.0  2h42:36 pavucontrol

#870302#15
Date:
2022-05-09 06:57:44 UTC
From:
To:
Deselecting the "Show volume meters" option at the bottom of
the Configuration tab avoids the issue.

But with it being selected, the high CPU usage occurs even in tabs
where no volume meters are shown, such as the Configuration tab
(and in the Playback tab when nothing is played).

The issue is that this activates the fan of my laptop, with probably
battery drain when on battery.