fuck the skull of alsa

Ok, so having acquired an 1/8"-to-RCA, it turns out that yes, the SB0410 will provide S/PDIF out. However, it has the same problem that the CMI8738 had, which is, I can't play two sounds at once.

This may be related to the fact that the only XMMS setting that will produce audio is the OSS driver; all other options produce "please check your sound card settings."

Even when XMMS is not running, Flash applets still can't make noise.

I can't believe I even have to think about this shit. What year is it again?

Tags: , , , ,

105 Responses:

  1. ralesk says:

    Obviously a decade later than Linux should have abandoned OSS allto-fucking-gether and conceived a much, much more decent idea than what ALSA is.

    • duskwuff says:

      Well, FWIW, OSS is marked as "deprecated" in the kernel config. Too bad ALSA is only slightly better.

      • alioth1 says:

        ALSA is bloody awful. I can't believe it's the mainstream sound implementation - it may have some technical merits, but the documentation is absolutely terrible. How do they expect people to develop any decent sound apps when ALSA is so badly documented?

  2. mark242 says:

    Is it too early in the discussion to recommend a G5?

  3. duskwuff says:

    ALSA + dmix + snd_pcm_oss. Make sure you have the right ALSA module compiled in or otherwise available.

    The lazyweb can as easily find you an appropriate ALSA configuration as it did me, so I won't bother digging one up.

    • duskwuff says:

      That is, assuming that there are ALSA drivers available. If there aren't, my best advice is to run away screaming and be found, years later, in an asylum in Paris.

    • muerte says:

      What's dmix do?

      • duskwuff says:

        A kernel-space mixer. Lets multiple programs write to it and outputs the sum to another device (typically your sound card). Better than esd and artsd, because it's in kernel space and doesn't have to do all the buffering (and have the consequent lag) that those two daemons do.

        • ralesk says:

          That lack of kernel-side mixing is something I've been bitching about regarding ALSA for really, really long. Damn. dmix, gotta remember. I love you for this (in a most platonic way, of course).

    • popefelix says:

      However, you have to (or at least I've had to) aoss your OSS applications to get them to pay attention to dmix. Also, to this day, I can't make XMMS play nice with ALSA & dmix.

      In summary: dmix is nifty, but it's not a panacea.

      • duskwuff says:
        1. Yes, you have to use aoss on programs that expect oss.
        2. Use the ALSA plugin for XMMS; it worked for me.
        3. Don't assume that I have a "fixed" font; use <tt>.
        • popefelix says:

          It would be nice, although I can see where it might be impractical, for OSS apps to automatically be subject to ALSA configuration (e.g. dmix) if they are already running under the OSS emulation layer in ALSA. As for the ALSA plugin in XMMS, it either hangs XMMS or skips, but that's another subject for another time and place.

  4. ewindisch says:

    Is it too late to say, I told you so?

  5. I gave up and went to Mac. I still have a Linux desktop, but I am sick, sick, sick to death of having to tweak every last little friggin' thing.

    • I'd love to hear more about your switch. But not in this blog ;) Have you written anything up about it?

      • No, not particularly. I'm a software guy, not a hardware guy. As a result, I want a computer that my grandma can use (but with a decent command line). Mac OS X just fit the bill.

      • jace says:

        I too switched in 2003, and it's the best damn thing I've ever done. Functional GUI + CLI. Where else do you get both bash and Word as native apps, without running them through environment simulation layers?

  6. octal says:

    You may be able to make it work by using "enlightenment sound daemon" (esd), set with OSS output. This will basically work as a software mixer for various outputs.

    If you can get esd working, xmms fairly reliably works with esd, and so should flash plugins.

  7. korgmeister says:

    "What year is it again?"

    On planet Linux, it is 1994. On planet Linux it is ALWAYS 1994.

    And anyone who disagrees can be SENT BACK TO THE WINDOWS GULAG!

    That way everyone can go back to agreeing about how user friendly and compatible and functional Linux is now and how the only reason Windows users don't migrate is because they're all stupid.

    See, Linux Propaganda Remix - If Operating Systems were Airlines

    • edge_walker says:

      It has gotten much, much better. There are a lot of people whose hardware will be identified and configured out of the box by Fedora or Knoppix or Ubuntu – sometimes even when Windows fails. But woe if you’re not so lucky: that hasn’t gotten any better. (Which is what the article you linked is saying, so yeah.)

      Of course the problem is to a large part due to desktop periphery vendors ignoring Linux – mostly because the kernel folk refuse to make any amends for them. But the kernel folk are right when you look at the figures that say > 85% of fatal crashes on Windows are due to third party device driver bugs, while the Windows kernel itself is very stable at this point. Mac users avoid some of the crapola by way of hard cash.

      Basically noone has figured this out yet. Maybe in 200 years we’ll know enough to make computers that don’t suck.

      • jwz says:

        Maybe you missed the part where I just bought the single most popular audio card in the whole wide world and it still doesn't work properly.

        • edge_walker says:

          I didn’t. I just wasn’t replying to your post, but to <lj user="otterley" />’s reply. As far as ALSA is concerned I lucked out with an onboard sound chipset that does more than one stereo channel at a time. I can run several apps playing sound through ALSA without any configuration work. So I won’t be of any help, I’m afraid.

          I suppose with Linux the answer to every hardware question is “pay through the nose:” buy a Postscript printer so you don’t need to set up any drivers, buy a multichannel soundcard so you don’t need to set up any drivers, …

          (Which is kind of the same answer as switching to Mac, if for other reasons…)

      • otterley says:

        It has not gotten better. The problem is not what everyone thinks it is.

        There are, in fact, drivers available for most of the sound hardware out there. But, the problem has nothing to do with the kernel at all.

        The problem is all in userland. All I/O should be abstracted away from the kernel and low level graphics (i.e. X11) and should be available to applications through a consistent, smartly-designed, highly functional UI programming interface.

        Windows and Macintosh programs have never communicated directly with graphics and sound devices. They call APIs. The code underlying the APIs abstracts away the need for the software to know things such as what model of printer is attached, how many channels your sound card supports, or what kind of acceleration tricks your graphics card plays.

        This is a good thing, because applications should not have to care about these issues. The programmer should be able to say "I want to print this document," or "I want to play this sound," or "I want to display this image," and the UI subsystem should take care of all the dirty work.

        But, as of yet, there is no agreed-upon user interface API for Linux and its brethren. Sure, there are GNOME and KDE, but neither of these constitutes a de facto "standard." If either of them were "the desktop" (and I personally don't have a favorite), Linux on the desktop would have a lot more potential than it does today.

        Linux today is where MS-DOS was in the 1980s. Then, we lived in a world in which every game had its own sound driver, and every word processor shipped with disks and disks full of printer drivers to the point of lunacy. Today, at least in the Linux world, every program that is well-tested and feature-laden writes to /dev/dsp (exclusive open) for sound, can render only plain text or maybe PostScript (if you're lucky), and uses X11 primitives (usually with very limited font support) for UI. That's because these are the only things a programmer can assume to be globally true.

        While it's true that a few coders "do the right thing" and write applications which leverage a UI framework such as GNOME or KDE, only a few do that, because (1) the APIs are (still!) unstable, and (2) maybe 1/3 of the user base uses the particular framework you've chosen. That means, if you want your program to work everywhere, you have to create at least three versions of it: You have to write a GNOME version, a KDE version, and a straight up X11 version. (Throw a Motif version in there for good measure.) That's a metric assload of needless work. For this reason, applications written for these UIs have been relegated to desktop applets like music players (not particularly good ones), basic text editors, instant messengers and clocks. (No, KOffice does not count.)

        It's unfortunate that OpenOffice.org and Mozilla did not settle on one of the two above frameworks (perhaps because of the instability of the APIs). They totally missed their chance to settle this argument; had they done so, the secondary effects would have been positive for the state of Linux applications in general.

        Now, I know you're going to say that GNOME users can run KDE programs without the full desktop, and vice versa, but you still have to configure each framework separately. You have to tell each system what kind of printer you have, how you like your applications to appear (colors, fonts, etc.), etc. It's redundant and ridiculous. Users should not be expected to understand this regime nor undertake this kind of effort.

        Linux and its brethren will forever continue to suck for desktop use until the community gets its collective shit together. I figured that out years ago and so I'd rather give Microsoft or Apple $200 in exchange for saving myself thousands of dollars of opportunity cost in needless headache. Fuck dogma; I'd rather have my life back so I can do real work instead of endlessly administer my computer.

        • edge_walker says:

          Good points.

          OTOH, Jamie is having trouble with ALSA, where opening /dev/dsp has indeed been supplanted by API calls for userspace apps.

          I also remember when ICQ sounds would be blocked because WinAmp was playing music. AFAIK, some API calls in Windows still block everyone else if the soundcard doesn’t have free hardware channels to play more sounds. So despite APIs this isn’t something that Windows always did right.

          You are right that the difference is that there’s a central instance which can legislate “the right way to do this” and that this gets things done.

          I’m not particularly dogmatic either; the only reason I’m still running x86 hardware is that I’m hard up for cash. Apple will be taking my money as soon as I have any to give them.

          • otterley says:

            Try again. ALSA exists in kernelspace, not userspace, and is not well supported because it's only on Linux. Many applications, Flash included, will still open /dev/dsp. Others use the old OSS, which had a userspace API akin to that of ALSA (ALSA's primary advantage is its stacked design).

            At any rate, applications should not directly talk to either. They should be relying on the UI framework API which knows how to talk to the kernelspace API, whether that be direct device access or some other abstraction at the kernel level such as ALSA or OSS.

            • edge_walker says:

              Well, sort of. ALSA does provide such an abstracted API in the form of alsalib. ALSA userspace apps are not at all supposed to talk to the driver directly. The whole thing could conceivably be configured, effective for all ALSA apps, from some sort of userspace app, GUI or otherwise. And at the kernel side it also has an emulation for /dev/dsp that has always worked for me.

              But alsalib doesn’t attempt to provide for automatic software mixing at any level of the overall design. I suppose Linux (in this regard, at least) is where Windows was in ’97: the API abstracts away all the flavours of hardware (you just say “play this sound on channel X” regardless of how that works on a particular soundcard), but it’s not actually decoupled from what happens at the hardware level (you allocate an actual hardware channel, not a virtual channel managed by the API).

              As for general availability/use, all of the software I’ve come across offered ALSA as a compile-time option. (And I’ve seen a ton of it, as per my rant elsewhere in the thread.) It’s not surprising, considering that no OSS drivers exist for a lot of newers chips. You’re right that ALSA is Linux-only, though.

        • Another aspect of this is that the X11 primitives have stayed very primitive, so that they no longer map well onto modern hardware. Apple and Microsoft continued to update to insure that their API's allow programmers to take full advantage of graphics hardware capabilities.

  8. cbj says:

    Is this the joy of free software? I despise having to hunt down and deal with crap like this on my own Linux box. I don't know what you're running, I do know I've sometimes had weird sound issues involving the sound daemon used by gnome, which is used to allow multiple sources to play at the same time I believe. See esound overview.

  9. na_pis says:

    Why did not you check ALSA support matrix at http://www.alsa-project.org?
    BTW SB0410 is supported by snd-ca0106 module -- should have worked.

    PS: It is a long time since I had my last problem with sound, but I am using different HW: Ensonic 5880(snd-ens1371) and nVidea CK804 chip (snd-intel8x0)

    PPS: XMMS? Why?

    • scosol says:

      PPS: XMMS? Why?

      and what is better than xmms for simple audio media playback?
      i'm open to anything...

      • gytterberg says:

        BMP if nothing else. It's a fork of XMMS; uses GTK2.
        Rhymthmbox is good. Nice and simple iTunes-clone without the iTunes-suck. Comes with GNOME, uses GStreamer or Xine.
        AmaroK is very cool, though a little flashy. Wants you to use a MySQL db for its library, though it comes with a small but apparently slower version that doesn't require anything on the users part (at least in Debian). Based on KDE, uses gstreamer, xine or arts engines. A little slow on my old ass machine but the library and searching stuff is just about worth it.

        • jwz says:

          "iTunes clone" != "simple audio media playback".

          BMP is still hatefully theme-happy, and unlike xmms, it doesn't have a "Double Size" option, meaning it's impossible to read the UI at any desktop resolution above 800x600. Probably the least horiffic option is its bluecurve-xmms theme, but that is still way, way too small. I don't know about you, but I can't read five-point light-gray-on-white type.

          BMP also has the problem that when you have an Icecast URL in the playlist window, there's no way to tell what its URL is -- all it will show you is the last title or metadata the stream had, so you know the last song you heard on it, but not what station it is. It also doesn't have an "open" dialog that preserves the list of recently-opened URLs like xmms does.

          Basically it's a clusterfuck UI regression compared even to XMMS, and that's quite an achievement.

          • gytterberg says:

            Heh, fair enough. I don't use BMP enough to notice that stuff. Whatever the stock Debian theme is, it's legible and non-fugly enough for me. But then I used WinAmp for years on Windows, so maybe I'm broken.

            You can shrink Rhythmbox down to just the usual buttons and title information. No themes, everything legible, nice big clear buttons. I stream stuff about once a month, so I don't now how well it handles that.

            If that didn't qualify as simple enough for me, I'd just say fuck it and go with mpg123 or equivalent.

        • korgmeister says:

          Amarok?

          Dude, you ARE kidding, right? You couldn't get much closer to a perfect example of a music player JWZ would aggressively hate.

          Also, you forgot to mention that Amarok crashes a great deal, especially if you're using the Foxytunes extension, or the Arts sound server. Even Gstreamer isn't perfect because it'll occasionally break into between 2 and 30 seconds of stuttering noise.

          And yet, I still use it. *shrug* Those database features are just so damn nifty.

          • gytterberg says:

            Aesthetically, well, it's hard to pin down what JWZ hates sometimes. I mean, have you seen his club? And who knows what somebody who writes glowing reviews of a GWAR stage performance will think of the fugliness of amarok. Wasn't recommending it specifically to him, anyway.

            Functionally, it's big and a little clunky, but I've had it crash maybe twice for me. Firefox goes down way more often. I've never noticed gstreamer go nuts like that, but I usually use xine. (Debian unstable, ens1371 alsa driver) Its UI forces you into a particular method of use a little bit, but most software does.

            And yet, I still use it. *shrug* Those database features are just so damn nifty.

            Yep. I figure, I just want to listen to it, not look at it.

            • korgmeister says:

              I mean, have you seen his club?

              I'd like to, but I'm in the wrong continent =P

              My issue wasn't so much with the aesthetics of Amarok (which I don't really pay much attention to) so much as it's rotten stability. I've figured out by now that JWZ is a pretty big fan of stability.

              Main reason I like it is in XMMS if I wanted to load up a different albumn, or a particular random song in my head, I'd have to search through my directory tree and find it the hard way. That or have everything loaded in my playlist, which is cumbersome and slow. In Amarok, I can easily find and enqueue said song.

              I just wish they'd make it more effing stable.

            • taffer says:

              "Don't just look at it, eat it!"

        • scosol says:

          hmm- i'll have to see if i can get bmp going just for the gtk2 of it-
          rhythmbox and amarok go way beyond "simple media player" to me-
          and i do my music organization where i always have, in the filesystem- so the winamp2-style player is all i've ever wanted- thanks!

        • edge_walker says:

          So far I’ve not seen a single basic player that doesn’t blow chunks, and believe me, I’ve spent a long time looking. It all started when I decided that it’s not 1983 anymore and there’s no reason to suffer jagged, pixely fonts, so I uninstalled gtk+ 1.x and Qt 2.x. I was also tired of using a File Open box to cope with a large collection of music.

          So I started looking for something with a gtk+ 2.x GUI and a music library.

          Originally I tried to find a daemon-based player because I also wanted something that woulnd’t die when the stupid damn nVidia driver crashed X yet again. The only at all usable one I stumbled across was MPD. But I kicked it out when I discovered that it didn’t even allow seeking within a track. I recently took another look, and that has been fixed, but the GUI clients still suck, and even now the daemon still needs to be started manually and still insists on making me pick a port for the daemon to listen on. (This is just one machine, just use a Unix socket or at least run with a default port if the user doesn't care. Which I don’t.)

          So next was Rhythmbox. With a library of any significant size it managed to launched slightly sooner than the next ice age will happen. But it couldn’t couldn’t edit tags, so using the browser to actually, you know, organize my music, was impossible. Last I checked, it STILL can’t edit tags. What the hell!? Anyway, the startup time is unacceptable.

          All the other gtk+ 2.x players with a library-based interface require GStreamer, which I never got to work, despite wasting way too much of my life trying to make it go. (Rhythmbox alternatively does xinelib, which worked instantly.)

          The Qt-based players all need all of KDE. Sorry, no. (I try to keep the GNOME libs out too, but you can’t avoid both desktops if you want to get any work done.)

          So I said fuck this noise and tried several console-based players. The pure command-line ones obviously don’t have any concept of a playlist, which is balls. The curses-based ones all have very programmer-friendly playlist interfaces, ie they’re unusable.

          At this point I was frothing at the mouth with frustration.

          I ended up with BMP, which at least does gtk+ 2.x, but still makes me pick music from a File Open box. I picked a skin that looks mostly like native widgets, and I never use doublesize, so for a while it was vaguely bearable. Then they switched to that unbelievably, monstrously fucking hateful FileChooser interface that the GNOME guys thought was a good idea. And they introduced a bug whereby sometimes a system load spike that isn’t even enough to affect any other media player (not even as much as a stutter) will cause BMP to randomly stop playing. It just stops. As if I’d clicked “Pause” or something. All I can do at that point is click “Stop” (or click “Play” to do so implicitly) – if I try to seek, the player freezes up completely and needs a SIGKILL. Sometimes it will play for half a day without a hitch, sometimes it stops every 3 minutes.

          I am so worn out with this music player shit at this point that I’m about to break down and install gtk+ 1.2 to run XMMS so I can stop self-flaggelating. It’d still be File Open for me, but at least it’s A BASIC PLAYER THAT WORKS. Which is rocket science, obviously. There is not one decent basic fucking music player for Linux. For fuck’s sake, can it really be that hard?! What the hell, people?

      • I tend to use Music Player Daemon myself, but it's mostly because I run the player on one server, which has no X, and I run clients from three other machines, including some perl scripts. No complaints, at all.

        Doesn't solve JWZ's issue though.

      • longwalks1 says:

        actually I am looking for ncurses ones. lmp3 hosed after leaving Mandrake 10. No go on Kubuntu. Just a royal pain in ass at times for sound and mplayer in linux.

  10. otterley says:

    The particular sound card you're using is probably adequate for your needs. The fact is, however, that nearly all personal sound cards (or chipsets, if you're in the Intel ICH world) give you only two channels, enough to give you stereo sound. 5.1 output is merely gravy. Only "professional grade" sound cards do multi-channel hardware mixing, and they generally require a special API supported only by Windows and Macintosh. There are a few that are Linux-compatible, however.

    Simultaneous sound playback is almost always handled in software these days (i.e. by the host operating system, and not in hardware). Windows has had a software mixer since the early 1990s, probably earlier. Macintosh, probably even earlier than that. Anything called a hardware mixer almost invariably refers to the onboard hardware that switches among the various hardware inputs (software playback, CD-ROM, mic in) and outputs (line out, headphones, software record).

    There are at least three software mixers for the "free" *NIX world, though they're not discussed in the HOWTO (which was last updated nearly 4 years ago). They are esd (used primarily by Gnome), ARTS (the KDE mixer) and an ALSA plugin called dmix.

    If you cannot get XMMS or Flash to output audio, consider running xmms or your browser under the aoss(1) wrapper.

    • baconmonkey says:

      Only "professional grade" sound cards do multi-channel hardware mixing, and they generally require a special API supported only by Windows and

      Gravis Ultrasound circa 1992 had 32 channel hardware mixing. it was massively popular among "demo" coders back then for that very reason. Also, my late 1990s SB Live (with SPDIF out) has hardware mixing, as well as environment effects (read hardware reverb).

      • ronbar says:

        Sure, cards like the Ultrasound and the AWE32 had hardware mixing before the data got to the DACs for playing as many samples as you could fit into however much RAM you had on the soundcard as MIDI instruments. But they still had only two DACs for the two stereo channels and so only one regular audio stream could be played at a time.

        Personally I use faRts with a big laggy buffer and XMMS with another big buffer niced to -19 outputting to it. These days I doubt I need the buffers, but old habits die hard.

  11. jmason says:

    The only reasonable answer I've found (after much trying) is to pretend it's 1999, and use esd. Even with the "dmix" ALSA software mixing plugin (which is recommended), some apps are antisocial and only offer support for esd, or OSS and ALSA in exclusive-access lock-everyone-out mode.

    Given that, you can only rely on esd in the end, as the most common supported-by-everything option.

    If you want, you can use "aoss esd -nobeeps -noterminate" to keep esd running at all times, outputting through ALSA.

    This really drives me nuts. Linux sound seems to be a particular case where the CADT model applies.

    • scosol says:

      except remove the "-nobeeps"- cmon- the startup sequence is sweet :)
      it's kinda like it reminds you who's in control hahahahah

    • duskwuff says:

      If an app supports OSS, can't you just use aoss then?

      • jmason says:

        There are apps that insist on exclusive access to /dev/dsp for OSS, *or* will support using a sound server. Using aoss doesn't work, because they're doing some kind of crazy "I want exclusive access" stuff from the OSS support layer in the build of GStreamer they're using. For some reason, it doesn't do the same when going via a sound server.

        In those cases, the only way to get them to coexist with other apps making noise, is to use a sound server... even dmix doesn't work. :(

        (btw, the app in question was the KDE 2.2.x versions of JuK, KDE's (really good) music player app, in case you're curious.)

    • evildagmar says:

      The last time I checked it was trivial to compile esd to simply use ALSA in the first place.

  12. scosol says:

    HAHAHAHAHAH come to the mac side-

    seriously- think about it- what system do you actually *use* on the computer?
    it's not "linux" or "freebsd", it's "X11"-
    if you saw my desktop you would shit-
    and i hate preaching as much as the next guy, but really- for running mostly X apps in an environment that also provides sweet native sound/video/app support, there really is no equal.
    for my base of operations i run mozilla, xmms, gkrellm, vim, aterm, rox-filer-
    my only mac apps open are stickies, adium, quicksilver, and entourage
    (and this is only because the mac does it better here, i'm very much a "use the best tool" kind of guy)
    then when my corporate punishment demands it?
    i can run WINDOWS MEDIA PLAYER
    and MICROSOFT EXCEL
    and MICROSOFT POWERPOINT
    and everything functions perfectly-
    ...
    i'll wager you a game of rez, if you go mac you will NOT go back...

    • thomtoffner says:

      >if you saw my desktop you would shit-

      So let's see it, I forgot to take my Metamucil today.

      • scosol says:

        hope your depends fit tight- xemacs!

        http://anon.scosol.speedera.net/anon.scosol/desktop/FreeSnap010.png

        so, maybe you can see what i'm talking about now-
        the mac's dock is down in the lower-right, and used basically only to run entourage and skype-
        to switch to those (they are minimized in teh dock) i have to go over and click on them-
        but as for the rest- i do most of my work like i always have, with fluxbox and multiple desktops-
        X is running rootless, OSX handles the background and desktop icons-
        xmms and gkrellm are up in teh corner- the yellow things are "stickies" (cool mac app) and the chat client is adium (used only because gaim fucking sucks)

        So- it's just like i said- at the end of the day i can work in the same manner i always have (in an X11 environment) but now I don't have to worry about stupid hardware wanking shit, or about my use of an "unsupported platform"- because sometimes i do need to run things like powerpoint, and windows media player and shit- and these days mac support is just about as good as windows support (on the commercial app side)

        • thomtoffner says:

          Hm, that looks just like the non-shit-inducing OSX desktop I've got on my powerbook. Funny though, my wireless card can't do encrypted networking because -- it isn't supported. I am currently using an ancient open source driver for it, because there isn't a supported OSX driver.

          Nice.

          Also, the dvd decoder that is built in to my Apple powerbook is not supported by OSX, making my dvd drive pretty useless. It sure is nice not to have to worry about "hardware wanking shit." Thanks a fucking lot Apple.

          • thomtoffner says:

            and by "just like" I mean, "alot like, but with less shit scattered everywhere, and in a much more usable state."

            Perhaps you meant "all the shit all over my desktop will make you shit"?

  13. scosol says:

    err- stopping the preaching :P
    it sounds like you need a sweet soft-soundserver-
    try esd, but my personal pref is jack-
    that's the easy way to make that particular problem go away

    • scosol says:

      also- esd makes the coolest startup-sequence-sound ever-
      reason enough for me to use it :)

    • weev says:

      In this thread not only did you post a fuckjillion times but your retard chatter remained invariably clueless and annoying. Your lack of respect for the standards of capitalization, punctuation, and grammar also infuriated me. Get bent.

      • pinkpaluka says:

        Oooh, kinky! You come on strong and hot there, Geoff!

      • scosol says:

        Thank you good sir, for pointing out my erroneous posting style. Certainly I was not aware that informal written communication was constrained to the same style and format limitations as more formal or professional written communications. I also was not aware that my posting frequency as well as my information quotient per individual post was out of the bounds of correct and conforming behavior, making it most disagreeable to you.

        now that i have "seen the light", why don't you get back to work on your magic hat?
        you know- that one that stops you from ever seeing anything you don't want to see-
        like non-grammar, multiple flippant posts, and vaginas
        then you can put your hat on, and go fuck yourself.

  14. mjg59 says:

    You either want to go here
    and find a card which has a (3) next to it indicating hardware mixing support, or you need to go through pain and misery and try to get dmix to work on alsa and then reconfigure all your applications to use alsa for sound output. I recommend the first.

    This is one of those things that genuinely ought to be better in 6 months (alsa people have been working on it heavily), but the fact that it doesn't is still plainly insane.

    • evildagmar says:

      Yep. Note that the SBLive! one can usually obtain for under $20 is in that list of cards that support hardware mixing. For the longest time I had no idea what people were even complaining about, since I generally stick one of these cheap little monsters in most of the machines I build even if they have onboard sound. I never had a problem playing two sounds at once. ;)

  15. kfringe says:

    You need to use esd or the whole thing will go rotten on you. I had thought you were running two copies of esd, but you disabused me of that notion. What is happening is that you are running xmms before esd starts. That gives you the same ugliness (ie: esd never gets a hold of your audio device).

    Even if you have a hardware mixer, your software isn't going to do the right thing by default. I'm sitting in front of a Windows machine now, so this is going to be inaccurate, but you want to look under /dev for different audio devices (/dev/dspFOO.FOO /dev/dspFOO.BAR). Those are the mixer channels. If you won't use esd with xmms, you need to tell xmms to use one of the later devices.

    I have no idea if the default linux builds of firefox are esd friendly. My experience has been that they are if esd was present on the machine at compile time. The odds are good that the flash plugin is just going to try to grab /dev/audio either way.

    My solution for the past four years has been to kick esd awake in my xinit and bind it to one of the mixed channels (esd -d /dev/audio0.1 -noterminate -nobeeps -unix). This lets idiot software that doesn't know any better work.

    Doing that should also let you pick the esd output option for xmms. I would guess that xmms isn't bright enough to start esd on its own.

    It's all very easy and makes perfect sense, don't you think? And the Kool Aid is delicious.

  16. fantasygoat says:

    You're a pretty smart guy, and you enjoy making fun of myopic nerds and their obsessive behavior, which makes me wonder why you haven't abandoned Linux despite many years of pain and suffering at its inadequacies. Before OSX I could understand, but now?

    But then, I run a mail program from 1997 so I'm not one to talk.

  17. owen says:

    1. I can only assume that everyone who commented and said "the solution is ALSA" doesn't read jwz's blog often enough, and also missed this post's title, "fuck the skull of alsa."
    2. I remember having this exact problem probably 2+ years ago, also hating ALSA more than anything in the Linux world, and resolving it by using esd. It was somewhat painful but I did get it working. I'm surprised it hasn't been resolved more gracefully now. Wait, no I'm not.
    3. Although I'm not actually going to SUGGEST that Jamie switch to a Mac, because I'm just assuming that a) he's heard that 200 times before and b) he has lots of perfectly good reasons why he doesn't want to do that... but that's what I ultimately did also.

    I've concluded that, in light of OS X, Linux as a desktop OS is dead.

  18. adolf says:

    I just fired up some music in XMMS, while watching/hearing a mplayer do its thing, on my identical Soundblaster.

    It seems to work fine with both random mixtures of ALSA, and OSS usage by XMMS and mplayer.

    I don't appear to have dmix installed -- unless it is wrapped up into ALSA in some fashion that slocate doesn't detect, it's not here.

    I certainly don't have anything complicated set up with ALSA, XMMS, or mplayer.

    Of course, it -is- a Gentoo machine, so it would be rather unsurprising if ALSA simply behaves differently on it than with anything else.

    (FWIW: XMMS 1.2.10 and ALSA 1.0.8 as shipped with Gentoo's idea of what kernel 2.6.11 should be.)

    • adolf says:

      Except, I forgot to mention (or, rather, I forgot to read): It's not identical, at all.

      The SB0410 is a whole different beast from the SB0100 that I know and love, having little in common with it except for the "Live!" moniker on the box and a PCI interface on the card.

      My extraordinarily positive experience is, thus, useless in this matter.

      I advise you to accost the person who did you the favor of "upgrading" your order, armed with the offending item and any packing material it may have arrived with. The rest will come naturally.

  19. ncmncm says:

    I have none of the problems others on this list complain of. The only problem I've had with sound in years has been buggy programs that keep the sound device open so I can't unload the (ALSA) sound module; even that was only a problem when I was experimenting with something unrelated. (Of course buggy programs are just as common on OSX.)

    Maybe you're using the wrong distribution. I'm using Debian. You might prefer Ubuntu. If you do go to G4/G5, you can run Debian GNU/Linux underneath the Macosix UI -- emulating Darwin syscalls -- and get much better performance. Presumably that will be even easier with Macosix/x86, and won't restrict you to expensive Apple hardware.

    It makes no sense to complain about "Linux" archaisms if you're running an archaic distribution. Those are for people who like that sort of thing. Run something modern and get modern behavior.

  20. fafhrdthedev says:

    Okay, I have a crappy onboard intel sound chipset on my laptop, and ALSA offers my sound mixing with *both output and input*.

    You will have to configure things, sure 'cause I haven't seen a distro yet that does this nicely.

    Also, the only real problem with ALSA, imho, is that documentation is scarce. There was a publicized flamefest on the ALSA mailing lists about 2 years ago now, and since then, the ALSA project members realy have stepped up to create at least a good start for ALSA documention.

    Okay, onto the good stuff. Here's my /etc/asound.conf
    -|snip|-


    #asym fun start here. we define one pcm device called "dmixed"
    pcm.dmixed {
    ipc_key 1025
    type dmix
    slave.pcm "hw:0,0"
    }

    #one called "dsnooped" for capturing
    pcm.dsnooped {
    ipc_key 1027
    type dsnoop
    slave.pcm "hw:0,0"
    }

    #and this is the real magic
    pcm.asymed {
    type asym
    playback.pcm "dmixed"
    capture.pcm "dsnooped"
    }

    #a quick plug plugin for above device to do the converting magic
    pcm.pasymed {
    type plug
    slave {
    pcm "asymed"
    rate 48000
    }
    }

    #a ctl device to keep xmms happy
    ctl.pasymed {
    type hw
    card 0
    }

    #for aoss:
    pcm.dsp0 {
    type plug
    slave.pcm "asymed"
    }

    ctl.mixer0 {
    type hw
    card 0
    }

    #done

    -|snip|-

    Please, use this as a basis for your configuration. It looks kind of voodoo-y, but really, it's just defining ALSA "internal plugins", of which, dmix (or better 'asym') are what you want. After setting up asound.conf, you really only need to massage apps that only use OSS (i.e. using 'aoss' and such [which makes my life much happier wrt firefox and the flash plugin]).

  21. 4front says:

    Hey JWZ,

    We've been looking for words about ALSA and you couldn't have said it more succinctly! Thanks!.

    Since you're moving to MacOSX, check out our OSS/3D plugin for iTunes/Mac OSX (it the featured download!):
    http://www.apple.com/downloads/macosx/ipod_itunes/

    More info on OSS/3D is at http://www.oss3d.com

    For those of you who've been disenchanted by ALSA, get OSS for free at: http://www.opensound.com/download.cgi
    We promise that your music will never sound flat after using OSS!

    best regards

    Dev Mazumdar
    4Front Technologies
    (www.opensound.com)

    • fafhrdthedev says:

      I should state some things before I reply:
      - I prefer ALSA over OSS, atm
      - I've used commercial OSS (from you!) successfully for projects in the past, and it suited my needs perfectly

      Okay, having said that, maybe I should ask how you have your OSS set up that multiple apps can output audio at the same time? The virtual mixer in OSS commerical, last I checked, only supported up to 8 apps (which seems like a arbitrary number). User space sound mixer daemons have proved way to ineffectual to be of any use.

      For e.g., let's say your checking out the newest Strong Bad email over at homestarrunner.com, and someone IMs you ... do you hear any sounds from your IM client (assuming you configured it to make sounds)? I've *only* had this work with ALSA.

      People want "what works" and "what's easiest" -- in no particular order, but for me "what works" is more important ... so unless I"ve missed something, how can OSS allows multiple applications to output audio at the same time w/o a user space sound server? ALSA can, and it's easy -- there's admittedly very little documentation, which IMHO, is the only real problem with ALSA.

      • 4front says:

        Just read http://www.opensound.com/virtmix.html

        You can configure up to 48 voices (or 48 separarte apps running at the same time). You can also have ESD and ARTSd and Jack all running at the same time

        OSS's Virtual Mixer has a superior (pro standard mixing engine).

        Our Virtual Mixer was announced in 1998! (it's in-kernel like MacOSX)
        http://www.opensound.com/press/1998/ossv39.txt

        best regards
        Dev Mazumdar

        • fafhrdthedev says:

          Just read http://www.opensound.com/virtmix.html
          /me follows link:

          "4Front's Virtual Mixer technology removes this restriction and provides up to 8 virtual sound devices so that you can run up to 8 simultaneous audio applications."

          So, the above would seem to contradict: "You can configure up to 48 voices (or 48 separarte apps running at the same time)."

          Note that I'm not anti-OSS, just more leaning towards pro-ALSA, but it seems like both OSS and ALSA have way out of date documentation if your virt. mixer supports 48 channels, and only 8 is documented.

          Other things about commercial OSS:
          - for a home/desktop PC the fact that it costs money is annyoing
          - no PowerPC support (although it's listed in one or two spots on the 4front-tech pages) (not to mention any other Linux arch support, alpha, etc.)
          - according to the docs, the virtual mixer creates /dev/dsp{n} devices, which is (and now I'm pretty adament) COMPLETELY RIDICULOUS. Are you telling me I need to manually set up every single app to write to a different device? Can you not see how that's really frustrating, and just bad design overall?

          I suppose, in the end, sound support is one area where I feel that the UNIX-ism of "everything is a file" just doesn't play out well. I think the user space library _accessing_ the audio device like ALSA does is really the only "correct" way of creating an advanced audio system.

          • 4front says:

            So, the above would seem to contradict: "You can configure up to 48 voices (or 48 separarte apps running at the same time)."
            If you read the new features section:

            - Upto 32 Virtual Mixer device can now configured via soundconf->Configuration options->softoss_devices
            OK sorry it's not 48 but 32 voices. I think somewhere we reduced it from 48 to 32 because of the number of /dev/dsp entries. By default only 8 devices are configured.

            - for a home/desktop PC the fact that it costs money is annyoing
            Yeah - it's too damn annoying that hardware costs money. It's damn annoying that Internet access, webserver hosting costs money. Too bad you don't share your paycheck with me. :)

            - no PowerPC support (although it's listed in one or two spots on the 4front-tech pages) (not to mention any other Linux arch support, alpha, etc.)
            It's because we don't have a business case for supporting a handful of customers on PowerPC. It's like the same reason we don't support 68000 or the MIP or a bunch of other processors. Free versions of OSS are and can be designed. Same reason why Adobe doesn't have LinuxPPC version of Acrobat but if you want you can use the open source gpdf/kpdf viewers on LinuxPPC.

            - according to the docs, the virtual mixer creates /dev/dsp{n} devices, which is (and now I'm pretty adament) COMPLETELY RIDICULOUS. Are you telling me I need to manually set up every single app to write to a different device? Can you not see how that's really frustrating, and just bad design overall?
            No!. OSS creates all the devies for you and in Linux and Solaris it automatically allocates the devices - you just write your app to open /dev/dsp (or pass in a device name on the command/configuration panel). Virtual mixer /dev/dsp is exactly the same as the phyisical. You've never bothered to ask us for explanations have you?. You just assume stupid things because you want very much to reinforce your beliefs that ALSA is superior and OSS is old. The reason why you have multiple /dev/dsps is because of legacy backward compatibilty - which ofcourse ALSA guys know nothing of - heck you break backwards compatibility going from 1.0.0 to 1.0.1

            I suppose, in the end, sound support is one area where I feel that the UNIX-ism of "everything is a file" just doesn't play out well.
            Well in that case you should be using Windows or MacOSX :) We stay true to UNIX roots - people who want to develop libraries are free to do so.

            ALSA does is really the only "correct" way
            THis is just such a stupid statement - if it were true, JWZ wouldn't have written this rant. If ALSA is more advanced, we couldn't have done an ALSA compatibility in OSS (see our SALSA library or the Cuckoo emulations). So again, stop drinking the ALSA coolaid and compare the ALSA code with OSS/Free code. Something that's totally radical in design os BeOS or CoreAudio or DirectSound.

            Bottom line is that it's all about money. Let's put it this way: if ALSA and OSS cost the same amount of money what would you buy?

            You cannot compete with free. I cannot convince someone who's willing to spend 3 weeks of their time on ALSA to pay me even $5.00 for my software. Do you know why some people line up at 3 in the morning for one of the Fry's free-after-rebate sale?

            As JWZ said: Linux is only free if your time has no value.

            best regards
            Dev Mazumdar
            4Front Technologies

            • fafhrdthedev says:

              - for a home/desktop PC the fact that it costs money is annyoing

              Yeah - it's too damn annoying that hardware costs money. It's damn annoying that Internet access, webserver hosting costs money. Too bad you don't share your paycheck with me. :)
              Yes ... I should have been more clear here. What I had wanted to drive towards is that ALSA needs to be compared to OSS-the-free-version, and that comparing it to OSS-the-commercial-version is somewhat apples::oranges, as, I'm going to guess, 4front likely gets some specs that ALSA cannot (maybe) and supports itself somewhat better with sales (definitely/hopefully).

              No!. OSS creates all the devies for you and in Linux and Solaris it automatically allocates the devices - you just write your app to open /dev/dsp (or pass in a device name on the command/configuration panel). Virtual mixer /dev/dsp is exactly the same as the phyisical.
              Okay.

              You've never bothered to ask us for explanations have you?. You just assume stupid things ...
              Actually, as I stated before, I've used OSS/Commercial before for certain projects, and it worked great. I also implied that 4front tech support was great ... until now -- 'cause jeez -- you're atm, right now, calling one of your supportive customers stupid ... not sure why you are doing that.

              ... because you want very much to reinforce your beliefs that ALSA is superior and OSS is old.
              This statement is a non-sequitor. Parts of ALSA are vastly superior to OSS (free or commercial), as I mentioned with my comparison to it's similarities to advanced Windows and OS X audio APIs ... and OSS is old, with respect to ALSA, which is new, and that doesn't mean either is bad.

              The reason why you have multiple /dev/dsps is because of legacy backward compatibilty - which ofcourse ALSA guys know nothing of - heck you break backwards compatibility going from 1.0.0 to 1.0.1
              _I_ have done nothing of the sort; I'm sorry that I'm inferring some sort of ad hominem attack here, it could just be your writing style.

              - I suppose, in the end, sound support is one area where I feel that the UNIX-ism of "everything is a file" just doesn't play out well.

              Well in that case you should be using Windows or MacOSX :) We stay true to UNIX roots - people who want to develop libraries are free to do so.

              No -- I'm sorry, but this is so completely short sighted. Just because block devices and standard input and output are really well suited for the "everything is a file", doesn't mean that everything is. (However, maybe if Plan9 actually took off, they would've made it work somehow -- they fixed a lot of the UNIX issues, imho.) Unless there are hordes of people doing cat sound.au > /dev/audio and I've missed hearing about it, I'm going to stick to my opinion on this one, unless evidence to the contrary changes my view.

              ALSA does is really the only "correct" way
              THis is just such a stupid statement - if it were true, JWZ wouldn't have written this rant. If ALSA is more advanced, we couldn't have done an ALSA compatibility in OSS (see our SALSA library or the Cuckoo emulations). So again, stop drinking the ALSA coolaid and compare the ALSA code with OSS/Free code. Something that's totally radical in design os BeOS or CoreAudio or DirectSound.

              First, yes, that statement is stupid -- thanks for making it that way. What I said was "I think the user space library _accessing_ the audio device like ALSA does is really the only "correct" way of creating an advanced audio system." It is (pretty much) the way CoreAudio (the core CoreAudio, not getting into Apple's impressive Developer Tools) works. I understand that it seems I am just being apologetic for ALSA, but come on -- can't version 1.0 be "hey, it works!" and 2.0 be "hey, it's advanced now!"?

              Either way, I'm supporting both ALSA and OSS in my apps. I just firmly believe that the direction ALSA is taking is more in line with what is considered "advanced" in today's world, than that of OSS, which I feel is not in line with being "advanced" -- to which you should not infer that I'm saying OSS can't do advanced things, because I'm sure it can.

              • 4front says:

                I also implied that 4front tech support was great ... until now -- 'cause jeez -- you're atm, right now, calling one of your supportive customers stupid ... not sure why you are doing that.

                This response was not written in a professional manner and I'm sorry and apolgize for it. We want you to keep supporting the OSS API in your apps and so please don't take my earlier response the wrong way.

                If you talk to developers of Jack and OpenAL, they recommend people use their APIs instead of ALSA. We all know that Jack and OpenAL sit perfectly above OSS.

                If you think ALSA is the future, by all means go for it. Thanks for giving us the opportunity to bring you XMMS and OSS.

                best regards
                Dev Mazumdar

    • matty says:

      Perhaps you guys should make your isntallation routine a little nicer, talk about 1994.

      OSS is not superior to alsa in anyway I can see, and remember ALSA was created because OSS SUCK(S)(ED)?. Looking at your latest release notes there isnt much that is "new" that isn't supported by alsa.

      Either way, users shouldnt have to configure/compile anything to get what JWZ is looking for. Its simply a matter of a misconfigured system which should have been configured so when the user installed the OS and has Little or Nothing to do with ALSA or OSS.

  22. matty says:

    You need a sound daemon, Ie artsd under kde or Jackd. I'd suggest using artsd as the xmms-arts ouput plugin is pretty simple. Using konqueror it'll just play flash movies into artsd, if your using slowzilla or that stupid fox thing, you'll have to launch it with 'artsdsp {application name}'

    What year is it ?... Umm the year of Free operating systems dont do everything for you, hence why they make better versions.

    http://www.xandros.com/products/home/desktopoc/dsk_oc_download.html

    {Yes, i work for xandros.}

  23. crimsun says:

    In defense of James Courtier-Dutton , who is coding the snd_ca0106 ALSA driver that your card uses, Creative has been less than forthcoming with docs, and he has had to reverse-engineer all the support that is present. He hangs out in #alsa as jcdutton on irc.freenode.net.

    You can use ALSA's dmix support to play two sounds at once. By the way, don't buy into the hype that your card supports multiple simultaneous sounds in hardware, because it doesn't. Ask James, he wrote the darned driver.

    As for your XMMS issue, try specifying "plug:dmix" in the ALSA device drop-down menu (you'll have to type it in manually) of the ALSA output plugin preferences. You'll need to disable mmap support via the checkbox if you use a version of ALSA (alsa-driver and alsa-lib) older than 1.0.9.

  24. Gotta say I find this odd. I'm using an SB Audigy Platinum and all my output features and the Audigy Drive work fine under Linux (using KUbuntu build 5.04 Hoary Hedgehog).

    • crimsun says:

      Your Audigy Platinum uses the snd_emu10k1 driver, not the snd_ca0106 one. The former does not drive the crippled hardware that the latter does.

      • Ah, good point. I was under the impression that he was running an SB Live!, which I thought used the emu10k1 driver as well.

        • jwz says:

          Apparently the fact that the package says "SB Live!" has little relation to what chipset is inside.

          • That... is really freaking stupid. This is one of the many reasons I loath creative. I had a nice Hercules sound card that worked very well, but got sick of taking the requisite exterior box with me everywhere.

            It's a shame Creative is "top of the line" really, because we could do so much better.

  25. sxpert says:

    easy.
    got myself an M-Audio Delta 1010. this thing does all I tell it to do :D

  26. morsknorsk says:

    It's almost a year later and I'm still dealing with ALSA shit.

    • legooolas says:

      I'm never letting go of my SB Live. I'm sure it's not the best card, but it "just works", and it's going to stay in my machines until PCI disappears or the card goes pop :)

      • legooolas says:

        I guess I mean my emu10k1 card... seems SB Live is another one of those names that gets slapped on whatever chipset they are using at the time (argh D-Link DWL-650!).

        • morsknorsk says:

          Heh, ja, SB is slapped on everything, even Ensoniq cards. Speaking of which I tried a different card (disabling onboard sound) and still had the same problems. So I think it's a kernel option I've set wrong. Which one is another task to figure out. Not that there would be an easy checklist if something goes wrong with sound... no that might constitute concise documentation!