Slashdot Mirror


Multiple Soundcards Under Linux?

Magnus Huckvale asks: "We'd like to kit our new flat out with a MP3/Linux stereo system, with a set of stereo speakers in each room. Does anyone have any experience with fitting more than one soundcard to a Linux box? Is it possible to synchronise MP3 players outputting to different cards? What other capabilities can we build in given the hardware? What (cheap) soundcard would do? PCI or ISA?" While this is an interesting question, I think it would be easier to wire both sets of speakers to one soundcard rather than fiddling with two (and the headache involved in getting both to work properly). What do you all think?

11 comments

  1. The reason for using more than one card was... by Anonymous Coward · · Score: 0

    (I am the original poster, I haven't got round to an account yet)

    The reason we want more than one card is so we have the option of playing different music in each room, from a central server...

    (Thanks to everyone for their thoughts!)

    1. Re:The reason for using more than one card was... by Digital+G · · Score: 1

      you could do this still... i'de go with the setup about 2 posts above, and use a program like shoutcast to stream mp3's to different mp3play instances...

      --

      End Transmission....
  2. Re:more than two /dev/dsp's (impossible?) by Da+w00t · · Score: 1

    Um, me thinks /dev entries are just not there --- A friend of mine did this with his gus, playing two mp3's at the same time, on the different devices - /dev/dsp0 (/dev/dsp) and /dev/dsp1. (this was under 2.0.3x) Just run MAKEDEV audio in /dev (I think it's audio, check the script) and it'll make your dev entries.

    (I would figure out what the script command line is, but....well, I'm stuck behind a badly braindammaged windowing system, e.g. Microsoft Windows.)

    --

    da w00t. mtfnpy?
  3. Re:Two ways. by drix · · Score: 1
    The source is out there? Why hack the source, possibly introducing memory leaks, cruddy performance, and worse, security holes, when you can do the same thing using tried, true, and secure shell commands:

    whore# mpg123 -s crack.mp3 | tee /dev/audio0 > /dev/audio2

    --

    I think there is a world market for maybe five personal web logs.
  4. Re:Multiple soundcard solutions by drix · · Score: 1

    Again, there's no point. Write a set of shell scripts for different room control if you must, but otherwise just tee the output to multiple audio devices.

    whore# mpg123 -s crack.mp3 | tee /dev/audio0 > /dev/audio2

    --

    I think there is a world market for maybe five personal web logs.
  5. multiple sound cards by dutky · · Score: 1

    This shouldn't be too hard, so long as you can set the cards to use different IRQs and I/O ports. It might be easier to have each sound card using a different chipset (and hence different drivers) but, otherwise, it shouldn't be much different from having multiple network interface cards.

    The main reason I see to have multiple sound cards (with each sound card driving speakers in a different room) is to be able to play different MP3s in different rooms. This use, however, doesn't require the sound output streams to be synchronized in any way. If you just want to have multiple speakers playing the same stuff, a single sound card with a splitter/amplifier and multiple speakers should do the trick.

  6. it's possible. here's some tips and command lines. by coma · · Score: 1

    It's quite possible to set up linux with multiple sound cards. They manifest themselves as additional /dev/[mixer,audio,dsp] devices.

    The application I set up was using multiple Real encoders taking input from two soundcards and outputting it to 6 Real streams (2 sources @ 3 bandwidths each)

    Some software is hardcoded to use /dev/mixer when setting up the line/mic levels, if not /dev/audio, too.

    The solution? A sickening hack...but it worked :) You fire up one version of the player, and once it's happy, you change the device (via symlinks) that /dev/[mixer,audio,dsp] point to.

    For example:
    ln -s /dev/dsp0 /dev/dsp
    ln -s /dev/audio0 /dev/audio
    ln -s /dev/mixer0 /dev/mixer
    mp3play mp3file_for_soundcard1.mp3

    ln -s /dev/dsp1 /dev/dsp
    ln -s /dev/audio1 /dev/audio
    ln -s /dev/mixer1 /dev/mixer

    mp3play mp3file_for_soundcard2.mp3

    Yeah, yeah..I know it's horrible, but if you haven't got the source for the application, and it doesn't allow you to specify different devices on the command line, this should work.

    And as ppl have correctly pointed out, make sure you don't have any resource conflicts:
    cat /proc/interrupts
    cat /proc/ioports

    Check that all soundcards have been detected using:
    cat /dev/sndstat

    You should see entries for each of the soundcards.

    Hope this helps.

    Coma

  7. more than two /dev/dsp's (impossible?) by xcene · · Score: 1

    I've got a Soundblaster AWE 64 and a Gravis Ultrasound MAX in my linux box. /dev/sndstat tells me I have three digital audio dsp's (I'd guess that's 1 on the SB, 1 using Classic GUS playback and 1 using the GUSMAX Codec). Problem is, it seems that Linux 2.x does not support more than two dsp's (/dev/dsp0 and /dev/dsp1).


    Do I have to switch to Commercial OSS or ALSA or something else?

    --
    -- close but no sig
    1. Re:more than two /dev/dsp's (impossible?) by xcene · · Score: 1

      No, i don't think so. Makedev chokes on it, and according to some docs in the kernel source tree, it seems there are only two MAJOR/MINOR nodes reserved for DSPs. Sucks, doesn't it? :)

      --
      -- close but no sig
  8. Two ways. by jfunk · · Score: 2

    If you really want to use multiple soundcards you could get the mp3 player to simultaneously send output to two audio devices, say, audio0 and audio2. The source is out there.

    However, I recommend using an external audio switch (if you want more than one to be on simultaneously, I'd recommend an active one). If you build it yourself (easy) you can use, say, a parallel port to switch which ones will be on or off.

    If you want to try either of these, I can help you. Email me and I'll elaborate.

  9. Multiple soundcard solutions by Alex+Knight · · Score: 1

    You really have a couple solutions. First, you can modify your mp3 player to output its stream to multiple devices, and if that doesn't work, you could really write a simple wrapple program that would take the audio output from your mp3 player, and simultaneously write to several devices (I like that idea, because then you could do some fun stuff with it, like turn on and off a room's speakers, have two different things playing with two mp3 players, etc).

    Just make sure your irq's and io ports are not conflicting with each other (dma also), or anything else in the system for that matter.

    It's pretty flexible.