Page 1 of 3

What is the point of PulseAudio?

Posted: 2018-04-15 10:03
by Funkygoby
Lately, I moved my Debian box from Jessie to Stretch. I use this box for android dev and wine-based gaming. I bind my physical vol-/+ buttons to the pulseaudio master sink and leave specifics programs levels at 100%.

1. The sound from a game (through wine) was very faint although I was spamming vol+ button. According to pulseaudio gui interface, nothing was muted but the volume was ~600% (yes, 600%! not 60%) and increasing each time I would push the vol+ button.
Using the mouse to move the slider suddenly brought volume to 90-100% range and also, blasted my ear with full volume.
2. Trying to set my game to 100% AND my master/sink volume to ~20%, I quickly discovered that they were "linked" and couldn't be dissociated.
The solution lies in PA config file, where you have to disable "flat volumes".

I though that pulseaudio was about providing a cool interface for input and output devices, like earphones maybe. But
- allowing volume to go up "silently" to 600%, then suddenly go "full blast" while the user bring back the slider seems very un-userfriendly to me.
- about "flat volumes", what is the point of providing an interface where you can control each program input/output separately, but at the same time, remove the possibility to control volume separately? What is left? I am missing something?

I tried to give pulseaudio a fair trial.
- As a noob, I want audio to work and easy interface if I need to set things up. Pulseaudio failed here, messed up the process of simply settings audio volume.
- As an experimented user, maybe I want full control on how to connect my programs. Jack is already there and doing the job just fine.

So pulseaudio breaks things compared to a pure ALSA setup. My question is does it bring any value? Is someone using it to make easy something that was hard with ALSA? Bluetooth maybe?

Re: What is the point of PulseAudio?

Posted: 2018-04-15 10:48
by Wheelerof4te
It's original intention was to create unified soundsystem on Linux desktop that will be easy to configure for wide ranges of software and hardware. What it became is just a layer and wrapper for ALSA. Again, to simplify porting to third-party programs and APIs.

Re: What is the point of PulseAudio?

Posted: 2018-04-15 10:57
by kedaha
Hi, I'd just like to comment:

I use OSS4, for audio, not ALSA. I'd like to remove PulseAudio entirely but for Firefox to work, it must be configured as I mentioned here

While I will always use Debian for my server, I've seriously considered changing to FreeBSD or perhaps Devuan for my desktop because I choose not to use ALSA. However, I've been able so far to continue using OSS4, even though official packages are no longer available in current stable—surprise, surprise—by compiling it myself for stretch. But for Firefox, there's no choice but to use PulseAudio and this I think is true for ALSA too.

For my OSS4 setup, PulseAudio is absolutely pointless except for use with Firefox.

Re: What is the point of PulseAudio?

Posted: 2018-04-15 11:11
by Wheelerof4te
^May I ask, what is your reason for not using ALSA? I know why some don't like PA, I'm curious why boycot ALSA?
Oh, I'd like to point that "I use OSS4 because I want to" is not a reason valid enough. You have that choice, but it defeats the purpose of a good discussion.

Re: What is the point of PulseAudio?

Posted: 2018-04-15 11:34
by Funkygoby
@wheelerof4te
Thank you.
So pulseaudio should have abstracted alsa and oss system and provide another "standard" interface to program. Just like jack and sndio?

@kedaha
I saw your post about oss somewhere else .. can't rememeber.
I use firefox on OpenBSD and I don't have pulseaudio on my session. I believe firefox talks to sndio in my case.

Re: What is the point of PulseAudio?

Posted: 2018-04-15 11:35
by kedaha
@wheelerof4te
My use of OSS4 in preference to ALSA is not a boycott any more than using ALSA could be considered boycotting OSS4; I just prefer the sound quality. There's no accounting for taste, as the saying goes. The same applies to PulseAudio; however, I do think that alternatives ought to be available. For example, I use Firefox but it doesn't imply a boycott of Chromium or other browsers. Similarly, I use a Mate desktop but that's just my choice.
Funkygoby wrote: @kedaha
I saw your post about oss somewhere else .. can't rememeber.
I use firefox on OpenBSD and I don't have pulseaudio on my session. I believe firefox talks to sndio in my case.
Aha!
Thanks for this information. :D

Re: What is the point of PulseAudio?

Posted: 2018-04-15 11:45
by Head_on_a_Stick
PA is used by almost all distributions because it offers a simple, tried and tested method to automate sound configuration in systems with more than one audio output.

@OP: do you only have a single soundcard?

