Slashdot Mirror


Introduction to Linux Sound Systems and APIs

UnderScan writes "Linux.com is running an article on Linux kernel sound subsystems, OSS & ALSA, and their APIs. Insightful commentary from both users and the project's developers can be found at OSNews.com comments section."

5 of 43 comments (clear)

  1. Moving programs from OSS to ALSA by linuxkrn · · Score: 4, Informative

    Being a Gentoo user, I've been running ALSA for some time. While ALSA has an OSS compat API that you can load, it doesn't allow you to have the full control of more advance cards. (Like the EMU10k1/2 chipsets)

    While oss-compat-api will give you basic sound, mixer controls, etc. sometimes you want to do more advanced things. For example, I use a tvtuner app and wanted to be able to control detailed mixer channels (Analog Capture Volume and Analog Playback Volume) that just couldn't be done with OSS. Looking at my app, tvtime, I found it only had OSS mixer controls. So I just took a weekend to learned/wrote the ALSA API version for it. Wasn't too bad and the app works great now. I can configure any control (mixer channel) on any card I want. Hopefully the dev will include the patch I sent it in the 1.0 release this month.

    I know that this isn't an option for everyone. But I think as time goes on, more and more apps should have support for ALSA. Especially since it's in the 1.0.x range and the API has become more stable.

  2. these systems are junk by XO · · Score: 3, Informative

    The Audio subsystems are junk. Mixing should be handled intelligently by the drivers, and it should be standard unix systems used to access it. You want to play a file, you dump it to /dev/audio, you want to record something, you open /dev/mic or /dev/linein and and record it.

    Additional controls should be handled by ioctls to the special devices.

    The sound system in Linux is a nightmare.

    --
    "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  3. Re:Just copy Core Audio and be done with it by Unknown+Lamer · · Score: 4, Informative

    JACK uses a callback based API much like Core Audio.

    Basically every high-end (e.g. ardour, JAMin, Rosegarden, Hydrogen, etc.) uses it.

    You can get really low latency using it if you have good sound hardware (e.g. RME Hammerfall for extremely low latency or even an M-Audio Delta 1010). Something like an SBLive! (what I have) will need a period size of 2048 bytes with two periods to avoid underrunning (I have a Dual AthlonMP 2800+ so I'm pretty sure it's the sound card...). Stuff like QJackCtl and Jack-Rack make controlling Jack easy.

    Getting realtime mode working for a normal user can be tricky, but Debian makes it really easy. Just install the realtime-lsm package and build the realtime-lsm-source package for your kernel and all users in the audio group gain the ability to run applications realtime (at least with the default config). It could be made easier (mainly by prebuilding the realtime-lsm modules for the stock kernels) but GNU/Linux pro-audio is still mostly for hackers and adventurous people right now. Stuff like PlanetCCRMA and AGNULA are aiming to make everything work out of the box. I have yet to try either (I use Debian so PlanetCCRMA is useless for me) but it looks like DeMuDi has everything set up for recording out of the box.

    --

    HAL 7000, fewer features than the HAL 9000, but just as homicidal!
  4. What's happened in the last few years by 0x0d0a · · Score: 4, Informative

    Oh, let's see:

    * The OpenAL library came around. Does 3d audio, hardware mixing, doppler, etc, etc. Good for games.

    * OSS/Free got deprecated.

    * The plethora of eight million halfassed sound servers resolved down into just a few -- artsd is probably going away in favor of JACK (if the article is correct), which means that we just have the (icky) esound -- which with any luck will give way to JACK -- and JACK. Finally, applications can avoid having eight million output plugins.

    * Hardware mixing in drivers became par for the course. Five years ago, everyone used OSS/Free. Today, you can play audio in xmms and *still* hear your "bong" when an error occurs without having to ram everything through a high-latency sound server.

    * Wavetable MIDI is, at long last, reasonably well supported. I remember the early days with my emu10k1-based Sound Blaster Live Value and earlier cards where I had to just use FM synth because I couldn't load soundfonts to my card. Linux was behind for years here.

    * Creative Labs is no longer ignoring Linux users.

    * At least in theory, I can use the DSP on my emu10k1 chip to do things like adjust bass.

    * There are half-decent sound applications out there. Rosegarden doesn't suck, there are synths and trackers and editors. Still not the same as a Windows or MacOS-based sound editing environment, but you can actually do sound work on Linux without coding up your own tools. :-)

    I actually really like Linux as a sound-using environment. I can plonk two or three sound cards into a Linux system and (unlike Windows) all my apps let me choose what device to play out of. I can be playing music going to speakers out of Sound Card A for everyone in a room, but still be listening to what someone's saying on VoIP over my headphones connected to Sound Card B.

  5. Re:Re-inventing the wheel. by 0x0d0a · · Score: 2, Informative

    On the Microsoft side, DirectX came out nearly 10 years ago...

    Let's see ... that would be, what, ten years after the initial release of Windows 1.0 (we'll ignore DOS for the moment)?

    And DirectX is comparable to SDL, not to ALSA/OSS. How many years after Linux was in a releasable form did SDL come out?

    ALSA/OSS is a driver revamp. I do believe Microsoft underwent a pretty thorough throwing out of drivers when they ended the 9x line and moved to the NT line completely.