Page 1 of 1

EEK. Ubuntu studio using system wide instance of pulseaudio

Posted: Tue Jul 23, 2019 1:00 pm
by millerthegorilla
In ubuntu studio disco dingo, pulseaudio is listed as being a child process of systemd (using pstree).

However, I cannot find any reference to a systemd unit file.

I am relatively certain that I have always been advised to never run pulsaudio as a system wide instance, for security reasons.

I also am unable to stop pulseaudio from autospawning - I have edited the /etc/pulse/client.conf, and created a .config/pulse/client.conf with autospawn=no.
I have tried a systemctl command I found on the net:
sudo systemctl --global disable pulseaudio.service pulseaudio.socket
but to no avail.
Is there anyone who knows if it is possible to stop pulseaudio, without removing it?
Cheers, I only have 16 gigs of ram so don't want to continue running out of memory, because of the badly configured system.
I wish kxstudio were alive still. I might even try the 16.04 QT4 release just for the sake of it.
Oh well.

Re: EEK. Ubuntu studio using system wide instance of pulseaudio

Posted: Tue Jul 23, 2019 1:23 pm
by sysrqer
It's probably set up to run as a user service:

Code: Select all

sudo systemctl --user disable pulseaudio.service && sudo systemctl --user disable pulseaudio.socket
I can't imagine that pulseaudio is going to make much difference to your ram usage though.

Re: EEK. Ubuntu studio using system wide instance of pulseaudio

Posted: Tue Jul 23, 2019 1:58 pm
by khz
<IMHO>Using two soundservers at the same time does not make sense for a LAW. Additionally, using pulseaudio consumes more processes resulting in CPU, Ram, ... no matter how much.</IMHO>
I do this via qjackctl as a user as described in my signature "Debian ...".
Jack without pulseaudio:
  • Setup >> Options > [X] Execute script at startup: "systemctl --user stop pulseaudio.socket && systemctl --user stop pulseaudio.service"
  • Setup >> Options > [X] Run script after shutdown: "killall -9 jackdbus && systemctl --user start pulseaudio.socket && systemctl --user start pulseaudio.service")

Re: EEK. Ubuntu studio using system wide instance of pulseaudio

Posted: Tue Jul 23, 2019 2:01 pm
by nikgnomicradio
millerthegorilla wrote:I have always been advised to never run pulsaudio as a system wide instance, for security reasons.
Pulseaudio documentation confirms it is usually not good to run Pulseaudio as system-wide daemon
But Pulseaudio running under systemd is not running as system-wide daemon
it still uses daemon.conf and dafault.pa configuration and ignores system.pa
running as user@1000 allows some secure root access for some Pulseaudio functions
(I believe this is for network streaming and some interaction with Xserver, but I do not use pulseaudio functions that need this)

the systemd services can be checked with:

Code: Select all

systemctl --user status pulseaudio.service pulseaudio.socket
to stop Pulseaudio autospwaning need to disable pulseaudio.socket first:

Code: Select all

systemctl --user disable pulseaudio.socket --now
then disable the pulseaudio.service:

Code: Select all

systemctl --user disable pulseaudio --now
But there should be no need to disable Pulseaudio and/or autospawning
A modern Linux system is more than capable of managing JACK and Pulseaudio with D-Bus
and even without D-Bus, usually only need to suspend Pulseaudio if it gets in the way of JACK:

Code: Select all

pacmd suspend 1

Re: EEK. Ubuntu studio using system wide instance of pulseaudio

Posted: Tue Jul 23, 2019 3:16 pm
by millerthegorilla
Thanks for your detailed reply, #nicgnomicradio.

I didn't think to check the --user flag of systemd, I only know of one other app that uses it, which profile-sync-daemon.

I have removed pulseaudio. As I did, it took ubuntustudio-controls, and all of the ubuntu theming, the desktop, menu etc.
in fact all of this went....
indicator-sound* osspd* osspd-pulseaudio* pulseaudio* pulseaudio-module-bluetooth* pulseaudio-module-jack* ubuntustudio-audio* ubuntustudio-controls* ubuntustudio-default-settings* ubuntustudio-desktop* ubuntustudio-desktop-core* ubuntustudio-installer* ubuntustudio-menu* ubuntustudio-video*

I guess I was supposed to leave it, but what I did was install the kxstudio repos and then update, upgrade and install cadence.
I've now got the same config, but with 40% dsp load and no xruns. Go figure.
I use older equipment so I have to be quite strict about what runs and what doesn't, and I haven't found anything that works quite as well as falktx's versions of software when it comes to low jitter, low latency etc.
So, now to install the menu and plugins and hopefully it will work.
I like pulseaudio for the use of listening to audio from the web browser and stuff, but I'm relatively certain that I can still do that with alsa and chromium. I hope it works cause I want to sample from it.
Anyway, thanks all.

Re: EEK. Ubuntu studio using system wide instance of pulseaudio

Posted: Tue Jul 23, 2019 8:28 pm
by English Guy
I am still disabling pulse as it did interfere and cause xruns

I set it so it does not respawn and put commands to stop and start it within my qjackctl setup

I think you can also use the services command to stop it. I use services and kill everything I don't need before a session.