Live data from Hacker News

PulseAudio has been removed from dports

lists.dragonflybsd.org

41–50 of 55 posts

Re: PulseAudio has been removed from dports

#41
post #36

Look at sndio if you want to see how sound should be done. Excusing the horrible mess pulseaudio is with the horrible state of Linux Audio doesn't cut it, when OpenBSD has been offering a superior and simpler alternative for years! It doesn't reinvent the wheel and for anything more complex you can always use JACK, like if you really want to go low-latency.

> Excusing the horrible mess pulseaudio is with the horrible state of Linux Audio doesn't cut it,

The problem is that most people complaining about Pulseaudio don't offer realistic alternatives. Saying Pulseaudio sucks and that everyone should use ALSA is a joke. Pulseaudio does a plethora of things that ALSA does not handle. Not to mention that ALSA is a low-level system, and PA actually sits on top of ALSA.

In all of the vitriol that people spew about Pulseaudio, this is the first time that I've seen anyone point to sndio. I think that says something about the "pulseaudio complainers" crowd.

That said does sndio provide the following features:

- Support for bluetooth audio devices

- Support for streaming audio over a network.

- Support for user-land mixing of audio sources (i.e. don't need root).

- Mixing of multiple audio streams at the same time (e.g. Can your system play an alert sound without interrupting your music?)

- Per application volume settings

- Per application input/output source settings

Re: PulseAudio has been removed from dports

#42

Earlier quoted context omitted.

ALSA is not an alternative to Pulseaudio. If your audio chipset doesn't have a hardware mixer, and about of half of laptop chipsets don't, then you can't play more than one stream at a time. If you have an array microphone, the only way it'll work at all is with Pulseaudio. If you want Bluetooth audio, only Pulseaudio bothers to support it. Pulseaudio uses ALSA anyway (and on DFBSD it uses OSS instead); it's not a re…

JACK is a (better) alternative to PulseAudio, works in BSD, works with ALSA and OSS, and is superior in every way. The reader is encouraged to download a KXStudio LiveUSB image, and see all the cool things JACK allows that PulseAudio cannot/will not catch up to.

> JACK is a (better) alternative to PulseAudio

For some things, but not for others. They are really not even competing to be in the same space. Such blanket statements do not help.

Re: PulseAudio has been removed from dports

#43

Removal is the best fix, always. Who needs features anyway.

This is a dumb comment and akin to predicting the iphone would fail because it doesn't have flash support. Pulseaudio is a very finicky troublesome bit of open source software. The alternative (ALSA) is much more friendly to work with. Any seasoned sysadmin probably welcomes the death of Pulseaudio.

PulseAudio is not a replacement for ALSA. At the moment ALSA is the only kernel level API for talking with the hardware drivers that's fully supported by upstream (= the kernel devs).

You _can_ install OSS4 if you want to, at the expense of loosing proper power management support; not a big issue on Desktops, but it can reduce a laptops battery runtime significantly.

Either way PulseAudo does not know how to talk to audio hardware by itself (well, it sort of does as far as Bluetooth attached devices is concerned, but the whole Linux Bluetooth stack "BlueZ" is quite finicky on its own). It needs (just like Jack, esd, aRTs, Xaudio* and all the other sound servers out there (*= dead and burried)) some way to talk to the hardware. And that, at the moment usually is ALSA.

When ALSA was first developed the original plan was to implement all the must haves (mixing, resampling) though the userspace module support. Unfortunately it ended up in an unholy mess and never worked satisfyingly. To anyone who's spent considerable amount of time developing audio software (in hindsight) that's not a big surprise. Audio raises very hard and tight deadlines. The way ALSA dmix implements mixing through IPC mechanisms is extremely prone to buffer underruns because of some participating process not getty enough CPU cycles in time to complete to write out the next bunch of audio.

PA does plaster over the biggest cracks in the foundations of the Linux low level audio infrastructure. And given the circumstances it does an admirable job there; if it doesn't break things even more. But it's only treating the symptoms and not curing the underlying issues.

Here's the laundry list of what's required to fix the major bumps in the road (which also PA has to navigate):

- major simplification and cleanup of the kernel side driver model. Too many things are left optional for the drivers to implement

- tight requirements on how kernel drivers must behave (there's a lot of variation in the runtime behavior of certain drivers; some return immediately from read write functions, others have significant delay, timestamps reported may be increment coarsely based on a per-buffer-length base, others deliver smooth playhead/recordhead position updates)

- mixing / fanning _must_ happen in or close to the kernel (the reason for that is explained in the next point). The biggest issue here is that resampling may be required. As long as it's upsampling it's rather unproblematic actually (the only DSP challenge there is not creating artifact frequencies). Downsampling is a much harder problem, because it involves lowpass filtering, i.e. discarding information and the challenge is only to affect the stuff above the Nyquist frequency.

- the audio infrastructure must be able to reschedule processes based on the deadlines and time left until new samples are required. Audio is probably the most demanding of the soft realtime applications. A single missed sample is easily noticeable even to the most untrained pairs of ears. If your buffers underrun you get pops or crackles. However on an interactively used system acceptable audio timing mismatches are in the order of 5ms before an untrained brain is able to pick them up. Raising audio applications to realtime priority alleviates the issues, but the better solution is to keep statistics on the audio frame lengths read/write by a process, how much time it takes for a process to prepare the next frame and use that to augment the scheduling. However this raises the issue being able to circumvent priority privileges through the audio system; a mitigation would be that frame sizes are quantized to a minimum frame size that correponds to the amout of CPU time the process would be alotted in regular scheduling (that's a tough one and I've been strugling with it for some time).

When it comes to OSs with a monolithic kernel a very good question is, if the last two parts absolutely have to happen in the kernel or if it's possible to have them in userspace. If we want to implement it in userspace, then, because of the rescheduling issues this will require the addition of userspace based rescheduling capabilities the syscalls required for this.

Of course with a proper audio infrastructure present through standard kernel and/or driver interfaces the need for a system like PulseAudio vanishes; at least as far as mixing and resampling are concerned. It's still desireable to have an audio manager process that knows how to decide on which device to play certain audio (telephone calls go to the headset, music goes to the speakers and so on).

Re: PulseAudio has been removed from dports

#44

Earlier quoted context omitted.

ALSA is not an alternative to Pulseaudio. If your audio chipset doesn't have a hardware mixer, and about of half of laptop chipsets don't, then you can't play more than one stream at a time. If you have an array microphone, the only way it'll work at all is with Pulseaudio. If you want Bluetooth audio, only Pulseaudio bothers to support it. Pulseaudio uses ALSA anyway (and on DFBSD it uses OSS instead); it's not a re…

JACK is a (better) alternative to PulseAudio, works in BSD, works with ALSA and OSS, and is superior in every way. The reader is encouraged to download a KXStudio LiveUSB image, and see all the cool things JACK allows that PulseAudio cannot/will not catch up to.

I've played with JACK a bit, and I've always found it pretty obtuse, but that was a while ago.

The obvious question, though, is: is there a emulation layer for JACK that supports the PulseAudio API?

Re: PulseAudio has been removed from dports

#45
post #35

Earlier quoted context omitted.

ALSA is not an alternative to Pulseaudio. If your audio chipset doesn't have a hardware mixer, and about of half of laptop chipsets don't, then you can't play more than one stream at a time. If you have an array microphone, the only way it'll work at all is with Pulseaudio. If you want Bluetooth audio, only Pulseaudio bothers to support it. Pulseaudio uses ALSA anyway (and on DFBSD it uses OSS instead); it's not a re…

> If your audio chipset doesn't have a hardware mixer, and about of half of laptop chipsets don't, then you can't play more than one stream at a time. Not true. ALSA with dmix can do software mixing, and dmix is enabled by default. I also really miss ESD, which also enabled software mixing (this was before dmix) but was far simpler and wasn't this over-complicated mess like PulseAudio.

dmix is terribly broken.

Re: PulseAudio has been removed from dports

#46

Earlier quoted context omitted.

JACK is a (better) alternative to PulseAudio, works in BSD, works with ALSA and OSS, and is superior in every way. The reader is encouraged to download a KXStudio LiveUSB image, and see all the cool things JACK allows that PulseAudio cannot/will not catch up to.

I've played with JACK a bit, and I've always found it pretty obtuse, but that was a while ago. The obvious question, though, is: is there a emulation layer for JACK that supports the PulseAudio API?

There is some limited interoperability by nesting PA within JACK: http://www.jackaudio.org/faq/pulseaudio_and_jack.html

Re: PulseAudio has been removed from dports

#48

Earlier quoted context omitted.

ALSA is not an alternative to Pulseaudio. If your audio chipset doesn't have a hardware mixer, and about of half of laptop chipsets don't, then you can't play more than one stream at a time. If you have an array microphone, the only way it'll work at all is with Pulseaudio. If you want Bluetooth audio, only Pulseaudio bothers to support it. Pulseaudio uses ALSA anyway (and on DFBSD it uses OSS instead); it's not a re…

JACK is a (better) alternative to PulseAudio, works in BSD, works with ALSA and OSS, and is superior in every way. The reader is encouraged to download a KXStudio LiveUSB image, and see all the cool things JACK allows that PulseAudio cannot/will not catch up to.

JACK doesn't have Bluetooth support, nor array microphone support. It is also terrible on battery, and doesn't perform correctly on a non-realtime kernel.

That's not to say JACK isn't useful; but it isn't a solution to the desktop audio problem, it's a solution to the professional audio problem.

JACK also doesn't have the semantics and auto-configuration code which makes Pulseaudio work out of the box, and it is considerably more difficult to make JACK control clients. These are more reasons why even though JACK existed before Pulseaudio, it was not integrated with common user applications.

Re: PulseAudio has been removed from dports

#49

Understaffed BSD fork can't maintain notoriously complicated and finicky user-space audio daemon, decides to drop it instead. News at 11. Honestly, I'm surprised DfBSD even supported PulseAudio (or vice-versa) in the first place.

If it works on FreeBSD it will probably work on Dfly. They're still pretty close in terms of userland, and I don't know this for certain but they probably take many FreeBSD changes and vice-versa.

Re: PulseAudio has been removed from dports

#50
post #7

Earlier quoted context omitted.

On the flip side, if everything can be done by ALSA, and PA is seemingly objectively worse, for what reason are people building their software against PA? Why is it being included anywhere at all?

The power of defaults. Why write for ALSA when the distro ships with PA, and so all of its configuration tools are PA-focused?

Also pulseaudio allows them to sorta support OSS and whatever else pulseaudio will output to for free.
Post reply on HN