-   Linux - Hardware (
-   -   Set "defualt" sound card by name. (

jamie marchant 04-08-2013 12:28 PM

Set "defualt" sound card by name.
I have a sound card on my vidio card(only accasable through HMDMI), I also have an onboard VIA souncard(not sure, whats it's calleb but ALSA thinks it's a HDA ATI SB). For some reason I have a bug that sometimes when I boot up the sound card that is #1 is switched(so that all programs try and use the HDMI instead of the onboard). Is there a way to tell ALSA to use my "HDA ATI SB" instead of whatever sound card is #1? Thanks

DavidMcCann 04-08-2013 01:33 PM

You need to edit your profile to show which distro you use: this is a typical question that depends on that.

Most good distros (Mint, Fuduntu, Fedora, OpenSUSE) have a sound configuration tool:
If there's a speaker icon on the panel, try right clicking on it.
Look in the system, configuration, or preferences section of the menu for sound or volume.
If there's a general configuration tool, run it and look for sound, media, or hardware.
(Beware of the KDE tool, though: that only configures KDE applications, not things like Firefox.)

If you don't have one,
First, find the names of the sound devices with "aplay -l". So I get
**** List of PLAYBACK Hardware Devices ****
card 0: Device [C-Media CMI8738], device 0: CMI8738-MC6 [C-Media PCI DAC/ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

Then find the names of the sound modules in the kernel with "cat /proc/asound/modules". I get
$ snd_cmipci
$ snd_usb_audio

To configure, one or other of the following will work.

Method 1 (e.g. Arch)
Create ~/.asoundrc to contain (with appropriate entries) something like the following, then log out and in again:
defaults.pcm.card 1
defaults.pcm.device 0
defaults.ctl.card 1

Method 2 (e.g. Debian and its derivatives)
Look in /etc/modprobe.d/ for something like alsa-base.conf or alsa.conf
Edit it, setting the index for the module you want to 1
options snd_usb_audio index=1
and that for the one you don't want to -2
options snd_cmipci index=-2
Then reboot.

jamie marchant 04-08-2013 01:51 PM

I am running Fedora 18(64-bit) XFCE spin. There is no "sound" control pannel sadly. I can't use those numbers due to a bug where they randomly change boot to boot. See my bug report here. Whatever Skype(problly OSS) uses has no problems with my soundcards.

DavidMcCann 04-09-2013 11:46 AM

That's why I always say "use the distro with its default GUI". But there may be a solution. If you only want to use the one sound device, you can blacklist the module for the other in /etc/modprobe.d/blacklist.conf with a line like
blacklist snd_cmipci
I can't guarantee that this will stop it being numbered, but it's worth a try.

jamie marchant 04-09-2013 02:55 PM

It worked! Thanks for your help!

jamie marchant 04-11-2013 07:15 PM

Darn, problem is back again, this time my sound card and the mic in my webcame are getting mixed up. I want the webcame mic attached for quick Skype calls, so I can't blacklist it. Skype works beacuase it uses the device name, I will do some research and if I can figure out how to address the card by name instead of number.

UPDATE: I think I fixed it, this page explains what to do:

UPDATE #2: for anyone reading this you need addintal aurguments(which I don't know) in the /etc/modprobe.conf(or eqvulent) file if you have sorround sound, what I did is numbered my other device, so that the sound card will allways be 0.

UPDATE #3: I just noticed my USB mic is no longer present, darn it seems I will have too look into this some more.

FINAL UPDATE: I should point out the /etc/modprobe.conf is /etc/modeprode.conf/local in fedora, also setting the USB mic in my webcame too 2 fixed the issue.

Also like the artical says some systems use a diffrent file for these oporationts.

pan64 05-22-2013 02:16 PM

see here:
there is a feature to fix the order of the devices (index). I'm not really sure about that, but hope...

All times are GMT -5. The time now is 04:24 AM.