Skip to contentSkip to conversation

Changing default card using its name

DISCUSSION Pavel Hofman 2 participants 3 messages Nov 21, 2010 – Nov 23, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

Please excuse my ignorance but I have not been able to figure out this simple task. Nowadays most PCs have multiple soundcards (onboard plus HDMI, often another PCI card). Order of the cards is not stable. How do I define in /etc/asound.conf another default card using its name and keep the PCMs defined by its corresponding alsa card/pcm config files?

In my case aplay -L:
null
Discard all samples (playback) or generate zero samples (capture)
front:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
Front speakers
surround40:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=NVidia
HDA NVidia, NVIDIA HDMI
HDMI Audio Output
front:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI DAC/ADC
Front speakers
rear:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI 2nd DAC
Rear speakers
surround40:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI 2nd DAC
4.0 Surround output to Front and Rear speakers
surround41:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI 2nd DAC
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI 2nd DAC
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI 2nd DAC
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI 2nd DAC
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CMI8768,DEV=0
C-Media CMI8768, C-Media PCI DAC/ADC
IEC958 (S/PDIF) Digital Audio Output

Is it actually possible to have iec958:CARD=CMI8768,DEV=0 as the system-wide device iec958? I have not been successful with

defaults.ctl.card "CMI8768"

which IMO would have been the simplest solution.

Thanks a lot for help.

Regards,

Pavel Hofman.

#1 lore raw

Pavel Hofman napsal(a):

Quoted 8 lines

Hi,

Please excuse my ignorance but I have not been able to figure out this simple task. Nowadays most PCs have multiple soundcards (onboard plus HDMI, often another PCI card). Order of the cards is not stable. How do I define in /etc/asound.conf another default card using its name and keep the PCMs defined by its corresponding alsa card/pcm config files?

Quoted 6 lines

In my case aplay -L:

defaults.ctl.card "CMI8768"

which IMO would have been the simplest solution.

Well, adding the exclamation mark

!defaults.pcm.card "CMI8768"

does not work either. It may look trivial, but changing the default card
while preserving the fine-tuned device definitions the for each card in
/usr/share/alsa/pcm/* and /usr/share/alsa/cards/* has been an unattainable peak for me so far. Neither have I been able to google it anywhere. IMO there must be a simple way to do this key change.

Thanks a lot for suggestion and hints.

Pavel.

#2 lore raw
Quoted 11 lines · Pavel Hofman

Pavel Hofman napsal(a):

Quoted 10 lines

Hi,

Please excuse my ignorance but I have not been able to figure out this simple task. Nowadays most PCs have multiple soundcards (onboard plus HDMI, often another PCI card). Order of the cards is not stable. How do I define in /etc/asound.conf another default card using its name and keep the PCMs defined by its corresponding alsa card/pcm config files?

In my case aplay -L:

Quoted 8 lines
Quoted 4 lines

defaults.ctl.card "CMI8768"

which IMO would have been the simplest solution.

Well, adding the exclamation mark

!defaults.pcm.card "CMI8768"

What about:

defaults.pcm.!card "CMI8768"

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.