The Audio Stack Is a Crime Scene

fireborn.mataroa.blog

79 points by todsacerdoti 2 days ago


thedanbob - a day ago

A few years ago I was helping run sound at a conference which involved recording and rebroadcasting multiple audio streams simultaneously. The provided equipment included a Linux computer running a real-time kernel and routing was handled by JACK.

It was a disaster. If the USB audio interface ever disconnected, JACK crashed and wiped my routing configuration. After the first day I ditched the Linux computer and ran the whole setup through my MBA, using Reaper for both recording and routing.

AHTERIX5000 - a day ago

The Linux audio stack is just baffling. After all these years it's still unreliable. I'm running Fedora 41 and often toggle between two audio devices, USB DAC and HDMI output. Sometimes when I change the output via Gnome settings my Flatpak apps don't care and keep playing with the previous output and other apps change as expected.

I've never edited any audio configs on this machine because I expected my 2 device setup and Gnome settings would be trivial enough for the latest Linux desktop audio solution.

ringeryless - 2 days ago

the cause of all this? single client ALSA driver model.

coreaudio doesn't need pulse nor jack nor pipewire to allow a single device to be opened by multiple applications.

ALSA additionally specifies every 2 channels as separate 2channel devices, so your 8 channel audio interface looks like 4.

the confusion is added to by device tree overlays such that you may find your pro audio 8 channel device is always seen as a surround setup, replete wirh highpass filtering on the principle pair of outputs, and you don't know why your poor desktop environments sound device doesn't show this...

PaulHoule - 2 days ago

Windows is better but not much. My big PC at home isn't completely reliable to attach to Bluetooth headphones, some of which might be the fault of the particular headphones, but some of which seems to be the fault of having various sorts of "virtual" drivers installed such as for Steam, MQ 3, Immersed, etc.

wormius - a day ago

I got bit by linux audio issues after moving from Win10 to CachyOS (arch based distro). It seemed to be working fine, but I noticed when switching to speakers a terrible digital distortion that wasn't there previously. (I'm not a linux noob, have used since Debian Bo in '97, for example, plus many other distros off and on through the years)

I spent so much time messing with alsamixer, removing pipewire, installing pulse, uninstalling pulse, readding pipewire, resetting ports and connections.

I realized it had something to do with the audio buffer (due to the echo and the distortion was "shaped" like the feedback/if that makes sense). like a half second delay feedback.

Ultimately I read up on the buffering mechanism and found that switching to the Bore-LTO kernel fixed everything. I was so desperate I was literally swapping ends of my cables between the PC and speaker, in theory it shouldn't matter but before realizing the issue when I noticed the noise was based on a delay/feedback, I had no other alternative and was at my wits end.

duped - 2 days ago

> The stack is clean. The interfaces are better. But the expectations are still stuck in 2012.

The interfaces are absolutely not better, they're a bunch of ~~undocumented~~ C preprocessor macros that hide a pit of complexity and indirection. Pulse is mature enough that you can figure out how to interface with it, pipewire has a handful of examples and some reference documentation that doesn't make sense if you don't already know what you're looking for. Good luck if those examples don't fit nicely into your existing applications' architectures.

Pipewire is very impressive as an achievement, but the work needs to be put in to make it mature enough as a software project (meaning: documentation and well typed interfaces) before existing software can work with it.

The architecture may well be better equipped to provide stable and elegant interfaces to complex media routing problems in application software. But I couldn't tell you if that's true or not, because it's sparsely documented. An undiscoverable API is a nonexistent one.

edit: I wrote this ignorantly before looking back at the pipewire docs. They've improved since I last looked, but I still find the docs lacking (comparable to Apple's docs, which is not a compliment) and the overall interface design of Pipewire a massive challenge to grasp. It might be better, but I don't know. The last time I tried to implement direct support for pipewire in a Linux app I gave up because of its design and lack of useful documentation.

nesarkvechnep - a day ago

Another area where FreeBSD excels.