I have a laptop with an HDMI audio output and if plain ALSA is used then sound is directed there automatically and so requires further (hardware-specific) configuration to make sound come out of the laptop speakers.
Funkygoby wrote:The solution lies in PA config file, where you have to disable "flat volumes".
^ This is an example of the "finish" provided by some desktop-orientated distributions when compared to vanilla Debian, a similar situation can be observed in Arch where the derivatives offer such configuration as a USP.

And for the record I have firefox audio working just fine in Arch Linux without PA:

https://software.opensuse.org//download ... age=apulse

It also works without PA in Alpine Linux but I don't need to hack that box :)

Re: What is the point of PulseAudio?

Posted: 2018-04-15 12:08
by Lysander
I think I have been lucky in Debian with PA. I have a relatively high-end sound card so audio sounds great, and I don't really run more than one audio application simultaneously.

PA, in Slackware on the other hand, has given me no end of problems. My low-end netbook has onboard audio so a gfx equalizer was needed to beef up the sound, which PA doesn't have [it was removed from the distro because of instability] so I use alsamixer. PA also cannot play two simultaneous streams in Slackware without amendments being made in asound.conf. Additionally, PA will 'revert' my solutions to its issues once solved.

I've now ended up disabling PA in Slackware and going pure ALSA. I don't think uninstalling PA is the answer though, seeing as it's not necessary and may cause breakage.

Re: What is the point of PulseAudio?

Posted: 2018-04-16 10:33
by Funkygoby
@HOAS
Good point regarding multiple output.
I only have had laptops. Only one output devices per machines.

Concerning the "flat volumes", this was on two pure Debian -stable installs. Does this default config comes from a debian maintainer's choice?

@Lysander
Same for me. I seldom use Debian nowadays and I only have a little experience with PA. Once the stupids default are adjusted, it is working for me. I would like to try jack routing, midi and all the jazz with it to see how it behaves under loads.

Re: What is the point of PulseAudio?

Posted: 2018-04-16 10:55
by bw123
Funkygoby wrote: Concerning the "flat volumes", this was on two pure Debian -stable installs. Does this default config comes from a debian maintainer's choice?
I don't know who had the idea, but the problem with the busted eardrums is documented here.
https://bugs.debian.org/cgi-bin/pkgrepo ... ble#_0_1_4

I was able to get it to stop doing this with one set of speakers, but with two sets the rear speakers always go to 100% on just about any sound action.

The old alsa setup still works fine, and I'd like to see pulseaudio work at least as well since it is integrated into just about everything now.

Re: What is the point of PulseAudio?

Posted: 2018-04-16 14:34
by n_hologram
wheelerof4te wrote:"I use OSS4 because I want to" is not a reason valid enough
Uh, yeah, it is lol. It's his/her own system.

Speaking of OSS4...
Funkygoby wrote:I use firefox on OpenBSD and I don't have pulseaudio on my session. I believe firefox talks to sndio in my case.
Dunno if you have already, but you may find this thread of interest: http://forums.debian.net/viewtopic.php? ... pulseaudio

I haven't read the whole thing because the commends follow like a seesaw of ideas, and because I use Palemoon on Linux (and Firefox on OpenBSD). I feel like there was a firefox-oss package or something at some point. Idk if it's been fully replaced by pulseaudio dependencies.

I also wonder if firefox can be built to utilize oss/alsa direcly rather than using pulse. EDIT: I ran a search through the thread and it looked like mixed results -- again, didn't read the whole thing.

Re: What is the point of PulseAudio?

Posted: 2018-04-16 14:54
by tynman
I suppose there are a number of "points" to Pulseaudio.

I thought one of them was to support multiple applications to write to the sound card simultaneously - i.e., mixing on the fly. As opposed to with ALSA-only, where you would have to set that up on a case-by-case basis, requiring fiddling with config files.

Re: What is the point of PulseAudio?

Posted: 2018-04-17 09:51
by steve_v
Funkygoby wrote:Bluetooth maybe?
I've not tried it in Debian, but bluetooth audio certainly works fine without pulseaudio over in Gentoo.
Wheelerof4te wrote:It's original intention was to create unified soundsystem on Linux desktop that will be easy to configure for wide ranges of software and hardware.
Image
tynman wrote:one of them was to support multiple applications to write to the sound card simultaneously - i.e., mixing on the fly.
ALSA has supported DMIX (and enabled it by default) for years. This was one of the selling points of ALSA over OSS3.
tynman wrote:As opposed to with ALSA-only, where you would have to set that up on a case-by-case basis, requiring fiddling with config files.
DMIX is configured once for each PCM if you do it by hand, automatically for each PCM via dmix:<card>, and automatically for everything if you use the "default" PCM.
"Fiddling with config files" is required only if you want exotic sound routing, and dmixing the output of such is as simple as using the aforementioned dmix:<card> at the end of the chain.

