LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Dual Soundcards in ALSA (https://www.linuxquestions.org/questions/slackware-14/dual-soundcards-in-alsa-293002/)

jp_ 02-21-2005 11:18 AM

Dual Soundcards in ALSA
 
In the older versions of slackware ( 9.0 and 10.0 ) I was able to get my sound system running ... usually without any fuss.

It seems since 10.1 though I haven't been able to get them working toghether.

Following the instructions on the ALSA site I can get either my Plantronics DSP-500 OR my Createive Audigy Gamer (emu10k1) working standalone.

The problem is when I try to get them working together. This used to work... but it doesn't seem to want to work anymore and I was hoping to get some input as to why?

Here goes!

Looks like soundcore is present.
Code:

bash-3.00# modinfo soundcore
filename:    /lib/modules/2.4.29/kernel/drivers/sound/soundcore.o.gz
description: "Core sound module"
author:      "Alan Cox"
license:    "GPL"

Cofigure with USB audio && emu10k1
Code:

./configure --with-cards=emu10k1 --with-cards=usb-audio --with-sequencer=yes;make;make install
Then...
Code:

chmod a+rw /dev/dsp /dev/mixer /dev/sequencer /dev/midi
And finally...
Code:

modprobe snd-emu10k1;modprobe snd-usb-audio;modprobe snd-pcm-oss;modprobe snd-mixer-oss;modprobe snd-seq-oss
To wrap it all up I create a modules.conf in /etc
Code:

bash-3.00# cat modules.conf
# ALSA portion
alias char-major-116 snd
alias snd-card-1 emu10k1
alias snd-card-0 snd-usb-audio
#options snd major=116 cards_limit=2
options emu10k1 index=1
options snd-usb-audio index=0

# OSS/Free portion
alias char-major-14 soundcore

# Card #0 - Plantronics DSP-500
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

# Card #1 - Creative Audigy Gamer
alias sound-slot-1 snd-card-1
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-1 snd-seq-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-8 snd-seq-oss
alias sound-service-1-12 snd-pcm-oss

#alias /dev/mixer snd-mixer-oss
#alias /dev/dsp snd-pcm-oss
#alias /dev/midi snd-seq-oss
#below snd-card-1 snd-mixer-oss snd-seq-oss snd-pcm-oss
#alias /dev/sequencer snd-seq-oss

alias char-major-195 nvidia

Keep in mind this used to work... no idea why it doesn't now. Any help would be really appreciated =)

jp_ 02-21-2005 05:35 PM

**bump** anyone?

linuxbuck2000 02-22-2005 04:08 AM

run "alsamixer" look for MM under any playback controls if so those are muted use "m M" and "<>"
to unmute. sorry cant think of anything else at moment to tired.

hope that helped.

jp_ 02-22-2005 09:05 AM

Thanks for the tip. I'm very familiar with alsamixer and alsactl. I always unmute after install.

I can get sound working for either device if I compile the alsa drivers and libs seperately. The problem seems when I try to ./configure with --cards-emu10k1 and --cards-usb-audio at the same time. One of the devices will install and the other will not. Perhaps the syntax is wrong for the ./configure.


When I do an lsmod either usb-audio OR emu10k1 are missing.


In this particular case I compiled. With...

./configure --with-cards=usb-audio --with-cards=emu10k1 --with-sequencer=yes;make;make install

The USB headset works perfectly however emu10k1 doesn't show up in lsmod. Ideas?

gbonvehi 02-22-2005 09:53 AM

Try:
Code:

/configure --with-cards=usb-audio;emu10k1 --with-sequencer=yes;make;make install

jp_ 02-22-2005 04:50 PM

Quote:

Originally posted by gbonvehi
Try:
Code:

/configure --with-cards=usb-audio;emu10k1 --with-sequencer=yes;make;make install

Almost had it... it seems to be , instead of ; for the seperator of each card.

Thanks a-bunch!

jp_ 02-23-2005 01:01 AM

I suppose one last question on this matter is in order.

Now that I have 2 working soundcards. Is there an easy way to switch between then without rebooting?

I made the Plantronics DSP-500 the primary. If I boot without it connected then the Audigy Gamer (emu10k1) defaults as the primary. But that's a hassle. Any ideas?


And thanks everyone for the help =)

anamericanjoe 12-11-2006 03:31 PM

Make an .asoundrc file in your home directory
 
There is an easy way to switch between sound cards without needing to reboot. This is the solution I've come up with, and so far it works quite well.

In order to make this work, first I needed to gather some information on how ALSA looks at my sound cards. To do this, I used

Code:

aplay -l
aplay is a command-line sound recorder and player for ALSA soundcard driver. The -l option lists all soundcards and digital audio devices.

The out put I got from the command above looked something like this:

Code:

**** List of PLAYBACK Hardware Devices ****
card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 0: Intel ICH [Intel 82801DB-ICH4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 4: Intel ICH - IEC958 [Intel 82801DB-ICH4 - IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Headset [Plantronics Headset], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Notice how my integrated sound card is labeled card 0 and my Plantronics DSP 500 is labeled card 1. Depending on how ALSA loads your cards, these may be reversed. The important thing is to note that ALSA refers to one card by 0 and the other by 1.

Now, to switch between cards, simply create a file named .asoundrc in your home directory. .asoundrc is a file where you can create a customized configuration for ALSA.

Since my integrated sound card is the default, I wanted to be able to switch to my Plantronics device without rebooting. Since ALSA refers to that device as card 1, I added the following to my .asoundrc file:

Code:

pcm.!default {
        type hw
        card 1 
}
ctl.!default {
        type hw       
        card 1 
}

Here I'm creating two rules that tell ALSA I would like card 1 to be the default device for output. Switching the output back to card 0, my integrated sound card, is trivial:

Code:

pcm.!default {
        type hw
        card 0 
}
ctl.!default {
        type hw       
        card 0 
}

Now, sound comes through my speakers rather than my Headset.

Since I only need to change two numbers in one file to make this switch happen, I imagine it would be quite easy to create a simple script that toggles these numbers for you automatically.


All times are GMT -5. The time now is 01:48 PM.