Slashdot Mirror


ALSA vs. OSS vs. OSSFree

scenic writes "I was wondering what experience the /. community has had with ALSA vs the sound drivers that are part of the Kernel and the various other choices (such as the 4Front OSS packages). I've used the commercial OSS drivers as well as the "included" Linux drivers. I've started to look to ALSA for better sound response (for example, I've noticed with esd and the basic linux drivers, there is sometimes a lag when playing back video files through esd. I understand that esd is part of the issue, but it's sort of important to be able to multiplex sound). What have others' experiences been? What other solutions are there aside from things like esd?" Which sound systems do you find work for your system, and which don't? If specific hardware / software combinations can be endorsed or critiqued, it'll probably help a lot of people.

32 comments

  1. Read "Programming Linux Games"... by wrinkledshirt · · Score: 5, Informative
    John Hurt does an interesting breakdown of six different methods of programming sound for games, and talks about the advantages and disadvantages of each (not just the programming part).

    According to him OSS is a pretty entrenched technology, but ALSA's continuing to grow. The fact that ALSA's retaining nearly 100% compatibility with OSS probably means that at some point you'll be able to make a full shift from OSS to ALSA...

    Don't know if that's helpful (or even relevent).

    --

    --------
    Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...

    1. Re:Read "Programming Linux Games"... by Anonymous Coward · · Score: 0

      got a link?

  2. Use ODK by Anonymous Coward · · Score: -1, Offtopic

    I prefer to compile ODK by FazIgu and use that.

    thank you

  3. Get a real sound card by bconway · · Score: 2, Insightful

    It sounds like your problem has nothing to do with the drivers you're using, it's that you're using a sound daemon. Most quality sound cards (like the SB Live Value, 39 bucks on pricewatch) will mix up to 32 wav sources in HARDWARE. There's no need to use esound or arts sound daemons to do mixing for you, and they only muck up the works. I've been using the OSS drivers from opensource.creative.com for my SB Live, but these were merged into the latest kernel releases, so I have no need to look outside the kernel.

    --
    Interested in open source engine management for your Subaru?
    1. Re:Get a real sound card by Anonymous Coward · · Score: 0

      How is this a troll? God, I just metamoderated half of my page as unfair because you people are on crack. I can't wait to see you assholes in metamoderation.

  4. Okay, here's the funny thing! by Anonymous Coward · · Score: 1, Funny

    "Programming Linux Games" is what's known as a "book," an ancient analog data storage device. Hence, you can't "link" to it, you have to actually physically acquire a copy of it in meatspace and then "read" it. Sounds crazy, I know.

    1. Re:Okay, here's the funny thing! by Anonymous Coward · · Score: 0

      Kinda forgot to read the subject line, since they seldom hold any important info...

    2. Re:Okay, here's the funny thing! by mattdm · · Score: 2

      :) Actually, you can link to books.

      (This bit here is to get around the stupid "postercomment compression filter" yet still post my insightful comment....)

  5. Vote for ALSA by spuk · · Score: 3, Informative
    ALSA seems to have a better design and general quality. My (crappy) onboard ESS Solo 1 barely works (only pcm playback, didn't even record, the last time I checked) with the kernel driver, and its alsa driver supports (almost?) all the features, including 3D effects and all the in/out channels.

    --

    "Video bona proboque; deteriora sequor." -- Ovid
    1. Re:Vote for ALSA by Anonymous Coward · · Score: 0

      Thx for the info... My new mobo has a solo1 on it. Of course, the solo1, technically, isn't an OSS driver, it just tries to mimic the interface.

    2. Re:Vote for ALSA by Platypii · · Score: 1

      I agree that ALSA is by far better..... For a while I thought I would have to pay more for my sound driver (OSS) than every piece of software on my system! Then I discovered ALSA was the only other way to get my ALS4000 working under linux! :-)

  6. Program using the OSS/Free API for now by salimma · · Score: 3, Informative
    As has been mentioned, ALSA has OSS compatibility, and even better, automatically multiplex audio streams for you. Yes, you can play multiple sound files at the same time without a sound server.

    Kind of like the jump from Win9x to Win2k, soundwise.

    HTH,

    Michel

    --
    Michel
    Fedora Project Contribut
    1. Re:Program using the OSS/Free API for now by sinator · · Score: 1, Interesting

      My understanding is Mandrake 8.0 used ALSA exclusively. I use the Maestro 2 chipset (it's a crappy no-name laptop), and it didn't seem to multiplex sounds at all. Hence I use artsd. Am I completely on crack, and is there a definitive way to test if the ESS Maestro 2 is capable of/currently wavetable mixing via ALSA?

      --
      Three Step Plan:
      1. Take over the world.
      2. Get a lot of cookies.
      3. Eat the cookies.
  7. Mandrake by Shook · · Score: 1

    I have an on-the-motherboard chip by C-Media. I automagically had multiplexed sound on my first bootup of Mandrake 8. Now only if I could get my dual monitors working with my Radeon VE. :-(

  8. You need the 0.9.0 betas by salimma · · Score: 1
    I should have clarified this, the multiplexing works for 0.9.0 upwards only. Sorry.

    Michel

    --
    Michel
    Fedora Project Contribut
  9. ALSA 0.9.0 betas are frustrating by Redline · · Score: 2, Informative

    While the latest ALSA drivers sound wonderful on my SB Live, I have a non-technical problem with them.

    I have tried to build several programs and libraries that have "native" ALSA support, and ALSA gets detected properly at configure-time. Then I proceed to make, and the build will die because the app only supports the 0.5.0 ALSA interface, and not 0.9.0. It is not really the fault of the ALSA drivers, the configure scripts (and ideally the software package itself) need updating to be aware of the newer ALSA interface.

    I just feel like I am losing functionality when I have to reconfigure the software with "--disable-alsa" and let the OSS emulation layer get used. <sigh> I wish I had more time to hack on my favorite projects. ALSA 0.9 for everyone!

    1. Re:ALSA 0.9.0 betas are frustrating by salimma · · Score: 1
      Indeed. Situation will improve when they declare the API completely frozen, of course. Sometime before 1.0 is released, but even now it is much better than OSS.

      I believe some of Red Hat's beta testers who own SB Lives have been rather unhappy at the state of the emu10k driver in the latest kernels...

      Ran into snags with programs' configure trying to enable ALSA support. Solution? Do not install the alsa libraries, just install the drivers. Works for me.

      Regards,

      Michel

      --
      Michel
      Fedora Project Contribut
    2. Re:ALSA 0.9.0 betas are frustrating by Dashslot · · Score: 1

      Ran into snags with programs' configure trying to enable ALSA support. Solution? Do not install the alsa libraries, just install the drivers. Works for me.

      Sounds like fun, one question: Are you able to multiplex connections using the oss-compatibility mode? Another Question: Will that work with all the drivers?

      Cheers.

    3. Re:ALSA 0.9.0 betas are frustrating by salimma · · Score: 1
      Sounds like fun, one question: Are you able to multiplex connections using the oss-compatibility mode? Another Question: Will that work with all the drivers?

      Answering the first question, yes it works in oss-compatibility mode. In fact I have not really tried its native mode - the hassle of there being almost no application that support it natively being the culprit, as well as having to recompile.

      One would expect the soundservers (esd, arts) to be the first programs to support ALSA 0.9.0, but that would be defeating the purpose of doing multiplexing without a sound server, no?

      As to the second question, I have tried it with the ymfpci driver. YMMV. But if they implement it like Win2k's sound drivers, which I have tested on the good ol' SB AWE64, it should work on most drivers.

      Yours,

      Michel

      --
      Michel
      Fedora Project Contribut
    4. Re:ALSA 0.9.0 betas are frustrating by Dashslot · · Score: 1

      Thanks for your response.

      I tried compiling up the newest drivers, but I was unable to get it mutliplexing - don't know if I missed a switch somewhere though. Symptoms were while playing a Real stream, loading xmms and pressing play - the latter froze until Real was stopped, at which point it came back to life. Am I missing something?

      This maybe because of my crappy Intellistaion onboard sound (i8x0 with ac97 codec)

      Cheers.

  10. The new slashdot sucks by Anonymous Coward · · Score: -1, Offtopic

    OK, many of you have probably noticed a lot of ascii art flooding this board lately. You're no doubt wondering why CmdrTaco's much encountered "lameness filters" are ineffective against it. To answer that question, I'm going to take you on a Perl journey, deep into slashcode. Think of it as being a bit like "Heart of Darkness", or if you're a typical slashdot pleb, "Apocalypse Now!"

    The first files we'll be looking at are the infamous "bitchslap" and "modslap". I think these are a pretty decent introduction to how Rob's mind works when he's coding angry: Here's bitchslap [slashcode.com]. Scroll down to the section labelled "main program logic". BTW. "main program logic" is a ridiculously grandiloquent phrase for what we are seeing here.

    Note how draconian this is. I like to think of this code as a memorial to slashdot-terminal, it's first victim. You can see how Malda deliberately broke his "self-regulating" moderation system, to give the admins of slashdot dictatorial powers. This code allows any admin using it to drop a user's default threshold to -1 instantly, and drop his karma down to a level from which it is unlikely to recover. I've heard that this script has been used on slashdot in a modified form, with the -defaultpoints set to less than -1, completely eliminating a user's post from normal viewing, unless people edit their query string manually.

    On to modslap [slashcode.com]. Scroll down to "main program logic" again.

    OK, what you're seeing here is Taco's method of restricting the flow of crack to moderators, to keep them nice and jumpy. If you don't mod the way he likes, you're moderating days are over, and your karma plummets to bitchslap levels. An ugly tool.

    To recap, the man we are dealing with here is obviously an anti-democratic tyrant. Censorship is his weapon, and he is vigilantly watching his censors, to ensure that no freedom is allowed to enter his domain. I believe he also lives in a hut with a man driven crazy by his proximity. The hut is surrounded by skulls on poles, but the skulls face inward. Remember that.

    We're nearing the locus of my investigation now. You've heard the legends, now gaze into the face of comments.pl's so-called "troll detection code!"

    comments.pl [slashcode.com]: Scroll down to the section under "here begins the troll detection code".

    You may be wondering why it's such an ungodly piece of crap. I feel that we are seeing evidence of an ingrained unwillingness to think before coding.

    The first few tests are fairly simple, based on regexps and length. They're pretty laughable, from an information theory perspective. If you don't believe me, the parent of this post should supply adequate evidence of what I'm talking about. Language is a complex thing, and a few simple tests are insufficient to distinguish English from ascii art, especially when the ascii artists are willing to take extreme measures to see their work posted. Regular posters do not have the patience for such chicanery.

    The final test is my favourite, though. It begins under the comment ending with this charming sentence: "These ratios are _very_ conservative a comment has to be absolute shit to trip this off". An interesting claim. Considering the number of posts I've tripped this filter on, without doing anything out of the ordinary, I'd say "conservative" means the same thing to Taco as it means to George W. Bush, nb. "nazi". What we are talking about here, is the postercomment compression test. (The horror! The horror!) "postercomment" is just the name of the field your comments are sent in, by the way. It isn't cool top secret slashspeak. It's just a variable name.

    What this does is, it actually compresses you're comment using zlib, then checks the change in size to decide if you are a troll or not! Furthermore, the code comments indicate that if you trip this test, slashcode thinks you are a "luser". Code like this makes it pretty clear that it takes one to know one, Rob!

    As someone who as actually seen Rob Malda use the phrase "it won't scale" to dismiss questions about why parts of the moderation system weren't done in a more equitable fshion, I'd like to take this opportunity to laugh until I give myself a hernia.

    Anyone who has studied information theory knows that the redundancy of english is estimated at about 50%. This value is fairly key in what we are seeing here, it determines a fair estimate of how effective compression of english text can be before we start to lose information. Taco's estimates were based, in his words, on "...testing out several paragraphs of text...". Doesn't sound like a particularly large sample group. What's more, it's indicative of poor software engineering practice. As is the recent bout of outages.

    A few final criticisms. Firstly, there are far better, less memory intensive, and above all, less stupid methods of performing textual analysis than checking it's compression ratio. If Taco had any idea about computer science, he might have investigated a few before making a fool of himself in public like this. It's pretty clear that he's getting more and more frustrated with the situation on slashdot, and doesn't realise that if he ruled with an even hand, rather than a bitchslapping script and an army of trained thought police, the problems would not be so grave.

    Secondly, I thought of a much more effective method of eliminating asci art posts, and it will never cause problems for genuine posters. What's more, it's extremely compact and doesn't even require regexps. I won't reveal it here, as I am not willing to assist in a reign of terror that I find to be reprehensible.

    As further evidence of the lengths Malda and Co. may be willing to go to, you can find a commented out section that enables the deletion of posts and their descendant threads. We have no reason to believe that this will not be employed on slashdot.

    Editorial notes: I don't use Perl and this is really the first time I've examined it closely. It's pretty much convinced me that I'm not missing much. I use real languages such as C and C++ and occasionaly asm to do most of my work, and I, along with 95% of the enterprise world, find Java to be the best solution for web programming. For most scripting tasks, shell script suffices. For more complicated scripting tasks, Python provides a more sensibly designed scripting environment. Additionally, as if to provide further evidence of Malda's incompetence as a programmer, I've hit the junk character post every single time I've previewed this comment, and am now forced to resort to edit it. Regretfully, I have been forced to replace the Perl fragments I was using with hyperlinks. Very unsatisfactory.

  11. What I want to know is... by Wakko+Warner · · Score: 2

    ...which drivers support playing more than one goddamned sound at once? IRIX can do it. Hell, even Solaris 8 can do it. And, you know, Windows has been able to do it since Win95. It's been 10 years; where are my concurrent Linux sound drivers?

    Does anyone know if they exist and what card I should be purchasing?

    (Please do not mention ESD, the Enlightened Sound Daemon. This is not a good solution. ESD built into the kernel would be.)

    - A.P.

    --
    "Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
    1. Re:What I want to know is... by Anonymous Coward · · Score: 0

      alsa 0.9.x and above. esd sucks.
      any high end SB card (like the live) can do it. my Yamaha YMF 744B on board chipset can do it but its not SB compatible.

    2. Re:What I want to know is... by LyNXeD · · Score: 1

      I run a Creative Labs SBLive! Value OEM, picked it up for about $50 a while back (they're probably cheaper now.) Love it, works great, don't have to use esd or anything like that. (Only use for esd I've found is to send sound across the LAN.)

      I absolutely hate my Ensoniq AudioPCI (I think it's a Creative card too) that I have at work as it only supports one sound at a time - I'm stuck using esd there. But here at home, using the SBLive works great.

    3. Re:What I want to know is... by gid · · Score: 3, Informative
      As mentioned above, yes ALSA supports hardware mixing. When you have the ALSA drivers running, and one of the magical sound cards, then more than one program can essentially use /dev/dsp at once. I've been digging for about 30 minutes now and still can't find a list of cards that support hardware mixing. So here's the cards that I KNOW support hardware mixing:

      ymf724 pci based cards

      ymf744 pci based cards, it's essentially a ymf724 but it has digital out, and 4 channel out

      SB Live

      Trident 4DWave

      I own two ymf724's and a ymf744, great cards, they sound great, and they're cheap :) The ymf744and ymf724 have issues with quake3, it hangs on exit :( But you can just kill off the process luckily. This is with the latest .9.0beta7 drivers, the .5.x drivers don't have any noticeable issues though.

      A quick search here's the cards: ymf744 [$18] and ymf744 pro version (digital out version?) [$25]

    4. Re:What I want to know is... by Wakko+Warner · · Score: 1

      Dude, you rock.

      I just picked up one of the $25 cards (on backorder) and, with any luck, my problem is solved.

      Who says Ask Slashdot doesn't work?!

      - A.P.

      --
      "Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
    5. Re:What I want to know is... by jnik · · Score: 1
      And, you know, Windows has been able to do it since Win95.


      Actually I've had problems with that--the system sounds always work, of course (except for those of us who've turned the damned things off), and you almost always get one other source working, but I haven't been able to, for example, run WinAmp and play a game. This might be because one or the other is using DirectX, but I'm pretty sure some of the combinations I've tried haven't used DirectSound.


      So it's not perfect; hopefully ALSA will catch up soon and Linux will be ahead of Windows in this respect. Certainly Windows has a slight edge right now, tho.

    6. Re:What I want to know is... by commrade · · Score: 1

      Ensoniq AudioPCI ens1370 works great for me with multiple sound sources and everything. Under ALSA, it even supports full duplex (recording on line-in and outputting on speaker-out at the same time). Also, the line-in can be switched to another speaker-out, giving you four distinct sound sources, it's not 5.1 but for a card that cost $20 in 1998, that's pretty good. None of this is specific to ALSA 9.x either, I've been using ALSA and this card since ALSA 4.x.

  12. You're on crack.. by Anonymous Coward · · Score: 0

    .. if you think that a SB Live is a "quality" card.

    Quality sound cards don't sell for $39.00, they sell for $390.00.

    Consumer-grade sound cards sell for $39.

    The difference is the accuracy of the DACs and clock, and the amount of noise introduced.

    Of course, you're probably someone who thinks that the home stereo he bought at price-mart for $300 is "quality".

    1. Re:You're on crack.. by Anonymous Coward · · Score: 0

      "quality" sound cards dont sell for $390. and they certainly dont work on PC hardware.

      "quality" sound cards work with MIPS boxen and sell for $390,000.

      high-end consumer-grade sound cards sell for $390.

      The difference is the no of channels, the DACs, DSPs, 3D surround sound processing, optical drivers to other devices etc etc

      Of course, you're probably someone who thinks that home stereo he bought at Hi-Fi-R-Us for $3000 is "quality".

    2. Re:You're on crack.. by Anonymous Coward · · Score: 0

      Hey, an SB Live beats the shit out of my $7 ES1371 here. :P

  13. Check configuration by salimma · · Score: 1
    Assuming that you are indeed loading the ALSA drivers and their OSS compatibility layers (snd-card-xxx, snd-pcm-oss, snd-mixer-oss etc.), make sure that Real and XMMS are both set to use OSS drivers instead of ESD or any other sound server.

    It might be true that your sound chipset does not do multiplexing, I'm afraid this feature is not yet well documented; stumbled upon it by chance myself.

    That's the only thing I could think of - but there are lots of cheap PCI soundcards out there :)

    HTH,

    Michel

    --
    Michel
    Fedora Project Contribut