Home page > Linux > Sound APIs in Linux (yet again)

Sound APIs in Linux (yet again)

Wednesday 1 October 2008, by Toots

I would like to add some clarifications to the debate on linux sound APIs that happened last friday on planet.

First, despite being portrayed as such, I am nothing like an OSS zealot. I was just recently surprised that OSS developpement still exists and that no one cares. Hence, my initial motivation for my post was to correct false informations, not to advocate for any solution.

Now, since the debat has been opened to the issue of linux sound APIs, I feel like adding my two bits. In particular, unlike Josselin, I don’t believe that the debate is irrelevant. I, too, would like that we consider two levels for sound APIs:

  • Low level, decidated to some specialized applications
  • High level, used for simple sound applications, in particular in a desktop environement.
However, there are few points that are missing in Josselin’s claim:
  • This distinction was not an initial design for ALSA. ALSA was aimed at being both low level and high level, in particular with the pcm virtual devices. However, the lack of documentation and the absence of any high level programming interface for the high level pcm virtual devices just made this goal totally fail.
  • Desktop environements didn’t agree on a common standard. Even though there seems to be some solutions that are emerging now, like pulseaudio, this is not at all a standard yet. For instance, all graphical mixers I know about only support ALSA.

So, yes, I believe there is still a debate which should not be closed be throwing away idealistic solutions, but by discussing the real issues and trying to settle real solutions.

Lennart also commented on previous message that he had adressed most of the remarks concerning the initial guide. In particular, he notices that OSS4 does a lot of audio processing in-kernel, objecting that this means that OSS4 will never be part of the official kernel. This is true, but it doesn’t mean there are no life outside of the stock kernel. Here, again, it is a matter of liberty of choice. If some audio applications are better suited for OSS4, then I don’t see why we shouldn’t provide this alternative.

8 Forum messages

  • Sound APIs in Linux (yet again) Le 1 October 2008 à 17:58 , by engla

    1. To be a successful audio backend, it needs a userbase that has it available — otherwise it is not a worthwhile alternative for developers.

    2. So it needs to get into distributions, which would be much easier if it was in the mainline kernel.

    3. The easy way to get into the mainline is to be picked up by a distribution to provide a good test.

    If 3. is fulfilled, 1. will be fulfilled as well and OSS4 might come somewhere..

    Reply to this message

  • Sound APIs in Linux (yet again) Le 1 October 2008 à 18:17 , by Np237

    This distinction was not an initial design for ALSA.

    Indeed, and ALSA is a complete failure as a high-level API, just like OSS.

    For instance, all graphical mixers I know about only support ALSA.

    You are completely wrong. For example the GNOME mixers have been based on GStreamer, which supports both OSS and ALSA, for quite a while.

    So, yes, I believe there is still a debate which should not be closed be throwing away idealistic solutions, but by discussing the real issues and trying to settle real solutions.

    Who is throwing away idealistic solutions? One real issue is that both ALSA and OSS developers are focused on trolling about which of the two APIs is better for applications, a battle that they have both already lost. Another real issue, which is very related, is that hardware support is very poor since driver developers are trying to develop high-level APIs instead.

    Reply to this message

  • Sound APIs in Linux (yet again) Le 1 October 2008 à 21:58 , by Toots

    Np237: I am not an OSS developper. I fail to see why you claim they are trolling (and I am not trolling :-P)

    Besides, hardware support has been claimed to be very well done in OSS4, that’s mainly how I got to hear about it, and after all that was their main business for 10 years so..

    Did you try these drivers by the way ?

    Reply to this message

  • Sound APIs in Linux (yet again) Le 1 October 2008 à 22:50 , by Nate

    > If some audio applications are better suited for OSS4, then I don’t see why we shouldn’t provide this alternative.

    Because if you have one pile a shit, and you decide you don’t like how it smells, then dropping another turd on to cover it up isn’t going to accomplish much. :)

    I mean, sure, it sounds good in practice to have two alternatives, but what you end up with is users choosing between which type of fail they are going to suffer through, meanwhile other OSes have capable systems that can do the same job as both and require a hell of a lot less nerd cred to run successfully.

    If users have to choose between OSS4 vs Alsa drivers based on the application they plan to use on their desktop then that is a completely broken design right from the outset. There is no way in hell that makes sense if you look at it objectively.

    The solution is to reform Alsa, get the documentation made, improve the drivers, simplify things with the ’safe’ Alsa API set, minimize the ’high level’-less of Alsa and get something that is functional and is possible to program for people needing low-level access to hardware.

    Then encourage people to stop Alsa directly, for anything, unless they absolutely need it.

    Then you take care of portability issues with the libraries those applications use, so that users and developers are not exposed to it and they don’t care because they should not have to care.

    Reply to this message

  • Sound APIs in Linux (yet again) Le 1 October 2008 à 23:26 , by Toots

    “If users have to choose between OSS4 vs Alsa drivers based on the application they plan to use on their desktop then that is a completely broken design right from the outset. There is no way in hell that makes sense if you look at it objectively.”

    Do you realize that audio applications cover much more than desktop usage ?

    Reply to this message

  • Sound APIs in Linux (yet again) Le 2 October 2008 à 10:50 , by Np237

    Do you realize that audio applications cover much more than desktop usage ?

    The problem is the same for desktop, games, professionnal sound applications or whatever.

    X and OpenGL drivers are independent from graphics applications. All you access is the Xlib and the libGL. And most of the time you only use even higher-level libraries.

    Network drivers are independent from network applications. All you need is to use system calls that are completely independent from the OS, except when you are doing low-level stuff like dumping packets.

    It should be obvious that sound drivers need to be independent from sound applications as well. And this is the wish of application developers, who currently have high-level APIs like GStreamer, libcanberra, SDL and JACK. Except when doing low-level stuff like fiddling with internal parameters of the sound card, you should never need to deal with the driver layer. It is completely wrong to expect developers to make the application dependent on the driver when all they want is to playback or record sound.

    Reply to this message

  • Sound APIs in Linux (yet again) Le 2 October 2008 à 13:59 , by Toots

    Well, I would agree with you on the necessity to unify low-level APIs, only that it does seem to me that Linux started to play on its own when it switched to ALSA, since all other UNICES use OSS.

    Besides, since different OSes often means different low-level APIs, when dealing with a portable application, one always need to support various low-level APIs.

    About networking, you are assuming that the networking stack is the high-level API, which seems a bit awkward.

    About graphics, I wouldn’t argue given the giant hole that the kernel offers to the X server, basically meaning that there is simply *no* low-level kernel API there...

    Reply to this message

  • Sound APIs in Linux (yet again) Le 2 October 2008 à 19:49 , by Mark Brown

    Np237: To be fair to the ALSA and OSS developers I’ve really not noticed any of them participating in these debates - it’s mostly been people working higher up in the stack and people not really working on audio.

    Reply to this message

Reply to this article