Skip to contentSkip to conversation

Change default sound card ?

DISCUSSION [email protected] 2 participants 4 messages Mar 8, 2005

lore
Share & tools
lore
#0 lore raw

Hi!

Recently I tried to change my default sound card (I have two) and it seems more complicated than needed. (I am new to ALSA. If I overlooked a simple solution, please point towards gently.)

Currently (alsa-1.0.8) it looks like this ( file locations might be debian specific )

/usr/share/alsa/alsa.conf :

# defaults

defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0 defaults.pcm.subdevice -1 defaults.pcm.front.card defaults.pcm.card defaults.pcm.front.device defaults.pcm.device defaults.pcm.rear.card defaults.pcm.card defaults.pcm.rear.device defaults.pcm.device defaults.pcm.center_lfe.card defaults.pcm.card defaults.pcm.center_lfe.device defaults.pcm.device defaults.pcm.side.card defaults.pcm.card defaults.pcm.side.device defaults.pcm.device defaults.pcm.surround40.card defaults.pcm.card defaults.pcm.surround40.device defaults.pcm.device defaults.pcm.surround41.card defaults.pcm.card defaults.pcm.surround41.device defaults.pcm.device defaults.pcm.surround50.card defaults.pcm.card defaults.pcm.surround50.device defaults.pcm.device defaults.pcm.surround51.card defaults.pcm.card defaults.pcm.surround51.device defaults.pcm.device defaults.pcm.surround71.card defaults.pcm.card defaults.pcm.surround71.device defaults.pcm.device defaults.pcm.iec958.card defaults.pcm.card defaults.pcm.iec958.device defaults.pcm.device defaults.pcm.modem.card defaults.pcm.card defaults.pcm.modem.device defaults.pcm.device defaults.rawmidi.card 0 defaults.rawmidi.device 0 defaults.rawmidi.subdevice -1 defaults.hwdep.card 0 defaults.hwdep.device 0 defaults.timer.class 2 defaults.timer.sclass 0 defaults.timer.card 0 defaults.timer.device 0 defaults.timer.subdevice 0

This makes changing the default hard, as many changes are needed. For example I want to use card 1 device 1 as default, I must change :

defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.hwdep.card 0
defaults.hwdep.device 0
defaults.timer.card 0
defaults.timer.device 0

What about introducing :
defaults.card
and
defaults.device

and then use :
defaults.ctl.card defaults.card
defaults.pcm.card defaults.card
defaults.pcm.device defaults.device
defaults.rawmidi.card defaults.card
defaults.rawmidi.device defaults.device
defaults.hwdep.card defaults.card
defaults.hwdep.device defaults.device
defaults.timer.card defaults.card
defaults.timer.device defaults.device
+ the rest

This way to change the default, only two lines need change.

Sorry if the syntax is not correct, the idea should be clear thou.

Regards,
David

----------------------------------------------------------------
Varno. Enostavno. Vredno. Internet dodatne storitve.
http://www.voljatel.si/storitve/

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click

#1 lore raw
Quoted 7 lines · [email protected] wrote:

Recently I tried to change my default sound card (I have two) and it seems more complicated than needed.

For example I want to use card 1 device 1 as default, I must change :

defaults.ctl.card 0

This is the default mixer.

Quoted 2 lines

defaults.pcm.card 0
defaults.pcm.device 0

This is the default for audio output.

Quoted 6 lines

defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.hwdep.card 0
defaults.hwdep.device 0
defaults.timer.card 0
defaults.timer.device 0

These are devices that aren't used often (and your card probably doesn't even has them).

Quoted 6 lines

defaults.ctl.card defaults.card
defaults.pcm.card defaults.card
defaults.pcm.device defaults.device
defaults.rawmidi.card defaults.card
defaults.rawmidi.device defaults.device
...

PCM and RawMIDI device number are completely independent. If your preferred PCM device and RawMID device have the same device number, it's just by chance.

If you just want to swap your cards, use different "index" options in your modprobe.conf/modules.conf, e.g.:

options snd-emu10k1 index=0
options snd-intel8x0 index=1

This has the benefit of changing the card numbers for OSS emulation, too.

HTH
Clemens

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#2 lore raw

Navajanje Clemens Ladisch <[email protected]>:

Quoted 4 lines
Quoted 3 lines · [email protected] wrote:

Recently I tried to change my default sound card (I have two) and it seems more complicated than needed.

Quoted 8 lines

If you just want to swap your cards, use different "index" options in your modprobe.conf/modules.conf, e.g.:

options snd-emu10k1 index=0
options snd-intel8x0 index=1

This has the benefit of changing the card numbers for OSS emulation, too.

Yes, but I need something I can put into a users .asoundrc. (different for different uses)

----------------------------------------------------------------
Varno. Enostavno. Vredno. Internet dodatne storitve.
http://www.voljatel.si/storitve/

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click

#3 lore raw
Quoted 10 lines · David Balazic

Navajanje Clemens Ladisch <[email protected]>:

Quoted 5 lines

If you just want to swap your cards, use different "index" options in your modprobe.conf/modules.conf, e.g.:

options snd-emu10k1 index=0
options snd-intel8x0 index=1

Yes, but I need something I can put into a users .asoundrc. (different for different uses)

Then you have to change default.pcm.card and defaults.ctl.card.

If you want to use an environment variable, use ALSA_CARD.

HTH
Clemens

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click