12 ms·
Making Sense of the Audio Stack on Unix
- bigger_cheese 6y agoAs far as I know a lot of those api's like aRts and ESD have not been relevant for 10+ years. An article from 2021 mentioning them seems a bit strange and contributes to the impression that things are a lot more fragmented then they really are. Thing have come a long way since old days when apps used to exclusively lock the sound card.
- eqvinox 6y agoYes. This is what it looks like if you only include things that are actually relevant (or don't try to actively make it look bad, IDK why else OpenBSD's sndio would be included in the Linux diagram): https://aurora.nox.tf/tmp/linux-audio-output.svg https://aurora.nox.tf/tmp/linux-audio-output.svg NB: this is specifically the Linux situation, and the original file on wikimedia has a deletion request on it because it's so bad.
- temporallobe 6y agoAnyone who is serious about audio would not seriously consider the *nix environment, except, of course for macOS. I have read many blog posts about people who have successfully gotten Ardour to work on Ubuntu (and variants) but this was after an unreasonable amount of patching and troubleshooting. I’m a busy professional with very little time for my music and audio production hobbies, and I want to spend zero time on diagnosing issues. Inspiration is a harsh mistress and does not wait around for me to finish installing some obscure library, or worse, compiling it from source. The biggest hurdle is with hardware. If you need low-latency, high-performance interfaces, you absolutely a need tightly integrated hardware/software stack - think something like Universal Audio’s Luna system. You simply cannot make that kind of tight integration work outside of macOS.
- flatpanther 6y agoUbuntu Studio just works, and it’s way more stable for my workloads than windows. Debugging windows broken and slow midi support was just too painful. It really depends on what someone is doing. Ubuntu went off the rails years ago, and I would default to recommending OSX, but as someone who uses all three, Linux has been the least painful for me.
- oilbagz 6y agoI think the Linux-audio naysayers just don't have the experience with professional audio that they think they do. Once you get UbuntuStudio installed, out of the box - it just plain works, and is bundled with SO MANY GREAT THINGS. I once installed UbuntuStudio alongside a friend of mine in the pro studio, who had just gotten a new Mac. I was up and running and working on projects within 20 minutes from a fresh install - he was still hassling with UAD licenses and dongles, a week later. Seriously people, if you think you are an audio professional, and haven't yet had a dive into kxStudio or UbuntuStudio on a spare machine, you are missing one of the greatest parties in the audio world right now. And then, if you want to get REALLY sophisticated, as an audio professional, you NEED to dig into - and most important of all, understand - what is going on with the Zynthian folks. http://zynthian.org/ http://zynthian.org/ This is the future of audio - not just for DAW's, but embedded audio devices, too. When you grok what Zynthian is, and how it works, and what it is doing, you will change your mind about everything you think you know about audio on Linux. (Hint: it takes the extremely powerful Linux Audio/DAW software ecosystem, wraps it in a functional and simple UI, and exposes EVERYTHING in the Linux Audio world to the musician .. from synths to FX units to MIDI processing and generators and beyond. Simply a massive leap forward for audio professionals...)
- venamresm__ 6y agoI think this is a filter bubble thing. Considering the difference in the time of the posts, I'd say the user base that was previously commenting was mainly from the USA where Apple is king and has its own bubble. Around the world it might be different.
- 6y ago
- deleted 6y ago[deleted]
- cowmix 6y agoThere's not an easy way to make your audio out mono on Linux. In 2021. Jeebuz.
- loa_in_ 6y agoHow so? In alsa just configure your sink as mono. In JACK downmix to mono (or discard one channel) then plug output to both L and R sinks. I guess what you describe as "such simple thing as output mono" has multiple solutions once you think about it, so no-one is forcing one
- supernintendo 6y agoAs a weirdo who makes music and uses Linux as their only OS, I suppose I'll leave a little positivity in this thread. Yes, JACK does take some effort to setup and configure but once everything's in place it really is a dream environment. One of my favorite features (which I'm sure exists on other platforms but just works so well on Linux) is using Catia to route audio and MIDI between software and hardware devices on the fly. It also works perfectly with my external USB audio device (Behringer UMC404HD) which always gave me problems on Windows for some reason. I've been running this on my Ryzen desktop with Arch Linux installed for about a year now and it's been incredibly stable and reliable. I haven't had any issues with playback or recording latency either. Along with Bitwig this is my favorite audio production setup ever and I used Ableton on a Mac for years. If you're looking for a good tutorial on configuring JACK, I'd highly recommend this video from Unfa on YouTube [0]. He does a lot of Linux and free software audio production content which you might find interesting. [0] https://www.youtube.com/watch?v=vgrqMv3Lzfk https://www.youtube.com/watch?v=vgrqMv3Lzfk
- oilbagz 6y agoYou're not alone, I know tons of musicians who are moving to Linux for their DAW, having invested too much in Apple and facing re-licensing fees.
- pjmlp 6y agoSo the cheap alternative is to throw away the whole setup and DAW plugins and start from scratch....
- supernintendo 6y agoBitwig will work with all of your existing VSTs, MIDI hardware and of course media (audio samples, Soundfonts etc.) as will Ardour and any other DAW worth using. There's no need to start from scratch.
- the_only_law 6y agoI really enjoy write ups like this. They comprehensively cover all the parts of a system without being too vague or too verbose. My life would be much easier if I could find the for X technology.
- NexRebular 6y agoI'll never understand why there is not that many pro audio applications on FreeBSD. Its OSS seems to be lot simpler and nicer than all the n+1 systems I see in the linux world...
- jolmg 6y agoBecause potential user base is even smaller than on Linux is my guess.
- jcelerier 6y agoThe problem is that the OSS model of needing to call read/write for audio I/O is pretty hard to fit with the expected pro audio model of "get a callback called when data is ready", likely through some hardware interruption.
- trasz 6y agoOSS supports mmap, at least on FreeBSD.
- ldng 6y agoPipewire has been making great progress lately and is already successfully replacing Pulseaudio on my Buster allowing me to do stuff I could not before (like connecting Jack-only apps with Pulseaudio-only apps). It's not perfect and still have bugs to iron out. I just can't wait for it to reach 1.0 ! Yet, I also hope that it does not get pushed too soon into distros as default ...
- jancsika 6y ago> UCM (Use Case Manager - for presets separation, like notifications, voice, media, etc..) Ok, some domain expert on HN: What is the UCM, when was it added to ALSA, what is its purpose, who is the target audience (e.g., is this something that helps driver author?), and how does it relate to Pulse? I'm especially concerned with the last question, because at a glance it seems like Pulse and the UCM overlap partly in purpose.
- dijit 6y agoPulses reason for existing was that ALSA couldn’t handle multiple sources running at the same time _yet_. It was always on the table though and now it has been implemented. That’s why there’s significant overlap, those projects are not complementary, they are somewhat competitive.
- oilbagz 6y agoWhenever given the opportunity, I immediately yank PulseAudio and replace it with a properly configured JACK+Alsa rig. This happens mostly on the workstations of musician friends who think they are being clever by using an enterprise Linux distro like RedHat, instead of an audio-specific distro like kxStudio or UbuntuStudio - the former is guaranteed to be a headache, the latter is smoother than anything else out there ..
- venamresm__ 6y agoIt's like a routing system for audio based on use case. You could say for example: "Play notifications on this device", "Play media on that other device at this volume", "Mute anything that's VOIP", etc.. Kind of like what you have on mobile operating systems. As far as I could see, this isn't used by anything major. PipeWire is planning on making use of this in the future.
- upofadown 6y ago>sndio is not only available for BSD, it also has a backend for ALSA, so it can run on top of it. Void Linux has many programs compiled with sndio support now: * https://docs.voidlinux.org/config/media/sndio.html https://docs.voidlinux.org/config/media/sndio.html
- pjmlp 6y ago> OSS, the Open Sound System, is the default Unix interface for audio on POSIX-compatible systems. Unfortunately, like such standards, it isn’t compatible everywhere. It can be perplexing to understand because different systems have branched out of it. And this is why pure UNIX desktops never go anywhere. > Linux is the platform of choice for audio and acoustic research and was chosen by the CCRMA (Center for Computer Research in Music and Acoustics). This is definitely not the case as anyone that hangs around professional musicians can tell. Just go into YouTube and see how many bother to do tutorials with Ableton on Linux.
- venamresm__ 6y agoDon't confuse things. Music production and acoustic/audio research are two entirely different domains.
- pjmlp 6y agoNot confusing, I also bet audio research using Linux is doing stuff like coding audio compression algorithms Fraunhofer style.
- oilbagz 6y agoJust, no. Not really at all. In fact, quite the opposite: https://github.com/zynthian/zynthian-sys/issues?q=is%3Aissue+is%3Aclosed https://github.com/zynthian/zynthian-sys/issues?q=is%3Aissue... So many wonderful audio devs gathering around the Zynthian (Linux-based audio DAW) waterpool. Synth developers, FX developers - everyone. EDIT: The Zynthian project even helped Apple M1 users get software on their platform that would not, otherwise, have been an easy task .. if it weren't for Linux Audio/synth hackers, this wouldn't have happened nearly as quickly, nor as smoothly, as it did: https://github.com/surge-synthesizer/surge/blob/main/README.md#building-for-arm-platforms https://github.com/surge-synthesizer/surge/blob/main/README.... .. you don't often see things going the other way (i.e. MacOS -> Linux) ..
- pjmlp 6y ago
- scrps 6y agoI've been using linux since around '99 and if I had a map of linux subsystems then audio would still fall right in 'Here be Dragons' territory for me. I knew enough to come up to the border and set up an outpost to get audio out but I dared not venture deeper. To be fair besides getting audio out I never really needed to go deeper until I started an audio-heavy personal project a few weeks ago. This article certainly helped clarify quite a bit of the map.
- shadowgovt 6y agoThe audio stack on Unix is easily in my top three pet peeves of the desktop environment. It feels like a huge case of too many cooks in the kitchen. To this day, every time I upgrade my distro to a major revision I just can't assume the audio will keep working. Latest upgrade of Ubuntu, and I had to download alsamixer to get audio coming from my headphones again on Zoom meetings. Both the output selector in Zoom and the selector in Settings just... Stopped working. I could select the headphone output, and nothing changed.
- pantalaimon 6y agoSince the last update PulseAudio keeps randomly switching streams from my analog output (which I connected my headset to for video calls) to my USB amplifier that drives my speakers (for listening to music). This used to work perfect, now I always have to keep pavucontrol open when I'm in a conference so I can quickly switch the streams back.
- enriquto 6y agoKeyboard configuration of the login screen is another favourite of mine.
- brokenmachine 6y agoI'm personally partial to the GPU drivers. Every now and then I get booted to cli on startup and I have to reinstall the Nvidia drivers to get sddm to launch properly. Also every time I reboot it's completely random if the login screen will be at 1080p or 4k (I have a 4k monitor). Maybe it's because I've got an Nvidia card. I'm scared to update because I know I'll have to spend hours fixing the audio and video, and whatever else again.
- enriquto 6y agoIn the case of nvidia drivers, at least there is the (valid) excuse that the hardware vendor is purposefully hostile to linux. But failings of sound and localization are entirely of linux making.
- froh 6y agoOn a tangent this makes me feel old. Unix, wasn't that solaris, aix, ... ? Today I learned: Unix now is Linux and free bsd. Get me right, this sounds good, great, actually. Still, it amazes me.
- venamresm__ 6y agoUnix was never a single OS, it was mostly about being POSIX compatible. In the "Unix war" everyone wanted to call themselves Unix but couldn't because of AT&T trademark so they chose different names. - AIX is Unix from IBM - A/UX is Unix from Apple. - They’re both AT&T System V with gratuitous changes. - Then there’s HP-UX which is HP’s version of System V with gratuitous changes. - DEC calls its system ULTRIX. - DGUX is Data General’s. - And don’t forget Xenix—that’s from SCO. So if we want to talk about the most popular POSIX compatible systems today that are free we're left with the different kinds of BSDs and Linux OS. I also mentioned MacOS in the article, in relation to CoreAudio, but decided to leave it out as its design can't be inspected and compared properly. And also it's not a very popular OS amongst my readership and the world in general.
- 95014_refugee 6y agocoughiOScough There's also the part where writing about it is not super interesting, because it mostly just works like it should.
- froh 6y agoAnd sgi had irix, sco, let's not talk about sco, and even windows nt and os/2 claimed a posix layer, and I'm old enough to have used a couple of them, always "configure; make; make install"-ing GNU in top to get true interoperability, lol And the binary compatibility of GNU/Linux, the interchangeability of suse, debian/ubuntu, red hat, keeps the promise that posix gave. Which leads to the tangential point: a new generation which is growing up with "unix? That's Linux, right? Oh, and free bsd..." Great, great article, btw
- venamresm__ 6y ago
- petepete 6y agoAh, I wish I'd have had this article back when getting working Audio on Linux was an uphill struggle. Even knowing what to Google was a challenge. Those times when things would all be working and then you reboot and now nothing works, or getting to the end of an MP3 (played in XMMS, of course) and then hearing 25 queued-up Gaim notifications. Thankfully, the last ten years have been plain sailing. It just works. Oh, except that on Gnome the volume remote half way up my headphones cable adjusts the Pulse Audio master level rather than the volume of the headphones themselves, but I can live with that.
- S_A_P 6y agoThere is a factual error in the article. Middle C is not 440hz, which is an A...
- amelius 6y agoIt depends which OS you are running ...
- venamresm__ 6y agoFixed, thanks.
- beervirus 6y ago> The audio stack is fragmented on all operating systems because the problem is a large one. For example, on Windows the audio APIs being ASIO, DirectSound and WASAPI. Perhaps MacOs has the cleanest audio stack, CoreAudio, but nobody can clearly say if they can’t look at the code. PulseAudio was inspired by it. The stack of commercial operating systems are not actually better or simpler. Maybe so for developers, but as a user on Windows or MacOS I don’t have to know or care about any of that stuff. Things just work, and work sensibly.
- nsajko 6y agoThings can just work if your expectations are low and specific requirements are common, and this is true independently of OS. Where Linux shines (in general), is with customization or uncommon requirements, which in this case would AFAIK be things like low latency audio.
- AshamedCaptain 6y agoYet that is not true at all. The other day i noticed that whenever you use a bluetooth headset on ms teams, it uses its own method to connect directly to the headset, skipping the windows mixer and other infrastructure. The net result is that I cannot play any other sounds throught the headset while teams is using it, unless I also set windows to target the HFP profile on the headset.
- littlestymaar 6y agoAs a desktop Linux user who don't really care about that stuff, things have always “just worked” for me. When I started using Linux back in 2009, I've heard horror stories form the past about how pulseaudio was a nightmare and never wanted to run, but I've never had issues with it myself (nor on my mother's and wife's computer, which have also been running Linux for a few years).
- jcelerier 6y ago> Maybe so for developers, but as a user on Windows or MacOS I don’t have to know or care about any of that stuff. Things just work, and work sensibly. depends on the kind of user you are. If you're looking for the lowest-latency possible (for instance because you play guitar with an effect stack going through your computer) then windows with ASIO or linux with Jack give you a better mileage on the exact same hardware than CoreAudio
- hctaw 6y agoHere's my Linux audio anecdote: I've never successfully gotten jackd to run on my computer(s) running Ubuntu or pop_os, and pulseaudio doesn't let me run with low enough latency to be usable in Bitwig. I don't want to spend my time digging through ancient forum posts on why jack/pulse can't "just work" when everything is fine on MacOS and Windows. A reboot is faster. Sidenote, audio stacks are not fundamentally fragmented. DirectSound is deprecated in favor of WASAPI. ASIO only exists because DirectSound sucked, now WASAPI is good enough not to use ASIO moving forward (with some hiccups, like some software doing SRC under the hood because WASAPI doesn't let you programmatically select sample rate - RtAudio does this, for example). CoreAudio has been stable for almost 20 years. It is the gold standard. The only problem is the almost complete lack of documentation except for the CoreAudio mailing list. If you're writing audio software the solution is to use WASAPI on windows, CoreAudio on Mac, and tell Linux users to use Windows or MacOS if they want low latency audio.
- cycloptic 6y agoI can't say I've had the same experience, I've been using jackd successfully for around 15 years now. The modern Linux answer to audio fragmentation is Pipewire, and that should actually have less fragmentation than on Windows because it preserves ABI compatibility. (It's not entirely stable yet though)