Created attachment 139767 [details] Video demonstration "Audio Volume" applet creates double stream for volume meters on the first launch, but only frees one. This leads to CPU consumption and can be solved by "pulseaudio -k" command. Video attached. STEPS TO REPRODUCE 1. Disable "Audio Volume" entry in the System Tray Settings. 2. Logout and Login. 3. Open "PulseAudio Volume Control" and switch to "Recoring" tab. 4. Re-enable "Audio Volume" entry in the System Tray Settings. 5. Open on close "Audio applet". OBSERVED RESULT Double stream per device. EXPECTED RESULT One stream per device. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 21:04 (available in About System) KDE Plasma Version: 5.22.2 KDE Frameworks Version: 5.83.0 Qt Version: 5.15.2
I have a couple of observations without any concrete answers. 1) On startup there's a "preloading" path that happens a few seconds after boot, which effectively loads the fullscreen representation of each window. For some (broken) reason this leads to target ``` VolumeMonitor { id: meter target: parent.visible ? model.PulseObject : null } ``` getting set and immediately unset. parent.visible should be false throughout preloading, 2) That doesn't fully explain the end result. It does get unset, our cleanup method does get called and that does unref the stream. That works fine in all future invocations, just not the first one.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-pa/-/merge_requests/73
Git commit 5a0d555fa98ebf09bb81aebdd43713b2c9cb922d by David Redondo. Committed on 02/07/2021 at 14:41. Pushed by davidre into branch 'master'. Always disconnect streams When the stream creation is not finished, disconnecting will fail. We have to defer disconnecting until the stream is ready. Setting the callbacks to nullptr was treating a symptom, if the stream is freed they are also unset. FIXED-IN:5.22.3 M +11 -1 src/volumemonitor.cpp https://invent.kde.org/plasma/plasma-pa/commit/5a0d555fa98ebf09bb81aebdd43713b2c9cb922d
Git commit 5644f4e7a4c22432d0c09be00eb56713d06c5c67 by David Redondo. Committed on 02/07/2021 at 14:42. Pushed by davidre into branch 'Plasma/5.22'. Always disconnect streams When the stream creation is not finished, disconnecting will fail. We have to defer disconnecting until the stream is ready. Setting the callbacks to nullptr was treating a symptom, if the stream is freed they are also unset. FIXED-IN:5.22.3 (cherry picked from commit 5a0d555fa98ebf09bb81aebdd43713b2c9cb922d) M +11 -1 src/volumemonitor.cpp https://invent.kde.org/plasma/plasma-pa/commit/5644f4e7a4c22432d0c09be00eb56713d06c5c67