Page 1 of 1

How I installed PulseAudio

Posted: Wed Jun 15, 2022 4:37 am
by Phoenix

So quite awhile ago, I remember seeing a topic mentioning trying to install PulseAudio to no avail.

I decided to try, for 1 month in total.
Here is how you do it:

  1. Download/Install PulseAudio, whatever method you prefer. Preferably you want to not overwrite the libraries in /usr/lib due to this immediately breaking a couple of applications if you were to remove it later or while it existed. (Unless PPM has gotten more intelligent such as removing via the rewritable layer and not the union layer)
  2. Invoke PulseAudio as PULSEAUDIO_SYSTEM_START=1 pulseaudio --disallow-exit --exit-idle-time=-1
    2a. You may add -D to the flags if you want it to become a daemon and not have it hog a terminal.
    2b. If you decided to keep it separate and place it else where please use LD_LIBRARY_PATH on all executables of PulseAudio unless you want to have library linking issues and problems with symbols.

What does this do? It sets a variable, although I am not certain whether I need it anymore. Better to keep it. --disallow-exit will stop user exits besides CTRL-C and killall/kill and I suppose the kernel killing it off. --exit-idle-time=-1 stops the infuriating behavior of PulseAudio suddenly exiting because it idled too long.

Notes:

  • --system is a big lie and the issues opened are still pending. It switches to pulse user and then subsequently set its own files to the only other user, root and even sets permission bits (700) such that its own files are inaccessible to it. Now, yes, you could chmod and chown it back but it will keep doing this modification and fail on pretty much every task requested of it. Just don't do it. Ignore the warning.
  • PulseAudio may or may not load the module module-alsa-card to intercept ALSA and bring all the nice functionality that would be expected of it. (And most Linux distributions) This requires editing the configuration in that case to un-comment the line for loading the module in the default.pa.
  • PulseAudio and ALSA/Puppy Linux do not sync states. While its all fine and dandy on Ubuntu and others. Puppy Linux is not. So this means if PulseAudio suddenly ends and you left it at max before using PulseAudio you will be blasted with sound. The opposite could happen with PulseAudio being mute and you decide to bring it up later rather than use a startup script. Then you'll be wondering what just happened.

Template for startup script:

Code: Select all

export PULSEAUDIO_SYSTEM_START=1
pulseaudio --disallow-exit --exit-idle-time=-1

EDIT: 1


Re: Installing PulseAudio

Posted: Wed Jun 15, 2022 3:42 pm
by dancytron

Just for reference, I got pulseaudio set up in Debian Dog with systemd using the --system method.

https://forum.puppylinux.com/viewtopic. ... f10#p52790


Re: Installing PulseAudio

Posted: Thu Jun 16, 2022 12:44 am
by mistfire

Just use QuickPup64, it has PulseAudio already builtin
https://forum.puppylinux.com/viewtopic.php?t=3171


Re: Installing PulseAudio

Posted: Thu Jun 16, 2022 1:11 am
by BarryK

Phoenix,
Your post has reminded me of the "fun" I had changing to pulseaudio in EasyOS. Getting it to play nice with alsa-only apps was a challenge. Still haven't got it quite right.


Re: Installing PulseAudio

Posted: Sat Jun 18, 2022 2:39 am
by Phoenix
mistfire wrote: Thu Jun 16, 2022 12:44 am

Just use QuickPup64, it has PulseAudio already builtin
viewtopic.php?t=3171

Not all puppies have systemd, nor do some come with PulseAudio. This mostly concerns puppies that don't come with it out of the box.


Re: Installing PulseAudio

Posted: Sat Jun 18, 2022 2:14 pm
by dimkr
Phoenix wrote: Sat Jun 18, 2022 2:39 am
mistfire wrote: Thu Jun 16, 2022 12:44 am

Just use QuickPup64, it has PulseAudio already builtin
viewtopic.php?t=3171

Not all puppies have systemd, nor do some come with PulseAudio. This mostly concerns puppies that don't come with it out of the box.

And those that do come with PulseAudio pre-installed don't support it equally well.

A Puppy built today with today's woof-CE will start a D-Bus "session bus" for spot (https://github.com/puppylinux-woof-CE/w ... initrc#L48), run PulseAudio as spot while using this session bus instead of root's one or the system bus (https://github.com/puppylinux-woof-CE/w ... initrc#L69) and all applications running as either root or spot are configured to use spot's PulseAudio instance (https://github.com/puppylinux-woof-CE/w ... initrc#L70). Bluetooth audio support (i.e. via Blueman) works seamlessly because Blueman uses the same session bus.

(This setup is very similar to the way PulseAudio works on other distros, which start PulseAudio as a systemd user service, but without the systemd dependency and without the root/logged-in user distinction)

Without these 3 lines, applications running as spot can't play audio via PulseAudio (unless you do something really ugly like allowing them to talk to a PulseAudio instance running as root, which may have security implications) and applications that expect you to have a session bus (like some tray applets, including some PulseAudio volume thingies) won't work at all or won't work when running as spot.


Re: How I installed PulseAudio

Posted: Sat Jun 18, 2022 3:59 pm
by rockedge

@dimkr I suddenly realize that I don't think I ever tested if the pulseaudio sound works in any other user that's not the root user in KLV-Airedale.


Re: How I installed PulseAudio

Posted: Sat Jun 18, 2022 5:25 pm
by dimkr
rockedge wrote: Sat Jun 18, 2022 3:59 pm

@dimkr I suddenly realize that I don't think I ever tested if the pulseaudio sound works in any other user that's not the root user in KLV-Airedale.

Maybe you should invest in getting PipeWire to work, instead. Some woof-CE builds already use PipeWire instead of PulseAudio and it works great.

PipeWire (via pipewire-pulse and WirePlumber) support is implemented in https://github.com/puppylinux-woof-CE/w ... initrc#L51 and PulseAudio clients (Blueman, browsers, pavucontrol, etc') work just fine.


Re: How I installed PulseAudio

Posted: Sat Jun 18, 2022 7:45 pm
by rockedge

I will try a build of KLV with pipewire and see what I can do with a woof-CE Puppy build with pipewire integrated.


Re: How I installed PulseAudio

Posted: Sat Jun 18, 2022 9:52 pm
by mistfire
rockedge wrote: Sat Jun 18, 2022 7:45 pm

I will try a build of KLV with pipewire and see what I can do with a woof-CE Puppy build with pipewire integrated.

I tried Pipewire on my QuickPup64, it works nicely however the problem was automatic switching of audio outputs. When you plugged in a headset on headphone jack or usb, the audio won't go to the headset immediately. You need to set the output manually on pavucontrol


Using Pipewire vs PulseAudio

Posted: Sun Jun 19, 2022 2:22 am
by Clarity

@mistfire & @rockedge, does WirePlumber (on a Pipewire system) offer the advantage you'd want with headset (and others) use?

Curious


Re: How I installed PulseAudio

Posted: Sun Jun 19, 2022 11:57 pm
by mistfire
Clarity wrote: Sun Jun 19, 2022 2:22 am

@mistfire & @rockedge, does WirePlumber (on a Pipewire system) offer the advantage you'd want with headset (and others) use?

Curious

Pipewire has lower latency compared to PulseAudio. PipeWire handles video streams too like PulseAudio but in video, that's why the early name of PipeWire was PulseVideo