Live data from Hacker News

PulseAudio under the hood

gavv.github.io

151–160 of 181 posts

Re: PulseAudio under the hood

#151
post #121

Earlier quoted context omitted.

I'm trying to think of a software audio source that doesn't have its own volume control and I'm failing.

Chrome, for example. Remember http://packet.city/ from a few days ago? All Chrome supports is mute or unmute.

Hm...

* default Alsa setup: set master to level that seems comfortable-- i.e., "to taste"

vs.

* default Pulse setup: set Chrome's app level to taste

Bug: packet.city plays an annoying sound with a perceived loudness that the user did not predict.

* Alsa solution: lower the master volume to a level that doesn't result in painful output from packet.city, and adjust all other apps accordingly

vs.

* Pulse: lower Chrome app audio, but leave yourself open to similarly unpredictable painful events from other apps

It seems in this case that the limitations of Alsa actually force the user to do the safe thing wrt perceived loudness.

Re: PulseAudio under the hood

#152
post #145

Sigh. Once upon a time, sound cards were files in the /dev tree. To play sound, you wrote pcm data to the file representing a sink. To record, you read pcm data from a file representing a source. Things were better then. I'm sure there are people with use cases that have required the four (and counting!) solutions crufted on since then, but I've never been one of them, and it irks me that the interfaces get more and…

And what happened when two processes wrote to that file? And what if they where each in a different sample rate? ....

Well, sound mixing and resampling are a thing. Other operating systems do that where it belongs: in the kernel. OSS gets it right, for example.

Re: PulseAudio under the hood

#153
post #121

Earlier quoted context omitted.

Chrome, for example. Remember http://packet.city/ from a few days ago? All Chrome supports is mute or unmute.

Hm... * default Alsa setup: set master to level that seems comfortable-- i.e., "to taste" vs. * default Pulse setup: set Chrome's app level to taste Bug: packet.city plays an annoying sound with a perceived loudness that the user did not predict. * Alsa solution: lower the master volume to a level that doesn't result in painful output from packet.city, and adjust all other apps accordingly vs. * Pulse: lower Chrome a…

Your proposed Alsa solution: Now all other apps with reasonable dynamic range, e.g., movies, are too quiet.

Re: PulseAudio under the hood

#154

Sigh. Once upon a time, sound cards were files in the /dev tree. To play sound, you wrote pcm data to the file representing a sink. To record, you read pcm data from a file representing a source. Things were better then. I'm sure there are people with use cases that have required the four (and counting!) solutions crufted on since then, but I've never been one of them, and it irks me that the interfaces get more and…

A massive sad part of all this is that so much of what is going on in Linux DE land right now seems to be driven by a pipe dream called multiseat. Or effectively using software to turn a Linux desktop install into a desktop mainframe. This by attaching a bunch of peripherals and use software to assign them to groups that effectively form the equivalent of a graphical terminal. All this supposedly in the hopes of intr…

Serious question: I remember claims that poorer countries basically switched to smartphones instead of PCs and phones are supposed surprisingly ubiquitous there. Can anybody confirm that?

Seats never made much sense to me and if the smartphone story has any truth to it, then I do not see any valid use case for that idea these days.

Re: PulseAudio under the hood

#155

Earlier quoted context omitted.

Also spoken confidently like someone that never tried to play sound in two applications at once. This has worked well in ALSA for years now. Now, ALSA won't let you set the volume of each application separately, but most applications have their own volume control for that anyway. And you'll never have to deal with the application's volume Pulse's volume for that source disagreeing, and scratching your head as to why…

Another "lovely" thing about PA is that will allow the loudest of the "apps" (groan) to ramp up the master control (do not recall the "feature" name right now). Do wonder how much future hearing loss it has created by sudden spikes in volume...

Oh! When all of the GUIs say sound is at max, but it's either really quiet or silent, and it turns out that it's because even though the PA volume is up, somehow ALSA (which PA ultimately uses on the backend) got muted. But this is a PA box, so you have no GUI tools to set the ALSA volume!

Re: PulseAudio under the hood

#156
post #153

Earlier quoted context omitted.

Hm... * default Alsa setup: set master to level that seems comfortable-- i.e., "to taste" vs. * default Pulse setup: set Chrome's app level to taste Bug: packet.city plays an annoying sound with a perceived loudness that the user did not predict. * Alsa solution: lower the master volume to a level that doesn't result in painful output from packet.city, and adjust all other apps accordingly vs. * Pulse: lower Chrome a…

