Solved

2 soundcard in linux

Posted on 2000-04-19
9
409 Views
Last Modified: 2010-04-20
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
Comment
Question by:hehehaaaa
  • 4
  • 4
9 Comments
 

Expert Comment

by:smile040800
ID: 2733958
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
 
LVL 1

Accepted Solution

by:
X2 earned 150 total points
ID: 2757661
=)  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
 

Author Comment

by:hehehaaaa
ID: 2796051
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
 
LVL 1

Expert Comment

by:X2
ID: 2797781
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:hehehaaaa
ID: 2799149
I have assign DMA 1 and 5 for sound card 1, and DMA 3 and 7 for card 2.
0
 
LVL 1

Expert Comment

by:X2
ID: 2801977
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
 

Author Comment

by:hehehaaaa
ID: 2803380
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
 
LVL 1

Expert Comment

by:X2
ID: 2806160
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
 

Author Comment

by:hehehaaaa
ID: 2816143
It works!!!!
I run "modprobe -a sb2" and 2 card can both work now.
Thanks
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now