How to safely disable pulseaudio the Qubes way?

Hello!

My laptop running Qubes OS, when idle, is still too hot and consuming much of battery power, comparing to idle Windows. The “top” command shows pulseaudio and pacat-simple-vc are the two processes each using 5% of CPU time.

I have searched internet but mostly found articles not related to Qubes OS with warning about packages’ dependency on pulseaudio, so I do not dare just purging that package from dom0. Info on this Qubes Forum are rather about how to make pulseaudio works, not the opposite.

How can I safely disable pulseaudio the Qubes way? Or ideally how can I remove all audio-related components from dom0, including microphone? Disabling audio/mic in BIOS unfortunately is not an option, I still need audio when not using Qubes OS.

Thanks

You can disable pulseaudio socket and service in dom0.

The better question is how to get 0% CPU consumption by pulseaudio in case of nothing being played at the moment. Maybe this issue is part of the reason why Qubes OS makes much more fan noise and spend battery much faster on idle on laptops compared to other OSes.

the Qubes way

In this case, you should create sys-audio qube, then you will be able to simply stop it: Debian-minimal template for sys-audio

What I did was disabling pulseaudio service and socket in dom0, as well as setting default audiovm to “none” (all VMs are using this default setting). The CPU usage went down a little bit, but the computer is still hot with the fan running noisily. If I remember well, in the now-unsupported Qubes 4.0 there was no such issue. Dom0 when idle was using between 0% to 1% of CPU, not around 4%-8% even without pulseaudio service and socket running, like now.

Regarding setting up sys-audio, I have not tried it yet. It sounds odd to me. I thought, like netvm, if I specify what a VM’s audiovm should be, would that audiovm be started up automatically when the said VM is about to start?

Are you certain that the issue is being hot, not noisy? I am asking because when I start Qubes OS it makes fan noise on idle, while I have no noise on Kubuntu in idle. The solution in my case was to install thinkfan package and start it. Even with default config the fans got silent during idle. So, maybe you have the same issue?

I started this topic because my concern is Qubes is wasting resources in general. But a general complain is no good, so I picked up one specific issue: The pulseaudio.

My problem is not with the noise, but with the heat. The noisy fan is just a consequence of the heat problem that in turn is the consequence of a poorly written software, combined with a poorly made decision (using that software). The fan runs for a reason, and telling it to run slower (for less noise) would only make the heat problem worse. I prefer such a “solution” that deals with the core of the problem: The wastefulness of poorly written software component (pulseaudio in this case).

OK, can you please elaborate where do you see pulseaudio consuming 5% of CPU? In top of dom0? In xentop? In top of some qube? Is it 5% of all cores or 5% of one core (1 out of 8, for example)?
Because I cannot confirm this problem on R4.1. I do not see pulseaudio in top on idle at all, only top itself and Xorg with ~1% CPU.

Maybe I do not get you point, but what are you trying to tell? Not to “dnf remove pulseaudio”?

This pulseaudio reminded me what M$ guys did with Internet Explorer: They made everything depend on it, so they could say it was the unremovable part of the OS. Linux guys seem to love what M$ guys did, hence this pulseaudio. History always repeats itself, huh?

I saw it in dom0 with “top” command. I have disabled and masked pulseaudio.services and pulseaudio.socket, so they are not running now, thus I have no screenshot to show you. The 5% CPU usage is my computer-specific. If you have a powerful rig, it might be just 0% or 1%. These numbers mean nothing out of context.

By “idle” I did not mean there was no appVMs running. Actually there were quite a few appVMs, but they were in idle state too, not doing any hard stuff on the CPU. Each appVM consumed 0% of CPU time (you can see that by clicking on the blue cube icon near the clock), only dom0 was using more than 10%. That was why I ran “top” in dom0 and saw “pulseaudio” among other at the top of the list.

What I am talking about here is “comparing to other OS” - on my same machine, of course. If Windows people can have audio without using that much as 5% of CPU power on idle, then we definiately are having problems here.

My original question has been partly answered, I disabled pulseaudio “safely” - at least I beleive it was safe.

The other part is “the Qubes way” that I did not try out yet, I would like to hear some explanations or some experiences from those who already done it.

Well, I have 20 qubes running, blue-icon-qube tray widget shows 0% for all of them if I am not moving mouse. Qubes have instances of Firefox with opened and loaded tabs, thunderbird and other stuff. No qube is playing media, of course at that moment.

I understand your point that pulseaudio-related part of Qubes OS should have almost zero CPU usage when nothing is played. I have situation like that on a PC (not laptop), so, maybe the issue with pulseaudio can be addressed differently in your case.

I simply linked a relevant known Issue, which tells that it’s not easy to remove Pulseaudio at the moment.