Your proposed Alsa solution: Now all other apps with reasonable dynamic range, e.g., movies, are too quiet.

Then you tell your movie player to just make it louder, discarding that beautiful dynamic range. If you're paying close enough attention to the movie to care about the loss of dynamic range, then you probably aren't doing something else that might make sound, so you won't mind turning the master volume up.

Re: PulseAudio under the hood

#157
post #121

Earlier quoted context omitted.

I'm trying to think of a software audio source that doesn't have its own volume control and I'm failing.

Chrome, for example. Remember http://packet.city/ from a few days ago? All Chrome supports is mute or unmute.

So how do you ensure that one tab wasn't much louder than the other?

In this case, it doesn't make much sense to treat the browser as a single application, but each site as one (does Chrome export each tab as a separate source to PA? IDK, I haven't checked). And, I can't think of a single thing that I actually want producing sound (and don't mind just muting) from my web browser that doesn't have its own volume control.

Re: PulseAudio under the hood

#158
post #153

Earlier quoted context omitted.

Hm... * default Alsa setup: set master to level that seems comfortable-- i.e., "to taste" vs. * default Pulse setup: set Chrome's app level to taste Bug: packet.city plays an annoying sound with a perceived loudness that the user did not predict. * Alsa solution: lower the master volume to a level that doesn't result in painful output from packet.city, and adjust all other apps accordingly vs. * Pulse: lower Chrome a…

Your proposed Alsa solution: Now all other apps with reasonable dynamic range, e.g., movies, are too quiet.

At the same time, all other apps are at a level that won't cause painful audio to hit your ears.

If you trust VLC and you trust the video file you're watching, then turn the master audio back up during the loud "Universal Pictures" intro or whatever is an equivalent introductory sound at the beginning of the movie you're about to watch.

On my chromebook, there are two volume buttons and one mute button that are by far the most convenient way to adjust (master) audio for such a situation. So you turn down for random browsing and turn up for watching movies or whatever.

Btw-- those are almost certainly the controls someone would use to turn down or mute the sound of that horrible website audio listed above. In such a case the fact that pulse can give you an app volume for Chrome doesn't help anything-- for example, the user who adjusted Pulse app volume down to avoid pain will need to adjust it back up when watching a movie on Youtube for the same reason you mentioned. But they can't adjust the app volume with the keyboard controls. So to make use of that feature forces a more complicated UI that takes longer to use.

Re: PulseAudio under the hood

#159
post #98
post #21

I use headphones, and have tactile transducers on my chair. The transducers make the audio sound much louder than it actually is. That is good for your ears and your neighbours. Because of this setup I need full-range stereo output on my headphones and low-passed LFE for the transducers. How can I do this PulseAudio? When I enable lfe-remixing, I get full-range output on my transducers and I hear voices in my chair.…

I'd like to add that the patch was rejected because the maintainer had a use-case in mind, deemed the feature not a good solution, and therefore rejected the patch. I would comment directly on the site, but because the certificate is invalid, I cannot register an account. I don't like the attitude to reject a patch just because one can't come up with a use-case. Obviously there is a use-case, else the patch wouldn't…

> Why would a free software developer deny others easy ways, or any ways at all, to configure their system?

Because of the "drive-by contributor" problem. Come by, drop off a patch that solves exactly your problem, never show up again to maintain the feature, even if it breaks, even if it's been broken for years.

That forces me, the developer, to either continuously test your patch (which I may not be able to do if I don't have your hardware/software/configuration/use-case-in-mind), or to shrug and hope it works. We have to just trust your initial work and have it no way weigh in on the future of our product?

We've learned too much as Open Source Software Engineers to just trust random drive-by contributions. We've gone from default-accept-all to default-deny, because at the end of the day that's what keeps quality in our software.

Re: PulseAudio under the hood

#160
post #95

PulseAudio posts are always filled with naysayers; the vast vast vast majority of users (like systemd in this regard) have no idea it's even running and just get on with whatever they're doing. I've primarily run Linux over the last fifteen or so years and barely had an issue that's directly PA's fault. I remember the bad old days where a playlist would finish and then GAIM's notification sound would bleat fifteen ti…

For me, personally, the bad old days before PA was OSS, when an application could squat on the audio hardware and absolutely disallow any other software from playing any sounds at all on the system until it was stopped or forcibly killed. And good luck finding which piece of software was claiming absolute ownership of your sound card. PA gives me the ability to have multiple pieces of software making noise at once, a…

Completely skipped ALSA and configuring DMIX, I guess? That at least provided software mixing.
Post reply on HN