LWN: Comments on "A Guide Through The Linux Sound API Jungle" https://lwn.net/Articles/300423/ This is a special feed containing comments posted to the individual LWN article titled "A Guide Through The Linux Sound API Jungle". en-us Mon, 01 Sep 2025 20:53:12 +0000 Mon, 01 Sep 2025 20:53:12 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/301723/ https://lwn.net/Articles/301723/ jospoortvliet <div class="FormattedComment"> There won't be much work maintaining Phonon, as it's incredibly small<br> compared to gstreamer (or any other multimedia framework). After all, it's<br> only a wrapper. Besides, Qt Software (Nokia) is maintaining it now ;-)<br> <p> Don't skip over the advantage of transparent support for Mac &amp; Windows<br> either - and Phonon also allows users to use another multimedia layer like<br> Xine or VLC. So more choice for users, easier api for developers and<br> insurance against api changes. I'd say a bargain ;-)<br> </div> Fri, 03 Oct 2008 19:43:08 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/301618/ https://lwn.net/Articles/301618/ nix <div class="FormattedComment"> You can use Qt in command-line applications.<br> </div> Fri, 03 Oct 2008 07:37:17 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/301605/ https://lwn.net/Articles/301605/ lysse <div class="FormattedComment"> Bit of a bugger if you're developing a command-line application, though.<br> </div> Fri, 03 Oct 2008 04:56:38 +0000 OpenAL omitted? https://lwn.net/Articles/301414/ https://lwn.net/Articles/301414/ drag <div class="FormattedComment"> Ya. I am talking about the very latest stuff. Quake3 and other stuff around that era use this funky mmap thing that grew up out of the Doom DOS era.<br> </div> Thu, 02 Oct 2008 05:37:46 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300841/ https://lwn.net/Articles/300841/ nix <div class="FormattedComment"> gstreamer basically consists of two pieces: the core, which provides <br> plumbing to connect together plugins, and the plugins. The majority of <br> those plugins are interfaces to other audio/video libraries (everything <br> from monsters like ffmpeg to little things like libogg or libmad). As <br> such, gstreamer has to track changes to the APIs of the libraries used by <br> all those plugins. (Thankfully, most are quite stable, but not all: <br> pulseaudio has bumped API in the last couple of years, and ffmpeg hardly <br> ever stops changing...)<br> <p> </div> Mon, 29 Sep 2008 00:02:22 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300840/ https://lwn.net/Articles/300840/ obi <div class="FormattedComment"> Actually my argument was more along the line of: "I'd rather have a lot of people help maintain one framework (albeit an old branch), than have several libraries maintained by just a a few people each"; However if Phonon really is as thin as you guys say, and maintaining a stable gst 0.10 really would be like a hundred phonons - then I guess I'm just wrong. The point is moot especially considering Phonon is out there; sorry for wasting your time.<br> <p> </div> Sun, 28 Sep 2008 23:50:23 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300828/ https://lwn.net/Articles/300828/ nix <div class="FormattedComment"> obi's argument appears to be that maintaining phonon is wasted effort <br> because you have to adapt to changes in gstreamer's API anyway.<br> <p> But this is erroneous, because if you have to maintain gstreamer yourself, <br> even if you don't add any features it's like maintaining a hundred <br> phonons: all those plugins then need to be maintained, and each of *those* <br> requires tracking changes in the downstream APIs... much more work.<br> <p> <p> </div> Sun, 28 Sep 2008 14:25:10 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300827/ https://lwn.net/Articles/300827/ quintesse <div class="FormattedComment"> I don't know Obi, why on earth do you care so much that KDE has made a small, thin wrapper layer around existing audio frameworks?<br> <p> Because it's obvious in your reply to pynm0001 where you say "weighing the work required to create Phonon and its backend vs the potential work needed to maintain gst 0.10 for a while on your own" that you seem to think these are somehow related jobs in terms of time, effort and knowledge needed to be actually able to do it. They're not! Phonon is a pretty thin layer, no extensive knowledge of audio frameworks is needed neither to maintain it nor to make the backend "drivers", so the KDE devs are pretty confident that this time around, come hell or high water, they WILL be able to take KDE into the future.<br> <p> Now if you can somehow come up with a reason why NOT using GStreamer directly is a huge mistake there would be something worth talking about, but right now we're just wasting our time.<br> </div> Sun, 28 Sep 2008 13:00:02 +0000 OpenAL omitted? https://lwn.net/Articles/300818/ https://lwn.net/Articles/300818/ NinjaSeg <div class="FormattedComment"> Erk, and actually, Carmack likes reinventing the wheel so much, that none of his game engines have ever used SDL. They use X11 and OSS/ALSA directly. Which off course means they end up getting things like fullscreen wrong. Grrrr... (Synergy fails miserably in Openarena in fullscreen. Also media keys don't work, though I think SDL fails that too last I checked, someday I need to write a patch...)<br> </div> Sun, 28 Sep 2008 08:01:21 +0000 OpenAL omitted? https://lwn.net/Articles/300817/ https://lwn.net/Articles/300817/ NinjaSeg <div class="FormattedComment"> Because John Carmack is more than happy to write his own 3D audio engine from scratch. Because he's hardcore like that...<br> <p> SDL itself only provides a bare minimum callback API, as it should. Unless you're looking to, or already have, re-invented the wheel, or are doing something special like real-time synthesis, it's not very useful.<br> <p> The SDL_mixer library provides a more practical API for the needs of a typical game, providing multi-channel mixing, panning, resampling, file loading and decoding and even music streaming/synthesis. It appears to even have some basic positional 3D support.<br> <p> OpenAL of course provides a full-blown 3D audio solution, and is the only mature open source solution I know of. But it's a bit narrower in scope than something like SDL_mixer, it doesn't really cover stuff like music streaming leaving you to either do some amount of wheel-reinvention, or go outside of OpenAL for that.<br> <p> If you're not doing positional 3D audio then you'll probably find OpenAL 's API more awkward than necessary. But it comes with recent versions of OSX, and has the backing of Creative Labs on Windows, so it's really the way to go for cross-platform 3D audio. Note that Microsoft killed off hardware Directsound3D in Vista so OpenAL is now the only way to get hardware 3d audio in Vista...<br> <p> For what it's worth I authored the initial OpenAL patch for the Second Life client, that looks like it might actually get merged soon. It's replacing the closed source "fmod" library it currently uses. SL makes use of the internet music streaming that fmod provides, which is outside the scope of OpenAL, so for that we end up going to gstreamer (on Linux), completely outside of OpenAL. Which means you need to have multiple streams working, any sane distribution should have ALSA+dmix or PulseAudio working out of the box by now...<br> </div> Sun, 28 Sep 2008 07:53:10 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300814/ https://lwn.net/Articles/300814/ obi <div class="FormattedComment"> As for hindsight - of course; when KDE adopted aRts the multimedia world was a very different place. I don't think they could have foreseen that. But we've come a long way in the mean time, and I think it should've been possible to have a better idea of where things were going in 2006. Yes, you ran the risk of getting burnt again, but the chances were smaller.<br> <p> I'd also forgotten KDE 3.xx was out for over 6 years. But still, see my reply to pynm0001 - I think that maintaining gst 0.10 would not have been an impossible task; at least the odds you'd get outside help would be bigger - I imagine there's more people familiar with gstreamer's codebase than Phonon's.<br> <p> </div> Sat, 27 Sep 2008 23:32:04 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300813/ https://lwn.net/Articles/300813/ obi <div class="FormattedComment"> I see, what you say makes sense - it's not unlikely there will be a gst 0.12 within the lifetime of KDE 4.x.<br> <p> However - weighing the work required to create Phonon and its backends vs the potential work needed to maintain gst 0.10 for a while on your own (there will likely be other organisations interested in a stable 0.10 branch too however) if a gst were to happen during 4.xx, I'd probably avoid building something completely new.<br> <p> However, this is a judgment call, and I trust you have a lot more experience with it than me. You address the problems with supporting 0.10 yourselves in your mail from 2 years ago:<br> <p> "So if we just rely on gstreamer 0.10, now we're stuck with an abandoned code base, which KDE developers are unfamiliar with. Does this sound familiar to anyone? ;)"<br> <p> I think this is the crux of the issue.<br> <p> You've avoided this by creating Phonon. However, I believe 0.10 has quite a bit of mindshare, and I believe that the KDE people would not have found themselves all alone maintaining the abandoned 0.10 (while OTOH they are pretty much on their own maintaining Phonon). Well, I do see how this might seem very similar to the aRts situation, but aRts wasn't used a lot outside of the KDE world. Maintaining Phonon + backends (which have to interface with the codebases you're not familiar with) must take quite a lot of effort too.<br> <p> </div> Sat, 27 Sep 2008 23:14:50 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300745/ https://lwn.net/Articles/300745/ pynm0001 <div class="FormattedComment"> "For the same reason, I don't think a new framework will pop up from<br> nowhere that supplants Gstreamer - these things take time to mature, and<br> even if one does appear, I doubt it would be ready before KDE 5.xx."<br> <p> A new framework isn't the issue. All that is required is to break API<br> compatibility in gstreamer itself.<br> <p> This happened no less than two times in my time with JuK in KDE 3. We had<br> C++ bindings to gst-0.6 which we used in JuK. These bindings were broken<br> by gst-0.8 and we eventually simply coded gst-0.8 support directly into<br> JuK. Then gst-0.10 came out and we had to re-do the support again. <br> gst-0.10 has been out for awhile but do you want to be the one to guarantee<br> that gst-0.12 won't be out while KDE 4 is still supported?<br> <p> I've gone over all of these arguments more than 2 years ago:<br> <a rel="nofollow" href="http://lwn.net/Articles/183462/">http://lwn.net/Articles/183462/</a><br> </div> Fri, 26 Sep 2008 21:33:26 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300701/ https://lwn.net/Articles/300701/ quintesse <div class="FormattedComment"> Well with the advantage of hindsight it's obvious they made the wrong choice, but you just can't look into the future so it makes sense to "protect" yourself.<br> <p> And that making a new audio framework takes time is undoubtedly true but if I see it correctly GStreamer was in development for 3 years before it got included in GNOME (I imagine because it was good-enough by then, but maybe even before that?) while the entire lifetime of KDE3 has been 6 years! And that's up to now, KDE3 isn't dead yet. A lot can happen in 6 years.<br> <p> But it the end it just comes down to what you yourself are saying: make the simple things easy. Well that's what Phonon does, it makes it very easy for you to add media capabilities to your application and it will even let the user/distro decide which framework to use. That's a pretty big advantage! And it still makes the hard things possible. How? Well you are not forced to use Phonon! Just go ahead and use the any underlying framework that you want. And if in the end it's GStreamer that wins out over all the other frameworks (which at this point in time at least seems likely) you don't have to worry about having several frameworks installed on your system either, both your media studio app and Phonon will be using the same one!<br> <p> </div> Fri, 26 Sep 2008 17:01:53 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300674/ https://lwn.net/Articles/300674/ obi <div class="FormattedComment"> "They did once and it backfired completely saddling them up with an unmaintainable situation in what was most of the KDE3.x lifetime."<br> <p> Maybe they just chose the wrong framework? From what I can remember, not a lot of people were actually working on aRts, and it didn't actually already have the features needed for a multimedia framework.<br> <p> I don't want to hold up Gstreamer as the only shining example of everything that's good and proper, but at least Gstreamer has been around a while and has actually been doing video and complicated pipelines for a while. Experience over a few release cycles make me trust it a lot more. Plus it has a lot of mindshare in general, so it would seriously surprise me that it would all of a sudden die off in the middle of a KDE cycle.<br> <p> For the same reason, I don't think a new framework will pop up from nowhere that supplants Gstreamer - these things take time to mature, and even if one does appear, I doubt it would be ready before KDE 5.xx.<br> <p> As the adage goes "make sure the simple things are kept simple, and the hard things possible". It's nice (and important) that Phonon makes the simple things easy for 90% of the applications - however the hard things are simply impossible with Phonon, without dragging in the frameworks themselves anyway.<br> <p> </div> Fri, 26 Sep 2008 15:26:57 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300642/ https://lwn.net/Articles/300642/ quintesse <div class="FormattedComment"> "I believe that just picking one would've saved a lot of work and memory"<br> <p> They did once and it backfired completely saddling them up with an unmaintainable situation in what was most of the KDE3.x lifetime.<br> <p> And they specifically say that Phonon is for those applications that have only modest audio/video needs. So it will do relatively simple playback and capture which will be enough for 99% of the applications (which includes full featured media players). Basically the only applications it will not be enough for are those that do audio/video processing/editing. But in that "application space" GStreamer isn't the only one either because a lot of those apps want to support things like JACK as well.<br> <p> And let's not forget that Linux is about choice, I think in an an environment like KDE/Qt that needs to be binary compatible for MANY years betting on one single audio layer (that you don't control) is just stupid. GStreamer might never go away, true, but maybe in 2 years something even better comes along and we want to use that for our apps. Why not make that a possibility? (Only half a year ago I would always use the Xine back-end for most of my media apps because it just worked better on my system.)<br> <p> </div> Fri, 26 Sep 2008 11:49:22 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300637/ https://lwn.net/Articles/300637/ macson_g <div class="FormattedComment"> Phonon shipped with Qt-4.4 is still in experimental state. This is the first time they included externally developed open source code into they codebase, and apparently they followed the "release early" principle.<br> <p> From Qt-4.4 documentation:<br> <font class="QuotedText">&gt; Phonon and its Qt backends, though fully functional for multimedia playback, are still under development.</font><br> </div> Fri, 26 Sep 2008 10:48:45 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300623/ https://lwn.net/Articles/300623/ xav <div class="FormattedComment"> Some comments in the blog article, as well as the Wikipedia page describing Phonon you just linked to: look at the list of features, they all start with "Phonon will ...".<br> </div> Fri, 26 Sep 2008 07:05:00 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300599/ https://lwn.net/Articles/300599/ obi <div class="FormattedComment"> First of all, it's true that if you're developing a QT4 app and you should definitely consider Phonon when evaluating sound APIs. It exists, it's out there, and if you're linking to QT4 already, there's no reason to avoid it.<br> <p> That being said, I've always had a bit of trouble understanding Phonon's raison d'ĂȘtre. From what I can tell - and feel free to correct me -, Phonon was made to:<br> <p> 1) have a clear and simple API that meshes well with QT, <br> 2) make portability to Windows and MacOS a bit easier,<br> 3) make sure that QT/KDE libs ensure ABI compatibility - i.e. avoid the risk of having to maintain an old branch of an unfamiliar multimedia framework (f.e. gstreamer 0.8) on their own for the duration of the QT/KDE 4.xx cycle, <br> 4) avoid the politics of having to pick and bless a multimedia framework for use with QT or KDE.<br> <p> <p> However, I wonder whether in doing so Phonon users lost more than they gained. Not picking an existing framework and creating a abstraction layer means that:<br> <p> 1) Phonon apps can only use the "simplified" API: they can't f.e. manipulate the gstreamer pipeline the Phonon gst backend creates for them<br> 1b) ... which means apps will be tempted to stick to the functionality Phonon provides; brave koolaid-drinking app developers might try to extend the Phonon API (and the backends), others will just pick a multimedia framework that allows them to express what they need for their slightly more advanced app. But of course, they will all choose a different framework ;-)<br> 2) resorting to an abstraction for portability was unnecessary. IIRC, gstreamer can bridge to and reuse Directshow components on Windows, and Quicktime components on MacOSX.<br> 3) they had to write decent Phonon backends which probably is quite a bit of work and deals with the framework they're not familiar with. To avoid _the possibility_ that the framework might move on and stop maintaining the branch QT or KDE committed to for the duration of the ABI cycle. Um...?<br> 4) ... and as mentioned before, while they avoid the politics of having to bless one multimedia system, the discussion won't really go away. The developers of non-trivial apps will still have to make a choice.<br> <p> End result: if you have some simple and some advanced multimedia apps running, you'll end up with Phonon + backend + one or more multimedia frameworks in memory. I believe that just picking one would've saved a lot of work and memory.<br> <p> </div> Fri, 26 Sep 2008 02:55:58 +0000 PortAudio https://lwn.net/Articles/300545/ https://lwn.net/Articles/300545/ dmarti Don't forget <a href="http://www.portaudio.com/">PortAudio</a>. If you're going to judge a tree by its fruits, Audacity is a working application on the Microsoft, Apple, and Linux platforms (good enough that mic manufacturers can put a copy in a box with a USB mic and call it COMPLETE PODCASTING KIT) and it uses PortAudio. <p>Looks like this could be a useful project for somebody: <a href="https://tango.0pointer.de/pipermail/pulseaudio-discuss/2007-November/000890.html">PortAudio/PulseAudio Integration</a> Thu, 25 Sep 2008 20:34:13 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300543/ https://lwn.net/Articles/300543/ drag <div class="FormattedComment"> Ya need to relax. <br> <p> He said it's obsolete, not depreciated. There is a difference. In his opinion it's a awkward and difficult design and requires every application that supports it to have their own resampling mechanisms, among other things. "Obsolete", in this case, is politically correct codeword for "it sucks so don't use it".<br> <p> Also he went out of his way to mention (since he mentions it multiple times) the fact that most of the libraries he was talking about have OSS support. Even Alsa libs can run on OSS and are quite possibly portable even though nobody is interested in making them run on anything other then Linux. In most every category mentioned he recommends NOT programming in Alsa except for very simple PCM playback and capture and low-level audio plumbing. <br> <p> His recommendations:<br> Jack -- has OSS support <br> SDL -- has OSS support<br> libcanberra -- has OSS support<br> "Safe" ALSA -- has OSS backend<br> PulseAudio -- has OSS support<br> <p> <p> </div> Thu, 25 Sep 2008 20:27:14 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300539/ https://lwn.net/Articles/300539/ wertigon <div class="FormattedComment"> OSS deprecated? WTF? OSS3, yes, but OSS4 definitely isn't.<br> <p> The reason? It's spelled *BSD, Solaris and virtually *every other UNIX out there*. ALSA is *incompatible* with those, and trying to kill off OSS the way Linux is doing it will only lead to lots of extra pain for people trying to write things that works on the other UNIXes, sadly.<br> </div> Thu, 25 Sep 2008 20:10:43 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300533/ https://lwn.net/Articles/300533/ bangert <div class="FormattedComment"> <a href="http://en.wikipedia.org/wiki/Phonon_">http://en.wikipedia.org/wiki/Phonon_</a>(KDE)<br> <a href="http://en.wikipedia.org/wiki/Qt_">http://en.wikipedia.org/wiki/Qt_</a>(toolkit)<br> <p> Phonon has been shipped with Qt 4.4 - release date May 6, 2008.<br> <p> <font class="QuotedText">&gt; Apparently Phonon isn't yet in a fully working state.</font><br> <p> What makes you think so?<br> </div> Thu, 25 Sep 2008 19:47:04 +0000 OpenAL omitted? https://lwn.net/Articles/300516/ https://lwn.net/Articles/300516/ drag <div class="FormattedComment"> <font class="QuotedText">&gt; Where is OpenAL in Lennart's picture? It's the standard way of doing positional audio in modern games for Linux (SDL is only useful for basic 1980s-1990s style games), but Lennart does not mention it at all.</font><br> <p> I wouldn't look down at SDL audio to much. Quake4 uses it, for example. (I think). <br> <p> But it's probably worth mentioning. <br> </div> Thu, 25 Sep 2008 19:19:05 +0000 OpenAL omitted? https://lwn.net/Articles/300502/ https://lwn.net/Articles/300502/ tetromino <div class="FormattedComment"> Where is OpenAL in Lennart's picture? It's the standard way of doing positional audio in modern games for Linux (SDL is only useful for basic 1980s-1990s style games), but Lennart does not mention it at all.<br> </div> Thu, 25 Sep 2008 17:52:01 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300482/ https://lwn.net/Articles/300482/ kripkenstein <div class="FormattedComment"> Well, whether Qt is the best choice is debatable, and it's one of the most common recurring debates we have in these parts. So no need to rehash that stuff.<br> <p> Now, if we're talking about cross-platform sound, then one could argue that SDL is a good choice. It works on more platforms than basically anything else (there is even an iPhone port, that only awaits Apple's blessing).<br> <p> </div> Thu, 25 Sep 2008 16:08:35 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300469/ https://lwn.net/Articles/300469/ xav <div class="FormattedComment"> Apparently Phonon isn't yet in a fully working state.<br> </div> Thu, 25 Sep 2008 15:24:06 +0000 A Guide Through The Linux Sound API Jungle https://lwn.net/Articles/300465/ https://lwn.net/Articles/300465/ kev009 <div class="FormattedComment"> Phonon is really glossed over in the article. If you want real cross platform apps for Windows, Mac, and Unix QT4 should probably be the first place you check.<br> <p> See: <a rel="nofollow" href="http://aseigo.blogspot.com/2008/09/linux-audio-layers.html">http://aseigo.blogspot.com/2008/09/linux-audio-layers.html</a><br> </div> Thu, 25 Sep 2008 15:16:55 +0000