If anyone can tell me how to duplicate all streams to both the analogue jacks (upmixing to 5.1) and to raw PCM over SPDIF (stereo, downmixing if required), with software volume control on the SPDIF output, and with an option to output a52 encoded surround on my second SPDIF jack, with pulseaudio, without noticeable latency, do let me know. Until it can do all the things ALSA can, I really don't see the point of it.
Wheelerof4te wrote:Oh, I'd like to point that "I use OSS4 because I want to" is not a reason valid enough.
Yes, it most definitely is. It's not your box, so it's not your place to comment on personal preference.
Lysander wrote:I don't think uninstalling PA is the answer though, seeing as it's not necessary and may cause breakage.
For me it causes breakage if I don't uninstall it. Certain applications will try it first, starting the daemon, and borking sound for everything.
n_hologram wrote:I also wonder if firefox can be built to utilize oss/alsa direcly rather than using pulse.
Sure it can. Probably more annoying to recompile on Debian than Gentoo, but the alternative, apulse, is pretty easy.

Re: What is the point of PulseAudio?

Posted: 2018-04-17 11:09
by Segfault
software volume control on the SPDIF output
Why? Why people want to do this? The very idea of digital passthru is to preserve the quality by not processing the sound while it is in digital form in any way. All processing should be done after DAC.

Re: What is the point of PulseAudio?

Posted: 2018-04-17 23:17
by steve_v
Segfault wrote:
software volume control on the SPDIF output
Why? Why people want to do this? The very idea of digital passthru is to preserve the quality by not processing the sound while it is in digital form in any way.
Changing the volume of the PCM stream, assuming you have sufficient bit-depth to take the resolution hit, introduces far less unwanted signal degradation than attenuating the analogue side of things, with the nasty pots in most consumer-grade preamps, to achieve the same effect.
The very idea of digital passthrough (in my case) is to get an audio stream from one device to another without shitty noise-prone unbalanced line-level analogue cables.

Re: What is the point of PulseAudio?

Posted: 2018-04-18 09:29
by Innovate
firefox even force pulseaudio otherwise no sound on firefox.
So what's the solution to make it work on firefox if you're using other sound system?

Re: What is the point of PulseAudio?

Posted: 2018-04-18 11:26
by kedaha
Innovate wrote:firefox even force pulseaudio otherwise no sound on firefox.
So what's the solution to make it work on firefox if you're using other sound system?
I mentioned the solution in my reply above for OSS4: I can only obtain sound in Firefox by editing /etc/pulse/default.pa as detailed at Configuring_Applications_for_OSSv4#Pulseaudio.

Re: What is the point of PulseAudio?

Posted: 2018-04-18 14:19
by Innovate
kedaha wrote:
Innovate wrote:firefox even force pulseaudio otherwise no sound on firefox.
So what's the solution to make it work on firefox if you're using other sound system?
I mentioned the solution in my reply above for OSS4: I can only obtain sound in Firefox by editing /etc/pulse/default.pa as detailed at Configuring_Applications_for_OSSv4#Pulseaudio.
Thank you, I'll note your solution & try it out. It's good to have more solutions. I've stuck in the dark for long.
I planned to remove xfce4-pulseaudio-plugin Depends: out of xfce package as well.
The default xfce package force this plugin to preinstall by default I'll fix that out.

Re: What is the point of PulseAudio?

Posted: 2018-04-18 15:15
by Segfault
For sake of truth Firefox works with plain ALSA, although developers claim this is unsupported. To use plain ALSA in Debian you have to compile FF by yourself, the packaged FF depends on PA.

Re: What is the point of PulseAudio?

Posted: 2018-04-18 16:39
by Head_on_a_Stick
Segfault wrote:To use plain ALSA in Debian you have to compile FF by yourself, the packaged FF depends on PA.
No, it doesn't :)

I have firefox-esr working fine in my Debian stretch system by using apulse, no pulseaudio is installed and I don't compile anything from scratch.

I'm using my own package but I think @stevepusser has a version in his OBS repository.

EDIT: in fact, it's in testing/unstable now:

https://packages.debian.org/buster/apulse

Go Debian! :cool: