Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Linux Software

Multiple Soundcards Under Linux? 11

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?
This discussion has been archived. No new comments can be posted.

Multiple Soundcards Under Linux?

Comments Filter:
  • 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.)

  • 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

  • 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
  • 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...
  • 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.
  • 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
  • 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?
  • 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? :)
  • 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.
  • 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.

The solution of this problem is trivial and is left as an exercise for the reader.

Working...