How I installed PulseAudio

Moderator: Forum moderators

Post Reply
User avatar
Phoenix
Posts: 339
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

How I installed PulseAudio

Post 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

IRC: firepup | Time to hack Puppy!

dancytron
Posts: 653
Joined: Fri Dec 13, 2019 6:26 pm
Has thanked: 422 times
Been thanked: 190 times

Re: Installing PulseAudio

Post 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

mistfire
Posts: 650
Joined: Thu Jul 16, 2020 2:16 am
Location: CALABARZON, PH
Has thanked: 3 times
Been thanked: 143 times

Re: Installing PulseAudio

Post by mistfire »

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

User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: Installing PulseAudio

Post 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.

User avatar
Phoenix
Posts: 339
Joined: Fri Feb 12, 2021 2:03 am
Location: Canada
Has thanked: 4 times
Been thanked: 48 times

Re: Installing PulseAudio

Post 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.

IRC: firepup | Time to hack Puppy!

dimkr
Posts: 1905
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 36 times
Been thanked: 827 times

Re: Installing PulseAudio

Post 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.

User avatar
rockedge
Site Admin
Posts: 5714
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1994 times
Been thanked: 2097 times
Contact:

Re: How I installed PulseAudio

Post 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.

dimkr
Posts: 1905
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 36 times
Been thanked: 827 times

Re: How I installed PulseAudio

Post 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.

User avatar
rockedge
Site Admin
Posts: 5714
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1994 times
Been thanked: 2097 times
Contact:

Re: How I installed PulseAudio

Post 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.

mistfire
Posts: 650
Joined: Thu Jul 16, 2020 2:16 am
Location: CALABARZON, PH
Has thanked: 3 times
Been thanked: 143 times

Re: How I installed PulseAudio

Post 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

Clarity
Posts: 3270
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1347 times
Been thanked: 438 times

Using Pipewire vs PulseAudio

Post by Clarity »

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

Curious

mistfire
Posts: 650
Joined: Thu Jul 16, 2020 2:16 am
Location: CALABARZON, PH
Has thanked: 3 times
Been thanked: 143 times

Re: How I installed PulseAudio

Post 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

Post Reply

Return to “Install”