Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 437
  • Last Modified:

2 soundcard in linux

I want to install 2 identical soundcards (AWE64) in one machine, and it can be driven independently. That is they play different sound source. Thanks  
0
hehehaaaa
Asked:
hehehaaaa
  • 4
  • 4
1 Solution
 
smile040800Commented:
hi,
probably you will better of installing only one sound card on one machine- however to install two sound cards I guess you will have to use modules to get them running.( better of running them thru modules than compiling into the kernel). Although I am not sure if this can be done you can try to set the sound cards on different irqs and probe them.
0
 
X2Commented:
=)  No problem!

Linux does support multiple sound cards.
First off, you need may need to
recompile the kernel.  The reason for
this is that AWE requires special
support in the kernel if you want
wavetable.

Ok, first, let's assume your
distribution comes with the AWE drivers.
I RedHat comes with AWE modules
prebuilt.

As root (you need the permissions):

cp /etc/isapnp.conf /etc/isapnp.bak
pnpdump > /etc/isapnp.conf

This will detect PnP devices on your
system.  The AWE64 is a PnP device.

After executing the command above,
you'll find that all the PnP devices
on your system are listed in the
isapnp.conf.  Edit that file using your
favorite text editor.  The isapnp.conf
gives you a set of resources for each
PnP device with which to choose from.
It will most likely give you the same
resource options for both AWE's.  Be
sure to choose different sets of
resources!!!  You select resources
by uncommenting them.  isapnp.conf is
filled with comments on what the device
is and so forth, so it shouldn't be too
difficult for you.

Note!  pnpdump doesn't detect all the
resources needed for AWE Wavetable!
It will only assign one IO Port to the
Wavetable!  Add these additional ones.

(IO 1 (BASE 0x0A20))
(IO 2 (BASE 0x0E20))

I'm not so sure how the IO Ports will
work with two soundcards... you can
email me if you run into trouble on this
one.


Ok, now reboot.  RedHat should run
isapnp on startup and assign the
resources you just specified in
isapnp.conf.

If it didn't:

isapnp /etc/isapnp.conf

will do the trick.


The appropriate drivers should also
have been loaded at startup.  If not:

modprobe sb
modprobe awe_wave
and whatever else, I can't remember...


Now, resources have been assigned and
drivers are loaded, you're all set to
go.  How does Linux support multiple
sound cards?

In /dev/ there are files representing
the various devices on your system.

/dev/dsp0 - first wave output
/dev/dsp1 - second wave output
/dev/mixer0 - first mixer
/dev/mixer1 - second mixer
/dev/sequencer0 - first midi out
/dev/sequencer1 - second midi out
etc...

Now most audio apps you have will allow
you to specify a sound device, all you
have to do is tell it which on in /dev.
It varies from application to
application so I can't help you there.


Ok, now let's think practical.  Why
would you want two soundcards?  If
you want different sounds coming from
different speakers, I can understand
this setup.  If you're a music
professional I can also understand your
setup.  But if you want multiple sound
cards to play multiple sound files, this
isn't necessary!  Yes!  You can play
multiple audio streams on a single
soundcard.  It depends on the
application generally.  Or, if you're
running the esound daemon, it supports
merging of streams and playing them
as if they were one.  esound is beyond
the scope of this answer, but if you
want to go that route, I can do what
I can.


Ok, more info.  If what I have said
isn't enough, look in the kernel docs!
If you have the kernel installed,
/usr/src/linux[-whatever].

look in:

/usr/src/linux[-whatever]/Documentation/sound/AWE32


That document has plenty of good
information. Much of which I've already
covered.
0
 
hehehaaaaAuthor Commented:
Thanks for your advice, i can assign two set of resource. But there's an error when i run " modprobe sound"---"Sb16 Bad or missing 16 bit DMA channel". Also, I use XMMS to play audio file, the speed is very low. I don't know how's it happen. Thanks for help
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
X2Commented:
The problem might be related, but I'm
not sure.

Let's try to fix the 16bit DMA problem
first and it might fix the XMMS problem.

The 16bit DMA problem sounds easy
enough.  Look in your isapnp.conf and
make sure that you assigned two DMA
channels for each soundcard.  Generally
for a system with one soundcard, the
soundcard would get DMA 0 and 1.  The
other soundcard would have a different
set of DMA channels, maybe something
like 3 and 5.  Try checking that and
let me know how it goes.
0
 
hehehaaaaAuthor Commented:
I have assign DMA 1 and 5 for sound card 1, and DMA 3 and 7 for card 2.
0
 
X2Commented:
I think you need to pass resource
information to the module when you
load it.

in /etc/conf.modules or /etc/modules.conf

add:

options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330


That will work for the first sound card.
I'm not certain about the 2nd sound card, but perhaps you can add another line for the other sound card.

For example:
options sb io=[address] irq=5 dma=3 dma16=7 mpu_io=[address]
0
 
hehehaaaaAuthor Commented:
Thanks for your help.
I can make the card working with editing the /etc/conf.modules.
However it only work with 1 card. If I add another line for card 2, it will only detect the second card only!!!!!
0
 
X2Commented:
Hmm... I have an idea, but I'm not sure
if it will work, so you can give it
a try.

The problem is that you're loading 1
module and trying to give it 2 sets of
parameters.  Try this:

Go into /lib/modules/[version]/misc

in there, you should find a file called
sb.o which is the sound blaster driver
module.  Do this:

cp sb.o sb2.o

Now edit your /etc/conf.modules
and add a line for your 2nd soundcard,
but rather than sb, use sb2.

I'm not sure if this method could fool
the system into treating sb2.o as a
2nd driver or if it will now that sb2
is just a copy of sb.o, but it's worth
a try.  If it doesn't work, we'll see
if we can come up with other ideas.


Vinh
0
 
hehehaaaaAuthor Commented:
It works!!!!
I run "modprobe -a sb2" and 2 card can both work now.
Thanks
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now