3 ms·
There's a lot right about this, but some factual inaccuracies like this make me wonder: Too many layers of abstraction lead to the situation when the user cann
by kelnos 11y ago
There's a lot right about this, but some factual inaccuracies like this make me wonder:
Too many layers of abstraction lead to the situation when the user cannot determine why his audio input/output doesn't work (ALSA kernel drivers1 -> ALSA library2 ( -> dmix3 ) -> PulseAudio server4 -> Alsa library5 + Pulse backend6 -> Application - in other words, six layers of audio redirection; or seven layers in case of KDE since they have their own audio subsystem called Phonon).
That's just not true. In the case of an application that directly supports PulseAudio, there are merely 3 levels:
ALSA kernel drivers -> ALSA library -> PulseAudio Server/library -> Application
In the case of an application that doesn't directly support PA (most that don't will support ALSA), it's one level little worse:
ALSA kernel drivers -> ALSA library -> PulseAudio server/library -> ALSA library (pulse plugin) -> Application
In that case, 4 levels of indirection.
If dmix is set up in the case where PA is being used, that's a bad system misconfiguration and the distro should be slapped.
So that's 3 levels of indirection for a "modern" app, and 4 if you need the compatibility layer. How are OSes like Windows and MacOSX designed? Unless they have a sound API that goes right to the kernel (and the kernel handles mixing if the hardware doesn't support it), I don't see how you can do much better than the current state of affairs, aside from having PulseAudio directly hit the ALSA kernel interfaces, which seems unnecessary.
(Note: for the purposes of debugging & figuring out why sound isn't working, I'm considering the PA server and library [or "backend" as the OP calls it] a single layer. It's true that there's an extra "hop" involved there, but in practice that's unrelated to any possible audio issue but latency, which isn't what the OP is talking about.)